summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
Commit message (Collapse)AuthorAgeFilesLines
* For the language check in GetObjectDescription, if we can't find a language ↵Jim Ingham2010-12-231-0/+12
| | | | | | runtime for the value we're looking at, BUT it IS at least a pointer, try the ObjCRuntime language. That's currently the only language runtime that has an object description method anyway... llvm-svn: 122465
* Broadcaster::AddListener(): Bail out early if the passed in Listener pointer isJohnny Chen2010-12-221-0/+3
| | | | | | NULL, instead of registering a NULL listener and to crash later. llvm-svn: 122429
* Remove an assertion that is causing crashes. We do need to find a way to ↵Greg Clayton2010-12-201-1/+11
| | | | | | reproduce when this assertion asserts, but we should crash our debug session because of it. For now we log to stderr in hope of tracking it down. llvm-svn: 122290
* Patch from Stephen Wilson:Johnny Chen2010-12-201-0/+2
| | | | | | | POSIX does not define sockaddr_un.sun_len. Set only when required by the platform. llvm-svn: 122266
* The LLDB API (lldb::SB*) is now thread safe!Greg Clayton2010-12-201-1/+1
| | | | llvm-svn: 122262
* Add code to make sure InputReaders finish and are cleaned up whenCaroline Tice2010-12-201-0/+19
| | | | | | | | a Debugger object is destroyed or re-set. (Thus making sure that, for example, the Python interpreter finishes and exits cleanly rather than being left in an undefined state.) llvm-svn: 122255
* Improved our argument parsing abilities to be able to handle stuff more likeGreg Clayton2010-12-192-27/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a shell would interpret it. A few examples that we now handle correctly INPUT: "Hello "world OUTPUT: "Hello World" INPUT: "Hello "' World' OUTPUT: "Hello World" INPUT: Hello" World" OUTPUT: "Hello World" This broke the setting of dictionary values for the "settings set" command for things like: (lldb) settings set target.process.env-vars ["MY_ENV_VAR"]=YES since we would drop the quotes. I fixed the user settings controller to use a regular expression so it can accept any of the following inputs for dictionary setting: settings set target.process.env-vars ["MY_ENV_VAR"]=YES settings set target.process.env-vars [MY_ENV_VAR]=YES settings set target.process.env-vars MY_ENV_VAR=YES We might want to eventually drop the first two syntaxes, but I won't make that decision right now. This allows more natural setting of the envirorment variables: settings set target.process.env-vars MY_ENV_VAR=YES ABC=DEF CWD=/tmp llvm-svn: 122166
* Fixed the "expression" command object to use the ↵Greg Clayton2010-12-151-76/+25
| | | | | | | | | | | | | 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
* Move the demangle-failed indication out a bit so other failing casesJason Molenda2010-12-151-6/+6
| | | | | | | also get marked as having failed (so we don't try to demangle the same symbol multiple times). llvm-svn: 121835
* Fix a crash on some platforms where a dSYM for a system library lists a ↵Jason Molenda2010-12-151-1/+2
| | | | | | | | | | DW_AT_mips_linkage_name for a non-mangled function - we pass the non mangled string down through abi::__cxa_demangle and it crashes. Usually passing non mangled strings to abi::__cxa_demangle works out fine but not always, apparently. llvm-svn: 121834
* Modified LLDB expressions to not have to JIT and run code just to see variableGreg Clayton2010-12-146-67/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert a small but important part of the EOF handling code that Greg Caroline Tice2010-12-131-2/+6
| | | | | | missed in his previous revert. llvm-svn: 121712
* Fixed a multi-threaded race condition that could happen when communication ↵Greg Clayton2010-12-121-1/+11
| | | | | | classes are shutting down. We currently don't protect communication connection classes against multi-threaded access. The connection is stored in the lldb_private::Communication.m_connection_ap auto_ptr member. We either need to add protections when accessing this class or not let anything racy occur. With this fix, we are doing the latter. llvm-svn: 121647
* Fixed an issue where the macosx dynamic loader, on the first shared library ↵Greg Clayton2010-12-121-1/+1
| | | | | | loaded notification, wasn't properly removing shared libraries from the target that didn't get loaded. This usually happens when a different shared library is loaded in place of another due to DYLD_LIBRARY_PATH or DYLD_FRAMEWORK_PATH environment variables. We now properly remove any images that didn't make it into the executable. llvm-svn: 121641
* Various fixes mostly relating to the User Settings stuff:Caroline Tice2010-12-101-6/+21
| | | | | | | | | | | | | | | | | - Added new utility function to Arg, GetQuotedCommandString, which re-assembles the args into a string, replacing quotes that were originally there. - Modified user settings stuff to always show individual elements when printing out arrays and dictionaries. - Added more extensive help to 'settings set', explaining more about dictionaries and arrays (including current dictionary syntax). - Fixed bug in user settings where quotes were being stripped and lost, so that sometimes array or dictionary elements that ought to have been a single element were being split up. llvm-svn: 121438
* Fixed an issue in our source manager where we were permanently caching sourceGreg Clayton2010-12-081-0/+12
| | | | | | | | file data, so if a source file was modified, we would always show the first cached copy of the source data. We now check file modification times when displaying source info so we can show the update source info. llvm-svn: 121278
* Added the ability to dump sections to a certain depth (for when sectionsGreg Clayton2010-12-083-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Cleanup before making the objective C ivar changes.Greg Clayton2010-12-071-37/+2
| | | | llvm-svn: 121158
* Improved the "image dump section" command output by making sureGreg Clayton2010-12-071-4/+5
| | | | | | | | | | | | | | | | | it indents and shows things correctly. When we are debugging DWARF in .o files with debug map, we can see the remapped sections by dumping the sections for the .o files by explicitly dumping the module by name. For example, debugging the lldb/test/class_types example on MacOSX without a dSYM file we can make a query that causes the main.o file to be loaded, then we can do a: (lldb) image dump section main.o This will show the exact section map that is used and can help track down when things are going wrong with DWARF in .o files with debug map. llvm-svn: 121154
* Fixed an issue when debugging with DWARF in the .o files whereGreg Clayton2010-12-071-4/+2
| | | | | | | | | | | | if two functions had the same demangled names (constructors where we have the in charge and not in charge version) we could end up mixing the two up when making the function in the DWARF. This was because we need to lookup the symbol by name and we need to use the mangled name if there is one. This ensures we get the correct address and that we resolve the linked addresses correctly for DWARf with debug map. llvm-svn: 121116
* When shared libraries are unloaded, they are now removed from the targetGreg Clayton2010-12-061-0/+14
| | | | | | | | | 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
* More reverting of the EOF stuff as the API was changed which we don't want toGreg Clayton2010-12-042-9/+4
| | | | | | | | | | 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
* Reverted the close on EOF stuff again as it was crashing Xcode.Greg Clayton2010-12-041-10/+2
| | | | llvm-svn: 120883
* Added the ability for a process to inherit the current host environment. ThisGreg Clayton2010-12-041-1/+1
| | | | | | | | | | 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
* Updated to latest LLVM/Clang for external AST source changes that allowGreg Clayton2010-12-021-2/+2
| | | | | | | TagDecl subclasses and Objective C interfaces to complete themselves through the ExternalASTSource class. llvm-svn: 120749
* Add proper EOF handling to Communication & Connection classes:Caroline Tice2010-12-023-7/+21
| | | | | | | | | | 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
* 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
* Revert the End of file stuff that was added as it was causing read threadsGreg Clayton2010-11-202-18/+4
| | | | | | | to hang around and take a ton of CPU time. Caroline will fix this when she gets back from vacation. llvm-svn: 119877
* Add the ability to catch and do the right thing with Interrupts (often ↵Caroline Tice2010-11-194-9/+65
| | | | | | | | control-c) and end-of-file (often control-d). llvm-svn: 119837
* Print out addresses with the correct width for 32 bit programs.Greg Clayton2010-11-191-1/+6
| | | | llvm-svn: 119786
* Fixed an issue where the UserSettingsControllers were being created out ofGreg Clayton2010-11-192-6/+6
| | | | | | | 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-182-27/+38
| | | | | | | | | | | | | | | | | | 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
* Make processes use InputReaders for their input. Move the processCaroline Tice2010-11-162-16/+4
| | | | | | | | | 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
* Just like functions can have a basename and a mangled/demangled name, variableGreg Clayton2010-11-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | can too. So now the lldb_private::Variable class has support for this. Variables now have support for having a basename ("i"), and a mangled name ("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i"). Nowwhen searching for a variable by name, users might enter the fully qualified name, or just the basename. So new test functions were added to the Variable and Mangled classes as: bool NameMatches (const ConstString &name); bool NameMatches (const RegularExpression &regex); I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search for global variables that are not in the current file scope by first starting with the current module, then moving on to all modules. Fixed an issue in the DWARF parser that could cause a varaible to get parsed more than once. Now, once we have parsed a VariableSP for a DIE, we cache the result even if a variable wasn't made so we don't do any re-parsing. Some DW_TAG_variable DIEs don't have locations, or are missing vital info that stops a debugger from being able to display anything for it, we parse a NULL variable shared pointer for these DIEs so we don't keep trying to reparse it. llvm-svn: 119085
* Modified the lldb_private::Type clang type resolving code to handle threeGreg Clayton2010-11-136-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add ThreadPlanTracer class to allow instruction step tracing of execution.Jim Ingham2010-11-112-4/+4
| | | | | | Also changed eSetVarTypeBool to eSetVarTypeBoolean to make it consistent with eArgTypeBoolean. llvm-svn: 118824
* Fixed FileSpec's operator == to deal with equivalent paths such as "/tmp/a.c"Greg Clayton2010-11-081-10/+73
| | | | | | | | | | | | | | and "/private/tmp/a.c". This was done by adding a "mutable bool m_is_resolved;" member to FileSpec and then modifying the equal operator to check if the filenames are equal, and if they are, then check the directories. If they are not equal, then both paths are checked to see if they have been resolved. If they have been resolved, we resolve the paths in temporary FileSpec objects and set each of the m_is_resolved bools to try (for lhs and rhs) if the paths match what is contained in the path. This allows us to do more intelligent compares without having to resolve all paths found in the debug info (which can quickly get costly if the files are on remote NFS mounts). llvm-svn: 118387
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-067-20/+21
| | | | | | | | | | | 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 a setting to "log timer" so you can see the incremental timings as well:Jim Ingham2010-11-041-1/+6
| | | | | | log timer increment true/false llvm-svn: 118268
* Added support for loading and unloading shared libraries. This was done byGreg Clayton2010-11-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fixed a case where children of pointers or references that had had multipleGreg Clayton2010-11-021-4/+1
| | | | | | children always incorrectly displayed the child at offset zero. llvm-svn: 118070
* Fixed our overly verbose stop reasons which by default included the threadGreg Clayton2010-11-021-2/+9
| | | | | | | name and thread queue. Users can modify the thread-format strings to add these back if needed. llvm-svn: 118000
* Print better error messages when memory reads fail when displaying variableGreg Clayton2010-11-023-24/+47
| | | | | | | | | values. Always show the variable types for the top level items when dumping program variables. llvm-svn: 117999
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-315-74/+81
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Missed a file in my last commit.Caroline Tice2010-10-291-0/+2
| | | | llvm-svn: 117716
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-293-4/+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
* Modified the lldb_private::TypeList to use a std::multimap for quicker lookupGreg Clayton2010-10-291-1/+1
| | | | | | | | | | by type ID (the most common type of type lookup). Changed the API logging a bit to always show the objects in the OBJECT(POINTER) format so it will be easy to locate all instances of an object or references to it when looking at logs. llvm-svn: 117641
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-275-176/+124
| | | | | | | | | | | | | | | | | all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
* First pass at adding logging capabilities for the API functions. At the momentCaroline Tice2010-10-263-0/+49
| | | | | | | | | | | | | | | | | | it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
* Fixes to Objective-C built-in type handling.Sean Callanan2010-10-251-0/+2
| | | | | | | | | Specifically, we fixed handling of the objc_class built-in type, which allowed us to pass named Objective-C objects to functions, call variable list -t on objects safely, etc. llvm-svn: 117249
OpenPOWER on IntegriCloud