summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
Commit message (Collapse)AuthorAgeFilesLines
...
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-6/+7
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* Sometimes the trampoline refers directly to the indirect symbol. Handle ↵Jim Ingham2014-01-111-0/+23
| | | | | | that too. llvm-svn: 198990
* Get the breakpoint setting, and the Mac OS X DYLD trampolines and expression ↵Jim Ingham2014-01-101-77/+88
| | | | | | | | | | | | | | | | | | | | | | | | evaluator to handle Indirect symbols correctly. There were a couple of pieces to this. 1) When a breakpoint location finds itself pointing to an Indirect symbol, when the site for it is created it needs to resolve the symbol and actually set the site at its target. 2) Not all breakpoints want to do this (i.e. a straight address breakpoint should always set itself on the specified address, so somem machinery was needed to specify that. 3) I added some info to the break list output for indirect symbols so you could see what was happening. Also I made it clear when we re-route through re-exported symbols. 4) I moved ResolveIndirectFunction from ProcessPosix to Process since it works the exact same way on Mac OS X and the other posix systems. If we find a platform that doesn't do it this way, they can override the call in Process. 5) Fixed one bug in RunThreadPlan, if you were trying to run a thread plan after a "running" event had been broadcast, the event coalescing would cause you to miss the ThreadPlan running event. So I added a way to override the coalescing. 6) Made DynamicLoaderMacOSXDYLD::GetStepThroughTrampolinePlan handle Indirect & Re-exported symbols. <rdar://problem/15280639> llvm-svn: 198976
* Fixed an issue when attaching to a process without specifying a file where ↵Greg Clayton2014-01-071-1/+11
| | | | | | | | we wouldn't set the dyld gdb image notifier breakpoint correctly. <rdar://problem/15720040> llvm-svn: 198717
* For logical backtrace work, lldb needs to track Module unloads etc & ↵Greg Clayton2013-12-064-19/+10
| | | | | | | | | | symoblicate an address based on a point in time <rdar://problem/15314403> This patch adds a new lldb_private::SectionLoadHistory class that tracks what shared libraries were loaded given a process stop ID. This allows us to keep a history of the sections that were loaded for a time T. Many items in history objects will rely upon the process stop ID in the future. llvm-svn: 196557
* <rdar://problem/15367122>Greg Clayton2013-11-052-2/+2
| | | | | | | | Fixed the test case for "test/functionalities/exec/TestExec.py" on Darwin. The issue was breakpoints were persisting and causing problems. When we exec, we need to clear out the process and target and start fresh with nothing and let the breakpoints populate themselves again. This patch correctly clears out the breakpoints and also flushes the process so that the objects (process/thread/frame) give out valid information. llvm-svn: 194106
* Roll back the changes I made in r193907 which created a new FrameJason Molenda2013-11-043-5/+5
| | | | | | | | | | pure virtual base class and made StackFrame a subclass of that. As I started to build on top of that arrangement today, I found that it wasn't working out like I intended. Instead I'll try sticking with the single StackFrame class -- there's too much code duplication to make a more complicated class hierarchy sensible I think. llvm-svn: 193983
* Add a new base class, Frame. It is a pure virtual function whichJason Molenda2013-11-023-5/+5
| | | | | | | | | | | | | | | | | | | | | defines a protocol that all subclasses will implement. StackFrame is currently the only subclass and the methods that Frame vends are nearly identical to StackFrame's old methods. Update all callers to use Frame*/Frame& instead of pointers to StackFrames. This is almost entirely a mechanical change that touches a lot of the code base so I'm committing it alone. No new functionality is added with this patch, no new subclasses of Frame exist yet. I'll probably need to tweak some of the separation, possibly moving some of StackFrame's methods up in to Frame, but this is a good starting point. <rdar://problem/15314068> llvm-svn: 193907
* Fixes to get LLDB building on Windows again.Deepak Panickal2013-10-222-4/+4
| | | | llvm-svn: 193159
* Fix build failure on FreeBSD/clang by using auto iterator typeEd Maste2013-10-181-1/+1
| | | | llvm-svn: 192999
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-174-11/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the __thread modifier. To make this work this patch extends LLDB to: - Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list. - Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines. - Make DWARF expressions track which module they originated from. - Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here. - Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here: 1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target. 2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out. 3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized. However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used. Test case included. llvm-svn: 192922
* <rdar://problem/13635174>Greg Clayton2013-10-113-4/+6
| | | | | | | | Added a way to set hardware breakpoints from the "breakpoint set" command with the new "--hardware" option. Hardware breakpoints are not a request, they currently are a requirement. So when breakpoints are specified as hardware breakpoints, they might fail to be set when they are able to be resolved and should be used sparingly. This is currently hooked up for GDB remote debugging. Linux and FreeBSD should quickly enable this feature if possible, or return an error for any breakpoints that are hardware breakpoint sites in the "virtual Error Process::EnableBreakpointSite (BreakpointSite *bp_site);" function. llvm-svn: 192491
* Eliminate integer sign comparison warningEd Maste2013-10-111-1/+1
| | | | llvm-svn: 192462
* POSIX dyld: handle extra MIPS link map fieldEd Maste2013-10-101-0/+15
| | | | | | | | On at least FreeBSD and NetBSD there is an extra field in the dyld link map struct. I've left an assert for other OSes (i.e., Linux/mips) until it's determined if they do the same. llvm-svn: 192358
* Add logging for POSIX DYLD failuresEd Maste2013-10-091-1/+17
| | | | llvm-svn: 192322
* Fix endianness issue with POSIX dyld pluginEd Maste2013-10-022-25/+38
| | | | | | | To support cross-endian and big-endian debugging avoid copying target memory directly into host variables. llvm-svn: 191826
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-255-30/+30
| | | | llvm-svn: 191367
* This fixes two issues with the POSIX dynamic loader:Matt Kopec2013-09-132-2/+53
| | | | | | | 1. existing breakpoints weren't being re-resolved after the sections of a library were loaded (ie. through dlopen). 2. loaded sections weren't being removed after a shared library had been unloaded. llvm-svn: 190727
* Fix some names in the wake of my Mach-O changes to LLVM.Charles Davis2013-08-273-36/+36
| | | | llvm-svn: 189317
* Fix crash when connecting to gdbserver without loading a file first.Ed Maste2013-08-201-0/+3
| | | | | | Patch from Abid, Hafiz. llvm-svn: 188776
* <rdar://problem/14717184>Greg Clayton2013-08-132-1/+15
| | | | | | | | | | | | LLDB needs in memory module load level settings to control how much information is read from memory when loading in memory modules. This change adds a new setting: (lldb) settings set target.memory-module-load-level [minimal|partial|complete] minimal will load only sections (no symbols, or function bounds via function starts or EH frame) partial will load sections + bounds complete will load sections + bounds + symbols llvm-svn: 188246
* Re-introduces ELF core file support for Linux x86-64Ashok Thirumurthi2013-07-171-1/+8
| | | | | | | | | | Usage: 'lldb a.out -c core'. TODO: FreeBSD support. TODO: Support for AVX registers. TODO: Refactor so that RegisterContextCore* don't inherit from classes that use ProcessMonitor to fix the build on OS/X. llvm-svn: 186516
* Fix Rendezvous breakpoint to only be set once, resolve addr in ↵Michael Sartain2013-07-162-7/+23
| | | | | | | | BreakpointLocationList::FindByAddress Differential Revision: http://llvm-reviews.chandlerc.com/D1145 llvm-svn: 186458
* Revert the ELF core file support until a few things can be worked out:Greg Clayton2013-07-121-6/+2
| | | | | | | | | | | | | | | | | | | | | | | RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has: ProcessMonitor &GetMonitor(); This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does: ProcessMonitor & RegisterContext_x86_64::GetMonitor() { ProcessSP base = CalculateProcess(); ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get()); return process->GetMonitor(); } ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files. Suggested cleanups: - Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file. llvm-svn: 186223
* Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.Ashok Thirumurthi2013-07-121-2/+6
| | | | | | | | TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
* Huge change to clean up types.Greg Clayton2013-07-111-6/+8
| | | | | | | | A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error. This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness. llvm-svn: 186130
* Sort out a number of mismatched integer types in order to cut down the ↵Andy Gibbs2013-06-191-2/+2
| | | | | | number of compiler warnings. llvm-svn: 184333
* Add newer Linux AT_ defines from elf.h.Michael Sartain2013-06-172-32/+67
| | | | llvm-svn: 184094
* Remove extra modules.Append() as it causes dupes in the m_images array. ↵Michael Sartain2013-06-171-1/+0
| | | | | | (Used with image list, etc.) llvm-svn: 184082
* Fix unitialized variable in AuxVector::GetEntryName() which crashed in ↵Michael Sartain2013-06-151-1/+1
| | | | | | AuxVector::DumpToLog llvm-svn: 184023
* <rdar://problem/13956179>Greg Clayton2013-05-221-3/+3
| | | | | | | | Fixed ProcessMachCore to be able to locate the main executeable in the core file even if it doesn't start at a core file address range boundary. Prior to this we only checked the first bytes of each range in the core file for mach_kernel or dyld. Now we still do this, but if we don't find the mach_kernel or dyld anywhere, we go through all core file ranges and check every 0x1000 to see if we can find dyld or the mach_kernel. Now that we can properly detect the mach_kernel at any address, we don't need to call "DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process*)" anymore. llvm-svn: 182513
* Unbreak cmake builds by skipping Darwin kernel plugin on non-Mac platformsDaniel Malea2013-05-131-1/+5
| | | | llvm-svn: 181711
* <rdar://problem/13854277>Greg Clayton2013-05-108-61/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* Adding support for process attach by pid on Linux.Andrew Kaylor2013-05-071-1/+6
| | | | llvm-svn: 181374
* Remove the UUID::GetAsCString() method which required a buffer to save the Jason Molenda2013-05-031-8/+4
| | | | | | | UUID string in; added UUID::GetAsString() which returns the uuid string in a std::string. Updated callers to use the new method. llvm-svn: 181078
* If the Target's current architecture is incompatible with the kernelJason Molenda2013-05-021-0/+5
| | | | | | | DynamicLoaderDarwinKernel finds in memory, have DynamicLoaderDarwinKernel re-set the Target's arch based on the kernel's cpu type / cpu subtype. llvm-svn: 180962
* Make the warning message about not finding the kernel binary clearerJason Molenda2013-04-301-1/+1
| | | | | | about which kernel binary lldb is referring to. llvm-svn: 180821
* Cleanup logging to use the new "std::string FileSpec::GetPath()" function. ↵Greg Clayton2013-04-292-26/+14
| | | | | | | | | | | Also added a similar function for modules: std::string Module::GetSpecificationDescription () const; This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it. llvm-svn: 180717
* Remove an unneeded local var, a missing return statement in kernel search ↵Jason Molenda2013-04-191-4/+2
| | | | | | code, thanks to Greg Clayton for finding these. llvm-svn: 179822
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-182-2/+2
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-182-2/+2
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Fix build on LinuxDaniel Malea2013-04-171-0/+4
| | | | | | | - add a workaround header to define uuid_t on platforms that need it - unbreak remote debugging of mac os x apps llvm-svn: 179710
* Revert 179694 -- it breaks remote debugging of mac os x targets for some folkDaniel Malea2013-04-172-8/+2
| | | | | | - will commit a different workaround momentarily llvm-svn: 179705
* Fix Linux build of LLDBDaniel Malea2013-04-172-2/+8
| | | | | | | - conditionally build mac-specific plugins only on mac (PluginObjectFileMachO, PluginDynamicLoaderDrawinKernel and PluginDynamicLoaderMacOSXDYLD) - clean up warnings by ignoring deprecated declarations (auto_ptr for example) llvm-svn: 179694
* Update the dyld_all_image_infos size definition inJason Molenda2013-04-161-1/+4
| | | | | | | DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure for version 13 of that structure. llvm-svn: 179584
* Change CommandObjectPlatform commands to get the current platformJason Molenda2013-04-051-1/+0
| | | | | | | | | | | from the current Target, if there is one, else back off to getting the currently selected platform from the Debugger (as it ws doing previously.) Remove code from DynamicLoaderDarwinKernel that was setting the platform in both the Target and in the Debugger. llvm-svn: 178836
* Add a new PlatformDarwinKernel for kernel debugging. This PlatformJason Molenda2013-04-051-0/+25
| | | | | | | | | | | | | | | | | | | | | plugin will index the kext bundles on the local filesystem when created. During a kernel debug session, when the DynamicLoader plugin needs to locate a kext by name like "com.apple.com.apple.filesystems.autofs", the Platform can quickly look for a UUID match in those kernel debug kit directories it previously indexed. I'm still working on profiling the performance impact of the inital kext bundle scan; there will likely need to be a switch to enable or disable this plugin's scan. This only affects Mac kernel debugging and the code is only built on Apple systems because of some use of low-level CoreFoundation to parse plists. <rdar://problem/13503583> llvm-svn: 178827
* <rdar://problem/13521159>Greg Clayton2013-03-276-22/+19
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Misc. clang build warning fixes.Matt Kopec2013-03-121-1/+1
| | | | llvm-svn: 176879
* Disable JITed code in any processes that use DynamicLoaderStatic.Greg Clayton2013-03-061-0/+3
| | | | llvm-svn: 176541
OpenPOWER on IntegriCloud