summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
* Refactor UnwindLLDB so it doesn't populate the entire stack unlessJason Molenda2010-11-092-79/+111
| | | | | | | | | | | | | the frame count is requested or each frame is individually requested. In practice this doesn't seem to help anything because we have functions like StackFrameList::GetNumFrames() which is going to request each frame anyway. And classes like ThreadPlanStepRange and ThreadPlanStepOverRange get the stack depth in their ctor forcing a full stack walk. But at least UnwindLLDB will delay doing a full walk if it can. llvm-svn: 118477
* Fix thinko in UnwindTable.cpp where it wouldn't provde a Jason Molenda2010-11-092-3/+9
| | | | | | | | | | FuncUnwinders object if the eh_frame section was missing from an objfile. Worked fine on x86_64 but on i386 where eh_frame is unusual, that resulted in the arch default UnwindPlan being used all the time instead of picking up an assembly profile based unwindplan. llvm-svn: 118467
* Minor comment fix.Johnny Chen2010-11-081-1/+1
| | | | llvm-svn: 118450
* Cleaned up the pseudo terminal code in ProcessGDBRemote as it was spawningGreg Clayton2010-11-082-47/+34
| | | | | | | | | | | | | | a pseudo terminal even when the process being attached to. Fixed a possible crasher in the in: bool ClangASTContext::IsAggregateType (clang_type_t clang_type); It seems that if you pass in a record decl, enum decl, or objc class decl and ask it if it is an aggregate type, clang will crash. llvm-svn: 118404
* Fixed some type parsing that was causing types to thing they were forwardGreg Clayton2010-11-081-27/+56
| | | | | | declarations when they should have been. llvm-svn: 118393
* Modified the DWARF parser for both the single DWARF file and for the caseGreg Clayton2010-11-074-42/+110
| | | | | | | | | | | where the DWARF is in the .o files so they can track down the actual type for a forward declaration. This was working before for just DWARF files, but not for DWARF in .o files where the actual definition was in another .o file. Modified the main thread name in the driver to be more consistent with the other LLDB thread names. llvm-svn: 118383
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-0621-197/+223
| | | | | | | | | | | 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
* If debugserver is running on the local machine, pass it aCaroline Tice2010-11-051-15/+16
| | | | | | | | pseudoterminal to pass to the inferior for the inferior's I/O (to allow direct writing, rather than passing all the I/O around via packets). llvm-svn: 118308
* Added the equivalent of gdb's "unwind-on-signal" to the expression command, ↵Jim Ingham2010-11-053-3/+16
| | | | | | and a parameter to control it in ClangUserExpression, and on down to ClangFunction. llvm-svn: 118290
* Fixed error handling when the utility functionsSean Callanan2010-11-055-36/+80
| | | | | | | | | | | that check pointer validity fail to parse. Now lldb does not crash in that case. Also added support for checking Objective-C class validity in the Version 1 runtime as well as Version 2 runtimes with varying levels of available debug support. llvm-svn: 118271
* Handle stepping through ObjC vtable trampoline code.Jim Ingham2010-11-053-26/+521
| | | | llvm-svn: 118270
* Use the new native unwinder by default.Jason Molenda2010-11-041-1/+1
| | | | llvm-svn: 118264
* Add a ObjC V1 runtime, and a generic AppleObjCRuntime plugin.Jim Ingham2010-11-0410-116/+744
| | | | | | Also move the Checker creation into the Apple Runtime code. llvm-svn: 118255
* Revert last checkin to DisassemblerLLVM.cpp; that was some temporaryJason Molenda2010-11-041-5/+0
| | | | | | debug printfs that got left behind by accident. llvm-svn: 118244
* Add #ifdef to easily switch between the current libunwind-remote based unwinder Jason Molenda2010-11-041-0/+9
| | | | | | | or the native unwinder (UnwindLLDB). I'll make the native unwinder the default once I check in with everyone tomorrow. llvm-svn: 118243
* Revert last checking to ThreadGDBRemote.cpp; I accidentally checkedJason Molenda2010-11-041-3/+1
| | | | | | that in along with some cleanup work with the native unwinder code. llvm-svn: 118242
* Built the native unwinder with all the warnings c++-4.2 could muster;Jason Molenda2010-11-046-17/+31
| | | | | | | | | fixed them. Added DISALLOW_COPY_AND_ASSIGN to classes that should not be bitwise copied. Added default initializers for member variables that weren't being initialized in the ctor. Fixed a few shadowed local variable mistakes. llvm-svn: 118240
* Added support for loading and unloading shared libraries. This was done byGreg Clayton2010-11-042-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Handle the case where no eh_frame section is present.Jason Molenda2010-11-045-51/+81
| | | | | | | | | | | | | RegisterContextLLDB holds a reference to the SymbolContext in the vector of Cursors that UnwindLLDB maintains. Switch UnwindLLDB to hold a vector of shared pointers of Cursors so this reference doesn't become invalid. Correctly falling back from the "fast" UnwindPlan to the "full" UnwindPlan when additional registers need to be retrieved. llvm-svn: 118218
* Factored the code that implements breakpoints onSean Callanan2010-11-034-0/+195
| | | | | | | | exceptions for different languages out of ThreadPlanCallFunction and put it into the appropriate language runtimes. llvm-svn: 118200
* Fixed shared library unloads when the unloaded library doesn't come offGreg Clayton2010-11-033-114/+34
| | | | | | | | | | | | | | | | | | | the end of the list. We had an issue in the MacOSX dynamic loader where if we had shlibs: 1 - a.out 2 - a.dylib 3 - b.dylib And then a.dylib got unloaded, we would unload b.dylib due to the assumption that only shared libraries could come off the end of the list. We now properly search and find which ones get loaded. Added a new internal logging category for the "lldb" log channel named "dyld". This should allow all dynamic loaders to use this as a generic log channel so we can track shared library loads and unloads in the logs without having to have each plug-in make up its own logging channel. llvm-svn: 118147
* Fixed globals not showing up for any but the first compile unit due to a Greg Clayton2010-11-011-3/+7
| | | | | | | mismatch: I was using the compile unit user ID (the compile unit offset in the DWARF) as the compile unit index. llvm-svn: 117948
* Added a hack that allows expressions to ignoreSean Callanan2010-10-301-0/+6
| | | | | | | | | Objective-C member accessibility restrictions. Ultimately Clang should have a flag that ignores accessibility for Objective-C like it has one for C++. llvm-svn: 117768
* Using proper Objective-C types doesn't seem toSean Callanan2010-10-301-9/+0
| | | | | | make the sky fall. llvm-svn: 117767
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-2912-9/+159
| | | | | | | | | 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-3/+2
| | | | | | | | | | 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
* Fixed the "frame variable -G NAME" that would print globalGreg Clayton2010-10-281-8/+9
| | | | | | | | variables by name. It was accidentally getting all the globals for the compile unit that contained the global variable named NAME. llvm-svn: 117516
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-2718-45/+58
| | | | | | | | | | | | | | | | | 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
* Add an unwind log Printf to note when an eh_frame section isJason Molenda2010-10-262-149/+219
| | | | | | | | | | | | | | | | | loaded/parsed. Should add timers to this eventually. Delay getting a full UnwindPlan if it's possible to unwind with just a fast UnwindPlan. This keeps us from reading the eh_frame section unless we hit something built -fomit-frame pointer or we hit a frame with no symbol (read: no start address) available. It doesn't look like it is correctly falling back to using the full UnwindPlan to provide additional registers that the fast UnwindPlan doesn't supply; e.g. go to the middle of a stack and ask for r12 and it will show you the value of r12 in frame 0. That's a bug for tomorrow. llvm-svn: 117361
* Don't indent log lines by frame # spaces if the frame # exceeds 100 - the ↵Jason Molenda2010-10-262-33/+46
| | | | | | | | | | | | indentation gets to be a problem if you have a unbounded stack walk. Fix the CFA sanity checks. Add one to the arch default UnwindPlan run which was giving one extra stack frame on the main thread. Fix a couple of logging lines that had their argument order incorrect. llvm-svn: 117350
* Get a disassembler based on the correct architecture for assemblyJason Molenda2010-10-263-67/+96
| | | | | | | | | | | | prologue profiling. Change the log print statements to elide the thread number, make some of them only print when IsLogVerbose(). Add a couple of sanity checks for impossible CFA values so backtraces don't go too far off into the weeds. llvm-svn: 117343
* Check in the native lldb unwinder. Jason Molenda2010-10-256-12/+1451
| | | | | | | | | | | | | | | | | | | | | | | | Not yet enabled as the default unwinder but there are no known backtrace problems with the code at this point. Added 'log enable lldb unwind' to help diagnose backtrace problems; this output needs a little refining but it's a good first step. eh_frame information is currently read unconditionally - the code is structured to allow this to be delayed until it's actually needed. There is a performance hit when you have to parse the eh_frame information for any largeish executable/library so it's necessary to avoid if possible. It's confusing having both the UnwindPlan::RegisterLocation struct and the RegisterConextLLDB::RegisterLocation struct, I need to rename one of them. The writing of registers isn't done in the RegisterConextLLDB subclass yet; neither is the running of complex DWARF expressions from eh_frame (e.g. used for _sigtramp on Mac OS X). llvm-svn: 117256
* If we hit a thread specific breakpoint for another thread, don't report the ↵Jim Ingham2010-10-221-0/+6
| | | | | | Exception as the stop reason, you have to report no stop reason. llvm-svn: 117179
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-206-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So the issue here was that we have lldb_private::FileSpec that by default was always resolving a path when using the: FileSpec::FileSpec (const char *path); and in the: void FileSpec::SetFile(const char *pathname, bool resolve = true); This isn't what we want in many many cases. One example is you have "/tmp" on your file system which is really "/private/tmp". You compile code in that directory and end up with debug info that mentions "/tmp/file.c". Then you type: (lldb) breakpoint set --file file.c --line 5 If your current working directory is "/tmp", then "file.c" would be turned into "/private/tmp/file.c" which won't match anything in the debug info. Also, it should have been just a FileSpec with no directory and a filename of "file.c" which could (and should) potentially match any instances of "file.c" in the debug info. So I removed the constructor that just takes a path: FileSpec::FileSpec (const char *path); // REMOVED You must now use the other constructor that has a "bool resolve" parameter that you must always supply: FileSpec::FileSpec (const char *path, bool resolve); I also removed the default parameter to SetFile(): void FileSpec::SetFile(const char *pathname, bool resolve); And fixed all of the code to use the right settings. llvm-svn: 116944
* Still trying to get detach to work with debugserver. Got a bit closer,Greg Clayton2010-10-181-28/+39
| | | | | | | | | | | but something is still killing our inferior. Fixed an issue with darwin-debug where it wasn't passing all needed arguments to the inferior. Fixed a race condition with the attach to named process code. llvm-svn: 116697
* Fixed debugserver to properly attach to a process by name with the Greg Clayton2010-10-181-32/+7
| | | | | | | | | | | | | | | | | | | "vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch with the "vAttachWait;<PROCNAME>". Fixed a few issues with attaching where if DoAttach() returned no error, yet there was no valid process ID, we would deadlock waiting for an event that would never happen. Added a new "process launch" option "--tty" that will launch the process in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)" function. This currently works on MacOSX and will allow the debugging of terminal applications that do complex operations with the terminal. Cleaned up the output when the process resumes, stops and halts to be consistent with the output format. llvm-svn: 116693
* Added a new Host call to find LLDB related paths:Greg Clayton2010-10-171-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | static bool Host::GetLLDBPath (lldb::PathType path_type, FileSpec &file_spec); This will fill in "file_spec" with an appropriate path that is appropriate for the current Host OS. MacOSX will return paths within the LLDB.framework, and other unixes will return the paths they want. The current PathType enums are: typedef enum PathType { ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB mach-o file in LLDB.framework (MacOSX) exists ePathTypeSupportExecutableDir, // Find LLDB support executable directory (debugserver, etc) ePathTypeHeaderDir, // Find LLDB header file directory ePathTypePythonDir // Find Python modules (PYTHONPATH) directory } PathType; All places that were finding executables are and python paths are now updated to use this Host call. Added another new host call to launch the inferior in a terminal. This ability will be very host specific and doesn't need to be supported on all systems. MacOSX currently will create a new .command file and tell Terminal.app to open the .command file. It also uses the new "darwin-debug" app which is a small app that uses posix to exec (no fork) and stop at the entry point of the program. The GDB remote plug-in is almost able launch a process and attach to it, it currently will spawn the process, but it won't attach to it just yet. This will let LLDB not have to share the terminal with another process and a new terminal window will pop up when you launch. This won't get hooked up until we work out all of the kinks. The new Host function is: static lldb::pid_t Host::LaunchInNewTerminal ( const char **argv, // argv[0] is executable const char **envp, const ArchSpec *arch_spec, bool stop_at_entry, bool disable_aslr); Cleaned up FileSpec::GetPath to not use strncpy() as it was always zero filling the entire path buffer. Fixed an issue with the dynamic checker function where I missed a '$' prefix that should have been added. llvm-svn: 116690
* Use the ValueObject directly where possible.Jim Ingham2010-10-151-1/+1
| | | | llvm-svn: 116638
* Did a bit of parameter renaming.Greg Clayton2010-10-152-28/+28
| | | | llvm-svn: 116562
* Separated the DWARF index for types from that the index of the namespacesGreg Clayton2010-10-154-8/+19
| | | | | | | | | | | since we can't parse DW_TAG_namespace DIEs as types. They are only decls in clang. All of the types we handle right now have both clang "XXXType" classes to go with the "XXXDecl" classes which means they can be used within the lldb_private::Type class. I need to check to see which other decls that don't have associated type objects need to float around the debugger and possibly make a lldb_private::Decl class to manage them. llvm-svn: 116558
* Fixed C++ class clang type creation and display by making sure we omit Greg Clayton2010-10-133-122/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | artifical members (like the vtable pointer member that shows up in the DWARF). We were adding this to each class which was making all member variables be off by a pointer size. Added a test case so we can track this with "test/forward". Fixed the type name index in DWARF to include all the types after finding some types were being omitted due to the DW_AT_specification having the DW_AT_declaration attribute which was being read into the real type instances when there were forward declarations in the DWARF, causing the type to be omitted. We now check to make sure any DW_AT_declaration values are only respected when parsing types if the attribute is from the current DIE. After fixing the missing types, we ran into some issues with the expression parser finding duplicate entries for __va_list_tag since they are built in types and would result in a "duplicate __va_list_tag definition" error. We are now just ignoring this name during lookup, but we will need to see if we can get the name lookup function to not get called in these cases. Fixed an issue that would cause an assertion where DW_TAG_subroutine_types that had no children, would not properly make a clang function type of: "void (*) (void)". llvm-svn: 116392
* Fixed the dispatch queue name retrieval for threads by looking in an extraGreg Clayton2010-10-122-9/+23
| | | | | | shlib. llvm-svn: 116315
* Fixed the Objective C method prototypes to be correct (the selectors weren'tGreg Clayton2010-10-127-20/+108
| | | | | | | | being chopped up correctly). The DWARF plug-in also keeps a map of the ObjC class names to selectors for easy parsing of all class selectors when we parse the class type. llvm-svn: 116290
* Fixed process.gdb-remote to be able to properly propagate the signals andGreg Clayton2010-10-091-2/+5
| | | | | | obey the UnixSignals table that we have in the process. llvm-svn: 116139
* Fixed a typo from my previous "Added support for LC_LOAD_UPWARD_DYLIB in ↵Greg Clayton2010-10-091-1/+1
| | | | | | mach-o files". llvm-svn: 116132
* Added support for LC_LOAD_UPWARD_DYLIB in mach-o files.Greg Clayton2010-10-091-0/+1
| | | | llvm-svn: 116128
* Added mutex protection to the Symtab class.Greg Clayton2010-10-082-3/+6
| | | | | | | | Added a new SortOrder enumeration and hooked it up to the "image dump symtab" command so we can dump symbol tables in the original order, sorted by address, or sorted by name. llvm-svn: 116049
* Added extra logging, and made sure that the argumentSean Callanan2010-10-081-0/+40
| | | | | | | struct for expressions is deallocated when the ClangExpressionDeclMap is taken down. llvm-svn: 116028
* Hooked up ability to look up data symbols so they show up in disassemblyGreg Clayton2010-10-081-2/+10
| | | | | | | | | | | | if the address comes from a data section. Fixed an issue that could occur when looking up a symbol that has a zero byte size where no match would be returned even if there was an exact symbol match. Cleaned up the section dump output and added the section type into the output. llvm-svn: 116017
* Make sure to lock down the sequence mutex and select the thread we want when ↵Greg Clayton2010-10-071-15/+30
| | | | | | read or write all registers. llvm-svn: 115992
OpenPOWER on IntegriCloud