summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a loop that I was testing changes with and forgotGreg Clayton2011-08-061-1/+1
| | | | | | to revert to zero. llvm-svn: 137008
* This is an overhaul of the expression parser codeSean Callanan2011-08-052-22/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | that detects what context the current expression is meant to execute in. LLDB now properly consults the method declaration in the debug information rather than trying to hunt down the "this" or "self" pointer by name, which can be misleading. Other fixes include: - LLDB now properly detects that it is inside an inlined C++ member function. - LLDB now allows access to non-const members when in const code. - The functions in SymbolFile that locate the DeclContext containing a DIE have been renamed to reflect what they actually do. I have added new functions that find the DeclContext for the DIE itself. I have also introduced testcases for C++ and Objective-C. llvm-svn: 136999
* Fixed issues for iOS debugging where if a device hasGreg Clayton2011-08-052-24/+32
| | | | | | | | | a native architecture that doesn't match the universal slice that is being used for all executables, we weren't correctly descending through the platform architectures and resolving the binaries. llvm-svn: 136980
* Make sure we track CXX and objc method decls.Greg Clayton2011-08-041-0/+3
| | | | llvm-svn: 136920
* Basic handling of Objective-C tagged pointers: return a custom ISA and ↵Enrico Granata2011-08-032-0/+30
| | | | | | typename when one is detected llvm-svn: 136819
* Patch from David Forsythe for FreeBSD build!Johnny Chen2011-08-033-2/+7
| | | | llvm-svn: 136800
* Fixed an issue of wrong (by +2) branch target calculation in the ↵Johnny Chen2011-08-031-0/+6
| | | | | | | | | | | disassembler's symbolic information output. A8.6.23 BLX (immediate T2) Target Address = Align(PC, 4) + offset value rdar://problem/9885678 llvm-svn: 136766
* Fixed an issue with parsing object files from .a archives. Greg Clayton2011-08-031-20/+12
| | | | | | | | | | The entire .a file gets cached, and after the first .o file gets loaded, a cached version would get used when trying to extract the skinny slice from a fat BSD archive and would cause a code path to get taken in the BSD archive parser even if we aren't at a BSD archive offset. llvm-svn: 136765
* Fixed an issue where the KVO swizzled type would be returned as the dynamic ↵Enrico Granata2011-08-031-1/+43
| | | | | | | | | | type instead of the actual user-level type - see the test case in lang/objc/objc-dynamic-value for an example Objective-C dynamic type lookup now works for every Objective-C type - previously, true dynamic lookup was only performed for type id llvm-svn: 136763
* Add method Module::IsLoadedInTarget, and then in the MacOS X dynamic loader, ↵Jim Ingham2011-08-031-0/+30
| | | | | | | | | after we have initialized our shared library state, discard all the modules that didn't make it into the running process. llvm-svn: 136755
* Fixed a bug in which the DWARF reader did not distinguishSean Callanan2011-08-022-3/+14
| | | | | | | | | | | | | appropriately between C++ static methods and non-static methods. This bug made it impossible to call most static methods, either because Clang did not recognize that a method could be called without providing a "this" parameter, or because Clang did not properly mangle the name of the method when searching for it in the target. Also added a testcase. llvm-svn: 136733
* Patch by David Forsythe to build lldb on FreeBSD!Johnny Chen2011-08-025-2/+391
| | | | | | | | | | | | | | | | | | I did not take the patch for ClangExpressionParser.cpp since there was a recent change by Peter for the same line. Feel free to disagree. :-) Reference: ---------------------------------------------------------------------- r136580 | pcc | 2011-07-30 15:42:24 -0700 (Sat, 30 Jul 2011) | 3 lines Add reloc arg to standard JIT createJIT() Fixes non-__APPLE__ build. Patch by Matt Johnson! ---------------------------------------------------------------------- Also, I ignore the part of the patch to remove the RegisterContextDarwin*.h/.cpp. llvm-svn: 136720
* Fixed a bug where a variable could not be formatted in a summary if its ↵Enrico Granata2011-08-024-1/+150
| | | | | | | | | | | | | datatype already had a custom format Fixed a bug where Objective-C variables coming out of the expression parser could crash the Python synthetic providers: - expression parser output has a "frozen data" component, which is a byte-exact copy of the value (in host memory), if trying to read into memory based on the host address, LLDB would crash. we are now passing the correct (target) pointer to the Python code Objective-C "id" variables are now formatted according to their dynamic type, if the -d option to frame variable is used: - Code based on the Objective-C 2.0 runtime is used to obtain this information without running code on the target llvm-svn: 136695
* Remove the deprecated MacOSX native plug-in.Greg Clayton2011-08-0135-11259/+38
| | | | llvm-svn: 136626
* Copy the native darwin register stuff out of the ProcessMacOSXGreg Clayton2011-08-016-0/+380
| | | | | | plug-in folder. llvm-svn: 136625
* This change brings in the latest LLVM/Clang, andSean Callanan2011-07-302-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | completes the support in the LLDB expression parser for incomplete types. Clang now imports types lazily, and we complete those types as necessary. Changes include: - ClangASTSource now supports three APIs which it passes to ClangExpressionDeclMap. CompleteType completes a TagDecl or an ObjCInterfaceDecl when needed; FindExternalVisibleDecls finds named entities that are visible in the expression's scope; and FindExternalLexicalDecls performs a (potentially restricted) search for entities inside a lexical scope like a namespace. These changes mean that entities in namespaces should work normally. - The SymbolFileDWARF code for searching a context for a specific name is now more general, and can search arbitrary contexts. - We are continuing to adapt our calls into LLVM from interfaces that take start and end iterators when accepting multiple items to interfaces that use ArrayRef. - I have cleaned up some code, especially our use of namespaces. This change is neutral for our testsuite and greatly improves correctness for large programs (like Clang) with complicated type systems. It should also lay the groundwork for improving the expression parser's performance as we are lazier and lazier about providing type information. llvm-svn: 136555
* Logging and return code fixes.Greg Clayton2011-07-291-11/+16
| | | | llvm-svn: 136530
* Public API changes:Enrico Granata2011-07-292-3/+3
| | | | | | | | | | | | | | | | | | | | | - Completely new implementation of SBType - Various enhancements in several other classes Python synthetic children providers for std::vector<T>, std::list<T> and std::map<K,V>: - these return the actual elements into the container as the children of the container - basic template name parsing that works (hopefully) on both Clang and GCC - find them in examples/synthetic and in the test suite in functionalities/data-formatter/data-formatter-python-synth New summary string token ${svar : - the syntax is just the same as in ${var but this new token lets you read the values coming from the synthetic children provider instead of the actual children - Python providers above provide a synthetic child len that returns the number of elements into the container Full bug fix for the issue in which getting byte size for a non-complete type would crash LLDB Several other fixes, including: - inverted the order of arguments in the ClangASTType constructor - EvaluationPoint now only returns SharedPointer's to Target and Process - the help text for several type subcommands now correctly indicates argument-less options as such llvm-svn: 136504
* Don't delete & remake the exception breakpoints every time you need them. ↵Jim Ingham2011-07-234-6/+11
| | | | | | | | | Make them once & enable/disable them as appropriate. Also reformatted the lldb summaries to make them easier to read, and added one. I'll do more as I get time. llvm-svn: 135827
* Disable compilation of RegisterContextDarwin_arm.cpp on non-Darwin platforms,Peter Collingbourne2011-07-222-1/+5
| | | | | | | | | and fix RegisterContextDarwin_x86_64.cpp build RegisterContextDarwin_arm.cpp contains too much platform specific code to easily fix. llvm-svn: 135792
* Update ProcessLinux::CanDebug prototypePeter Collingbourne2011-07-222-2/+2
| | | | llvm-svn: 135791
* Initialize the all important automatic variable 'lldb::ConnectionStatus ↵Johnny Chen2011-07-211-1/+1
| | | | | | | | status' before invoking the Read(...) method to read in bytes. Similar to r135461. llvm-svn: 135695
* More KDP fixes and logging cleanup.Greg Clayton2011-07-214-151/+229
| | | | llvm-svn: 135652
* Added KDP resume, suspend, set/remove breakpoint, and kernel version support.Greg Clayton2011-07-205-51/+257
| | | | | | Also we now display a live update of the kexts that we are loading. llvm-svn: 135563
* Added register reading support for ARM, i386 and x86_64.Greg Clayton2011-07-207-49/+177
| | | | llvm-svn: 135557
* The implementation of categories is now synchronization safeEnrico Granata2011-07-192-2/+2
| | | | | | | | | | | | | | | | | | | | | Code cleanup: - The Format Manager implementation is now split between two files: FormatClasses.{h|cpp} where the actual formatter classes (ValueFormat, SummaryFormat, ...) are implemented and FormatManager.{h|cpp} where the infrastructure classes (FormatNavigator, FormatManager, ...) are contained. The wrapper code always remains in Debugger.{h|cpp} - Several leftover fields, methods and comments from previous design choices have been removed type category subcommands (enable, disable, delete) now can take a list of category names as input - for type category enable, saying "enable A B C" is the same as saying enable C enable B enable A (the ordering is relevant in enabling categories, and it is expected that a user typing enable A B C wants to look into category A, then into B, then into C and not the other way round) - for the other two commands, the order is not really relevant (however, the same inverted ordering is used for consistency) llvm-svn: 135494
* Modified the LocateMacOSXFilesUsingDebugSymbols(...) function to locateGreg Clayton2011-07-1928-3934/+5597
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | an executable file if it is right next to a dSYM file that is found using DebugSymbols. The code also looks into a bundle if the dSYM file is right next to a bundle. Modified the MacOSX kernel dynamic loader plug-in to correctly set the load address for kext sections. This is a tad tricky because of how LLDB chooses to treat mach-o segments with no name. Also modified the loader to properly handle the older version 1 kext summary info. Fixed a crasher in the Mach-o object file parser when it is trying to set the section size correctly for dSYM sections. Added packet dumpers to the CommunicationKDP class. We now also properly detect address byte sizes based on the cpu type and subtype that is provided. Added a read memory and read register support to CommunicationKDP. Added a ThreadKDP class that now uses subclasses of the RegisterContextDarwin_XXX for arm, i386 and x86_64. Fixed some register numbering issues in the RegisterContextDarwin_arm class and added ARM GDB numbers to the ARM_GCC_Registers.h file. Change the RegisterContextMach_XXX classes over to subclassing their RegisterContextDarwin_XXX counterparts so we can share the mach register contexts between the user and kernel plug-ins. llvm-svn: 135466
* Initialize the all important automatic variable 'lldb::ConnectionStatus ↵Johnny Chen2011-07-191-1/+1
| | | | | | | | | status' before invoking the Read(...) method to read in bytes. This seems to fix the infinite looping I was seeing on SnowLeopard while running the test suite. llvm-svn: 135461
* Added a boolean to the pure virtual lldb_private::Process::CanDebug(...)Greg Clayton2011-07-178-33/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method so process plug-ins that are requested by name can answer yes when asked if they can debug a target that might not have any file in the target. Modified the ConnectionFileDescriptor to have both a read and a write file descriptor. This allows us to support UDP, and eventually will allow us to support pipes. The ConnectionFileDescriptor class also has a file descriptor type for each of the read and write file decriptors so we can use the correct read/recv/recvfrom call when reading, or write/send/sendto for writing. Finished up an initial implementation of UDP where you can use the "udp://" URL to specify a host and port to connect to: (lldb) process connect --plugin kdp-remote udp://host:41139 This will cause a ConnectionFileDescriptor to be created that can send UDP packets to "host:41139", and it will also bind to a localhost port that can be given out to receive the connectionless UDP reply. Added the ability to get to the IPv4/IPv6 socket port number from a ConnectionFileDescriptor instance if either file descriptor is a socket. The ProcessKDP can now successfully connect to a remote kernel and detach using the above "processs connect" command!!! So far we have the following packets working: KDP_CONNECT KDP_DISCONNECT KDP_HOSTINFO KDP_VERSION KDP_REATTACH Now that the packets are working, adding new packets will go very quickly. llvm-svn: 135363
* Completed more work on the KDP darwin kernel debugging Process plug-in.Greg Clayton2011-07-163-96/+361
| | | | | | | | | | | | | | | Implemented connect, disconnect, reattach, version, and hostinfo. Modified the ConnectionFileDescriptor class to be able to handle UDP. Added a new Stream subclass called StreamBuffer that is backed by a llvm::SmallVector for better efficiency. Modified the DataExtractor class to have a static function that can dump hex bytes into a stream. This is currently being used to dump incoming binary packet data in the KDP plug-in. llvm-svn: 135338
* Fixed the comment lines in the file comment headers.Greg Clayton2011-07-156-6/+6
| | | | llvm-svn: 135284
* Added the ability to connect using "tcp://<host>:<port>" which is theGreg Clayton2011-07-153-256/+139
| | | | | | | | | | | | | | | | | | | | | same as the old "connect://<host>:<port>". Also added the ability to connect using "udp://<host>:<port>" which will open a connected datagram socket. I need to find a way to specify a non connected datagram socket as well. We might need to start setting some settings in the URL itself, maybe something like: udp://<host>:<port>?connected=yes udp://<host>:<port>?connected=no I am open to suggestions for URL settings. Also did more work on the KDP darwin kernel plug-in. llvm-svn: 135277
* Hollowed out process plug-in to do KDP darwin kernel debugging.Greg Clayton2011-07-156-0/+1800
| | | | llvm-svn: 135240
* Python summary strings:Enrico Granata2011-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - you can use a Python script to write a summary string for data-types, in one of three ways: -P option and typing the script a line at a time -s option and passing a one-line Python script -F option and passing the name of a Python function these options all work for the "type summary add" command your Python code (if provided through -P or -s) is wrapped in a function that accepts two parameters: valobj (a ValueObject) and dict (an LLDB internal dictionary object). if you use -F and give a function name, you're expected to define the function on your own and with the right prototype. your function, however defined, must return a Python string - test case for the Python summary feature - a few quirks: Python summaries cannot have names, and cannot use regex as type names both issues will be fixed ASAP major redesign of type summary code: - type summary working with strings and type summary working with Python code are two classes, with a common base class SummaryFormat - SummaryFormat classes now are able to actively format objects rather than just aggregating data - cleaner code to print descriptions for summaries the public API now exports a method to easily navigate a ValueObject hierarchy New InputReaderEZ and PriorityPointerPair classes Several minor fixes and improvements llvm-svn: 135238
* Added the ability to _not_ skip the prologue when settings breakpoints Greg Clayton2011-07-124-31/+80
| | | | | | | | | | | | | | by name by adding an extra parameter to the lldb_private::Target breakpoint setting functions. Added a function in the DWARF symbol file plug-in that can dump errors and prints out which DWARF file the error is happening in so we can track down what used to be assertions easily. Fixed the MacOSX kernel plug-in to properly read the kext images and set the kext breakpoint to watch for kexts as they are loaded. llvm-svn: 134990
* Fixed an assertion crasher. We now handle things correclty and Greg Clayton2011-07-101-3/+9
| | | | | | emit an error to stderr when we see this issue. llvm-svn: 134872
* More cleanup on the this plug-in and tried to set the notificationGreg Clayton2011-07-092-188/+73
| | | | | | | breakpoint. I haven't been able to see this breakpoint get hit yet so I still have testing I need to do with the kernel dynamic loader. llvm-svn: 134825
* Fixed an issue where we weren't zeroing out the type fullyGreg Clayton2011-07-091-1/+1
| | | | | | thanks to a nice clang warning! llvm-svn: 134824
* Added the ability to get an abstract file type (executable, object file, Greg Clayton2011-07-094-0/+167
| | | | | | | | shared library, etc) and strata (user/kernel) from an object file. This will help with plug-in and platform selection when given a new binary with the "target create <file>" command. llvm-svn: 134779
* LLDB now has a Kernel dynamic linker that can detect where kexts areGreg Clayton2011-07-083-19/+80
| | | | | | | | | | | | | | | | | | loaded. It locks onto *-apple-darwin binaries where the binary has a "__KLD" segment. Soon I will modify the lldb_private::ObjectFile class to return an executable type which will be an enum with values something like: eObjectFileTypeUserExectable, eObjectFileTypeUserSharedLibrary, eObjectFileTypeKernelExectable, eObjectFileTypeKernelSharedLibrary, eObjectFileTypeObjectFile, eObjectFileTypeCoreFile But for now we look at the section since a user and kernel mach-o executable have the same mach-o file type. llvm-svn: 134682
* Make the kernel able to do its initial load from target memory with theGreg Clayton2011-07-082-204/+62
| | | | | | process being preferred for all memory reads. llvm-svn: 134681
* Added the start of the darwin dynamic loader plug-in. It isn't hooked up toGreg Clayton2011-07-083-0/+1664
| | | | | | | be detected yet, but most of the initial code is there and needs to be debugged more. llvm-svn: 134672
* Stop the lldb_private::RegularExpression class from implicitlyGreg Clayton2011-07-071-1/+1
| | | | | | | constructing itself and causing unexpected things to happen in LLDB. llvm-svn: 134598
* Added "target variable" command that allows introspection of globalGreg Clayton2011-07-074-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variables prior to running your binary. Zero filled sections now get section data correctly filled with zeroes when Target::ReadMemory reads from the object file section data. Added new option groups and option values for file lists. I still need to hook up all of the options to "target variable" to allow more complete introspection by file and shlib. Added the ability for ValueObjectVariable objects to be created with only the target as the execution context. This allows them to be read from the object files through Target::ReadMemory(...). Added a "virtual Module * GetModule()" function to the ValueObject class. By default it will look to the parent variable object and return its module. The module is needed when we have global variables that have file addresses (virtual addresses that are specific to module object files) and in turn allows global variables to be displayed prior to running. Removed all of the unused proxy object support that bit rotted in lldb_private::Value. Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code with the more efficient "FileSpec::Equal (lhs, rhs)". Improved logging in GDB remote plug-in. llvm-svn: 134579
* Fixed some issues with ARM backtraces by not processing any push/pop Greg Clayton2011-07-064-41/+77
| | | | | | | | | | | | | | instructions if they are conditional. Also fixed issues where the PC wasn't getting bit zero stripped for ARM targets when a stack frame was thumb. We now properly call through the GetOpcodeLoadAddress() functions to make sure the addresses are properly stripped for any targets that may decorate up their addresses. We now don't pass the SIGSTOP signals along. We can revisit this soon, but currently this was interfering with debugging some older ARM targets that don't have vCont support in the GDB server. llvm-svn: 134461
* When we use the "fd://%u" for file descriptors, we need to detect if this isGreg Clayton2011-07-021-7/+12
| | | | | | | | | a file or socket. We now make a getsockopt call to check if the fd is a socket. Also, the previous logic in the GDB communication needs to watch for success with an error so we can deal with EAGAIN and other normal "retry" error codes. llvm-svn: 134359
* Cleanup errors that come out of commands and make sure they all have newlinesGreg Clayton2011-07-021-10/+42
| | | | | | | | | | | | | _only_ in the resulting stream, not in the error objects (lldb_private::Error). lldb_private::Error objects should always just have an error string with no terminating newline characters or periods. Fixed an issue with GDB remote packet detection that could end up deadlocking if a full packet wasn't received in one chunk. Also modified the packet checking function to properly toss one or more bytes when it detects bad data. llvm-svn: 134357
* Centralize all of the type name code so that we always strip the leadingGreg Clayton2011-06-302-2/+2
| | | | | | | | "struct ", "class ", and "union " from the start of any type names that are extracted from clang QualType objects. I had to fix test suite cases that were expecting the struct/union/class prefix to be there. llvm-svn: 134132
* This commit adds broad architectural support for hierarchicalGreg Clayton2011-06-253-6/+96
| | | | | | | | | | | | | | | | | | | | | | | inspection of namespaces in the expression parser. ClangExpressionDeclMap hitherto reported that namespaces had been completely imported, even though the namespaces are returned empty. To deal with this situation, ClangASTSource was recently extended with an API to complete incomplete type definitions, and, for greater efficiency, to complete these definitions partially, returning only those objects that have a given name. This commit supports these APIs on LLDB's side, and uses it to provide information on types resident in namespaces. Namespaces are now imported as they were -- that is to say, empty -- but with minimal import mode on. This means that Clang will come back and request their contents by name as needed. We now respond with information on the contained types; this will be followed soon by information on functions and variables. llvm-svn: 133852
* Removed an member variable "m_local_debugserver" that is no longer needed.Greg Clayton2011-06-242-3/+2
| | | | | | | We now check with the platform to see if we are doing local or remote debugging and setup the stdio accordingly. llvm-svn: 133835
OpenPOWER on IntegriCloud