summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
Commit message (Collapse)AuthorAgeFilesLines
* RegisterContextLLDB.cpp (InitializeNonZerothFrame): If we get aJason Molenda2010-12-221-6/+8
| | | | | | | | | | | 0 mid-stack, stop backtracing. SectionLoadList.cpp (ResolveLoadAddress): Don't assert on an out-of-range address, just return an invalid Address object. The unwinder may be passing in invalid addresses on the final stack frame and the assert is a problem. llvm-svn: 122386
* The LLDB API (lldb::SB*) is now thread safe!Greg Clayton2010-12-202-1/+2
| | | | llvm-svn: 122262
* Added the ability to read unsigned integers from the Process:Greg Clayton2010-12-161-0/+23
| | | | | | uint64_t Process::ReadUnsignedInteger (addr_t addr, size_t int_byte_size, Error &error); llvm-svn: 121996
* Fix invalid conversion from "const char *" to "char *" for linux systems. ↵Greg Clayton2010-12-151-1/+1
| | | | | | strchr() on darwin returns "char *" so we weren't seeing this issue on MacOSX. llvm-svn: 121897
* Fixed an error where the thread index was being returned as zero in ↵Greg Clayton2010-12-151-3/+3
| | | | | | "uint32_t SBBreakpoint::GetThreadIndex() const" even when it isn't specified. It should be UINT32_MAX to indicate there is no thread index set for the breakpoint (the breakpoint isn't thread specific). Also fixed the ThreadSpec.cpp to use UINT32_MAX instead of -1. Fixed the logging Printf statement in "uint32_t SBBreakpoint::GetThreadIndex() const" to not print the address of the "index" function from <string.h>! llvm-svn: 121896
* Fixed the "expression" command object to use the ↵Greg Clayton2010-12-152-116/+198
| | | | | | | | | | | | | StackFrame::GetValueForExpressionPath() function and also hooked up better error reporting for when things fail. Fixed issues with trying to display children of pointers when none are supposed to be shown (no children for function pointers, and more like this). This was causing child value objects to be made that were correctly firing an assertion. llvm-svn: 121841
* Modified LLDB expressions to not have to JIT and run code just to see variableGreg Clayton2010-12-145-30/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior. There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions. Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions. Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values. Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread. Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else. llvm-svn: 121745
* Added support for generating expressions that haveSean Callanan2010-12-132-3/+6
| | | | | | | | | | | | | | access to the members of the Objective-C self object. The approach we take is to generate the method as a @category on top of the self object, and to pass the "self" pointer to it. (_cmd is currently NULL.) Most changes are in ClangExpressionDeclMap, but the change that adds support to the ABIs to pass _cmd touches a fair amount of code. llvm-svn: 121722
* Added the ability to dump sections to a certain depth (for when sectionsGreg Clayton2010-12-082-35/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | have children sections). Modified SectionLoadList to do it's own multi-threaded protected on its map. The ThreadSafeSTLMap class was difficult to deal with and wasn't providing much utility, it was only getting in the way. Make sure when the communication read thread is about to exit, it clears the thread in the main class. Fixed the ModuleList to correctly ignore architectures and UUIDs if they aren't valid when searching for a matching module. If we specified a file with no arch, and then modified the file and loaded it again, it would not match on subsequent searches if the arch was invalid since it would compare an invalid architecture to the one that was found or selected within the shared library or executable. This was causing stale modules to stay around in the global module list when they should have been removed. Removed deprecated functions from the DynamicLoaderMacOSXDYLD class. Modified "ProcessGDBRemote::IsAlive" to check if we are connected to a gdb server and also make sure our process hasn't exited. llvm-svn: 121236
* Fixed up the error message for when a file is not supported.Greg Clayton2010-12-081-13/+23
| | | | llvm-svn: 121235
* When shared libraries are unloaded, they are now removed from the targetGreg Clayton2010-12-061-0/+4
| | | | | | | | | ModuleList so they don't show up in the images. Breakpoint locations that are in shared libraries that get unloaded will persist though so that if you have plug-ins that load/unload and you have a breakpoint set on functions in the plug-ins, the hit counts will persist between loads/unloads. llvm-svn: 121069
* Make sure that STDOUT and STDERR events in lldb_private::Process carry alongGreg Clayton2010-12-051-1/+1
| | | | | | a ProcessEventData so clients can get the process from these events. llvm-svn: 120947
* More reverting of the EOF stuff as the API was changed which we don't want toGreg Clayton2010-12-041-1/+1
| | | | | | | | | | do. Closing on EOF is an option that can be set on the lldb_private::Communication or the lldb::SBCommunication objects after they are created. Of course the EOF support isn't hooked up, so they don't do anything at the moment, but they are left in so when the code is fixed, it will be easy to get working again. llvm-svn: 120885
* Added the ability to display the new "target.process.inherit-env" setting.Greg Clayton2010-12-041-0/+7
| | | | llvm-svn: 120863
* Added the ability for a process to inherit the current host environment. ThisGreg Clayton2010-12-043-19/+92
| | | | | | | | | | was done as an settings variable in the process for now. We will eventually move all environment stuff over to the target, but we will leave it with the process for now. The default setting is for a process to inherit the host environment. This can be disabled by setting the "inherit-env" setting to false in the process. llvm-svn: 120862
* Add '-no-stdio' option to 'process launch' command, which causes theCaroline Tice2010-12-031-4/+25
| | | | | | | | | | inferior to be launched without setting up terminal stdin/stdout for it (leaving the lldb command line accessible while the program is executing). Also add a user settings variable, 'target.process.disable-stdio' to allow the user to set this globally rather than having to use the command option each time the process is launched. llvm-svn: 120825
* Fixed a typo in comment.Johnny Chen2010-12-021-1/+1
| | | | llvm-svn: 120733
* Add proper EOF handling to Communication & Connection classes:Caroline Tice2010-12-021-1/+1
| | | | | | | | | | Add bool member to Communication class indicating whether the Connection should be closed on receiving an EOF or not. Update the Connection read to return an EOF status when appropriate. Modify the Communication class to pass the EOF along or not, and to close the Connection or not, as appropriate. llvm-svn: 120723
* Moved the code in ClangUserExpression that set up & ran the thread plan with ↵Jim Ingham2010-11-305-7/+360
| | | | | | | | | | timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming. Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it. Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened. llvm-svn: 120386
* Change the DWARFExpression::Evaluate methods to take an optionalJason Molenda2010-11-201-1/+1
| | | | | | | | | | | | | | RegisterContext* - normally this is retrieved from the ExecutionContext's StackFrame but when we need to evaluate an expression while creating the stack frame list this can be a little tricky. Add DW_OP_deref_size, needed for the _sigtramp FDE expression. Add support for processing DWARF expressions in RegisterContextLLDB. Update callers to DWARFExpression::Evaluate. llvm-svn: 119885
* Add the ability to catch and do the right thing with Interrupts (often ↵Caroline Tice2010-11-191-5/+9
| | | | | | | | control-c) and end-of-file (often control-d). llvm-svn: 119837
* Fixed an issue where the UserSettingsControllers were being created out ofGreg Clayton2010-11-193-18/+24
| | | | | | | order and this was causing the target, process and thread trees to not be available. llvm-svn: 119784
* Cleaned up code that wasn't using the Initialize and Terminate paradigm byGreg Clayton2010-11-183-59/+67
| | | | | | | | | | | | | | | | | | changing it to use it. There was an extra parameter added to the static accessor global user settings controllers that wasn't needed. A bool was being used as a parameter to the accessor just so it could be used to clean up the global user settings controller which is now fixed by splitting up the initialization into the "static void Class::Initialize()", access into the "static UserSettingsControllerSP & Class::GetSettingsController()", and cleanup into "static void Class::Terminate()". Also added initialize and terminate calls to the logging code to avoid issues when LLDB is shutting down. There were cases after the logging was switched over to use shared pointers where we could crash if the global destructor chain was being run and it causes the log to be destroyed and any any logging occurred. llvm-svn: 119757
* Added the ability to get more information on the SBThread's stop reasonGreg Clayton2010-11-181-0/+1
| | | | | | | | | | | | | | by being able to get the data count and data. Each thread stop reason has one or more data words that can help describe the stop. To do this I added: size_t SBThread::GetStopReasonDataCount(); uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx); llvm-svn: 119720
* Fixed Process::Halt() as it was broken for "process halt" after recent changesGreg Clayton2010-11-181-13/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to the DoHalt down in ProcessGDBRemote. I also moved the functionality that was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has to implement a tricky halt/resume on the internal state thread. The functionality is the same as it was before with two changes: - when we eat the event we now just reuse the event we consume when the private state thread is paused and set the interrupted bool on the event if needed - we also properly update the Process::m_public_state with the state of the event we consume. Prior to this, if you issued a "process halt" it would eat the event, not update the process state, and then produce a new event with the interrupted bit set and send it. Anyone listening to the event would get the stopped event with a process that whose state was set to "running". Fixed debugserver to not have to be spawned with the architecture of the inferior process. This worked fine for launching processes, but when attaching to processes by name or pid without a file in lldb, it would fail. Now debugserver can support multiple architectures for a native debug session on the current host. This currently means i386 and x86_64 are supported in the same binary and a x86_64 debugserver can attach to a i386 executable. This change involved a lot of changes to make sure we dynamically detect the correct registers for the inferior process. llvm-svn: 119680
* The thread plan destructors may call Thread virtual methods. That means ↵Jim Ingham2010-11-182-2/+20
| | | | | | they have to get cleaned up in the derived class's destructor. Make sure that happens. llvm-svn: 119675
* Add a missing newline to the ThreadPlanAssemblyTracer output.Jim Ingham2010-11-171-1/+1
| | | | llvm-svn: 119553
* Add a ThreadPlanAssemblyTracer that takes just a thread (since that's how we ↵Jim Ingham2010-11-171-1/+15
| | | | | | call it from ThreadPlanBase...) llvm-svn: 119549
* Added an "Interrupted" bit to the ProcessEventData. Halt now generates an eventJim Ingham2010-11-171-36/+53
| | | | | | | | | with the Interrupted bit set. Process::HandlePrivateEvent ignores Interrupted events. DoHalt is changed to ensure that the stop even is processed, and an event with the Interrupted event is posted. Finally ClangFunction is rationalized to use this facility so the that Halt is handled more deterministically. llvm-svn: 119453
* Make processes use InputReaders for their input. Move the processCaroline Tice2010-11-161-1/+125
| | | | | | | | | ReadThread stuff into the main Process class (out of the Process Plugins). This has the (intended) side effect of disabling the command line tool from reading input/commands while the process is running (the input is directed to the running process rather than to the command interpreter). llvm-svn: 119329
* Modified the lldb_private::Type clang type resolving code to handle threeGreg Clayton2010-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | cases when getting the clang type: - need only a forward declaration - need a clang type that can be used for layout (members and args/return types) - need a full clang type This allows us to partially parse the clang types and be as lazy as possible. The first case is when we just need to declare a type and we will complete it later. The forward declaration happens only for class/union/structs and enums. The layout type allows us to resolve the full clang type _except_ if we have any modifiers on a pointer or reference (both R and L value). In this case when we are adding members or function args or return types, we only need to know how the type will be laid out and we can defer completing the pointee type until we later need it. The last type means we need a full definition for the clang type. Did some renaming of some enumerations to get rid of the old "DC" prefix (which stands for DebugCore which is no longer around). Modified the clang namespace support to be almost ready to be fed to the expression parser. I made a new ClangNamespaceDecl class that can carry around the AST and the namespace decl so we can copy it into the expression AST. I modified the symbol vendor and symbol file plug-ins to use this new class. llvm-svn: 118976
* Added a thread plan tracer that prints lines ofSean Callanan2010-11-121-0/+205
| | | | | | assembly as well as registers that changed. llvm-svn: 118879
* Excised a version of the low-level function callingSean Callanan2010-11-122-87/+0
| | | | | | | | | logic that supported calling functions with arbitrary arguments. We use ClangFunction for this, and the low-level logic is only required to support one or two pointer arguments. llvm-svn: 118871
* Add ThreadPlanTracer class to allow instruction step tracing of execution.Jim Ingham2010-11-1114-61/+227
| | | | | | Also changed eSetVarTypeBool to eSetVarTypeBoolean to make it consistent with eArgTypeBoolean. llvm-svn: 118824
* Remove an obsolete reference to immediate plans.Jim Ingham2010-11-101-1/+1
| | | | llvm-svn: 118691
* Added more logging so we see the register stateSean Callanan2010-11-081-0/+38
| | | | | | | | | when a function starts and ends, and also the disassembly for anything that is a client of ClangExpressionParser after it has been JIT compiled. llvm-svn: 118401
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-0619-64/+62
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Added the equivalent of gdb's "unwind-on-signal" to the expression command, ↵Jim Ingham2010-11-052-10/+45
| | | | | | and a parameter to control it in ClangUserExpression, and on down to ClangFunction. llvm-svn: 118290
* Don't need both LIBLLDB_LOG_DYNAMIC_LOADER and LIBLLDB_LOG_SHLIB. Go with ↵Jim Ingham2010-11-051-3/+3
| | | | | | the former. llvm-svn: 118282
* Handle stepping through ObjC vtable trampoline code.Jim Ingham2010-11-052-19/+46
| | | | llvm-svn: 118270
* Add a ObjC V1 runtime, and a generic AppleObjCRuntime plugin.Jim Ingham2010-11-041-20/+0
| | | | | | Also move the Checker creation into the Apple Runtime code. llvm-svn: 118255
* Added support for loading and unloading shared libraries. This was done byGreg Clayton2010-11-041-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding support into lldb_private::Process: virtual uint32_t lldb_private::Process::LoadImage (const FileSpec &image_spec, Error &error); virtual Error lldb_private::Process::UnloadImage (uint32_t image_token); There is a default implementation that should work for both linux and MacOSX. This ability has also been exported through the SBProcess API: uint32_t lldb::SBProcess::LoadImage (lldb::SBFileSpec &image_spec, lldb::SBError &error); lldb::SBError lldb::SBProcess::UnloadImage (uint32_t image_token); Modified the DynamicLoader plug-in interface to require it to be able to tell us if it is currently possible to load/unload a shared library: virtual lldb_private::Error DynamicLoader::CanLoadImage () = 0; This way the dynamic loader plug-ins are allows to veto whether we can currently load a shared library since the dynamic loader might know if it is currenlty loading/unloading shared libraries. It might also know about the current host system and know where to check to make sure runtime or malloc locks are currently being held. Modified the expression parser to have ClangUserExpression::Evaluate() be the one that causes the dynamic checkers to be loaded instead of other code that shouldn't have to worry about it. llvm-svn: 118227
* Re-enabled LLDB's pointer checkers, and moved theSean Callanan2010-11-042-4/+31
| | | | | | | implementation of the Objective-C object checkers into the Objective-C language runtime. llvm-svn: 118226
* Factored the code that implements breakpoints onSean Callanan2010-11-031-102/+17
| | | | | | | | exceptions for different languages out of ThreadPlanCallFunction and put it into the appropriate language runtimes. llvm-svn: 118200
* Modified ThreadPlanCallFunction to perform theSean Callanan2010-11-031-17/+66
| | | | | | | | exception checks at the right time, and modified ClangFunction so that it doesn't misinterpret the stop as a timeout stop. llvm-svn: 118189
* Modified the thread plan that calls functions toSean Callanan2010-11-031-4/+93
| | | | | | | | set breakpoints at the different locations where an exception could be thrown, so that exceptions thrown by expressions are properly caught. llvm-svn: 118142
* Fixed StackFrame::GetVariableList to add globalSean Callanan2010-11-011-12/+17
| | | | | | | variables to the list of found variables if they have not yet been added. llvm-svn: 117896
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-312-2/+11
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Improved API logging.Greg Clayton2010-10-301-1/+1
| | | | llvm-svn: 117772
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-293-0/+8
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
OpenPOWER on IntegriCloud