summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
Commit message (Collapse)AuthorAgeFilesLines
...
* Made loading sections in the DynamicLoaderDarwinKernel more robust as itGreg Clayton2012-02-141-31/+28
| | | | | | | | | seems that sections in the memory module might be quite different from the sections in the file module. Now we find all segments in the on disk file and find that segment by name in the memory module and it is ok if any sections from the file are missing in the memory image. llvm-svn: 150443
* Full core file support has been added for mach-o core files.Greg Clayton2012-02-133-570/+221
| | | | | | | | | | | | | | | | Tracking modules down when you have a UUID and a path has been improved. DynamicLoaderDarwinKernel no longer parses mach-o load commands and it now uses the memory based modules now that we can load modules from memory. Added a target setting named "target.exec-search-paths" which can be used to supply a list of directories to use when trying to look for executables. This allows one or more directories to be used when searching for modules that may not exist in the SDK/PDK. The target automatically adds the directory for the main executable to this list so this should help us in tracking down shared libraries and other binaries. llvm-svn: 150426
* Improved detection of object file types, movingSean Callanan2012-02-103-18/+15
| | | | | | | | | | detection of kernels into the object file and adding a new category for raw binary images. Fixed all clients who previously searched for sections manually, making them use the object file's facilities instead. llvm-svn: 150272
* First pass at mach-o core file support is in. It currently works for x86_64 Greg Clayton2012-02-091-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | user space programs. The core file support is implemented by making a process plug-in that will dress up the threads and stack frames by using the core file memory. Added many default implementations for the lldb_private::Process functions so that plug-ins like the ProcessMachCore don't need to override many many functions only to have to return an error. Added new virtual functions to the ObjectFile class for extracting the frozen thread states that might be stored in object files. The default implementations return no thread information, but any platforms that support core files that contain frozen thread states (like mach-o) can make a module using the core file and then extract the information. The object files can enumerate the threads and also provide the register state for each thread. Since each object file knows how the thread registers are stored, they are responsible for creating a suitable register context that can be used by the core file threads. Changed the process CreateInstace callbacks to return a shared pointer and to also take an "const FileSpec *core_file" parameter to allow for core file support. This will also allow for lldb_private::Process subclasses to be made that could load crash logs. This should be possible on darwin where the crash logs contain all of the stack frames for all of the threads, yet the crash logs only contain the registers for the crashed thrad. It should also allow some variables to be viewed for the thread that crashed. llvm-svn: 150154
* <rdar://problem/10560053>Greg Clayton2012-02-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed "target modules list" (aliased to "image list") to output more information by default. Modified the "target modules list" to have a few new options: "--header" or "-h" => show the image header address "--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library) Removed the "--symfile-basename" or "-S" option, and repurposed it to "--symfile-unique" "-S" which will show the symbol file if it differs from the executable file. ObjectFile's can now be loaded from memory for cases where we don't have the files cached locally in an SDK or net mounted root. ObjectFileMachO can now read mach files from memory. Moved the section data reading code into the ObjectFile so that the object file can get the section data from Process memory if the file is only in memory. lldb_private::Module can now load its object file in a target with a rigid slide (very common operation for most dynamic linkers) by using: bool Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed) lldb::SBModule() now has a new constructor in the public interface: SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr); This will find an appropriate ObjectFile plug-in to load an image from memory where the object file header is at "header_addr". llvm-svn: 149804
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* Fix incomplete commit of ↵Johnny Chen2012-01-0514-0/+1414
| | | | | | | | | | | | | http://llvm.org/viewvc/llvm-project?rev=147609&view=rev: This patch combines common code from Linux and FreeBSD into a new POSIX platform. It also contains fixes for 64bit FreeBSD. The patch is based on changes by Mark Peek <mp@FreeBSD.org> and "K. Macy" <kmacy@freebsd.org> in their github repo located at https://github.com/fbsd/lldb. llvm-svn: 147613
* This patch combines common code from Linux and FreeBSD intoJohnny Chen2012-01-057-1439/+0
| | | | | | | | | | a new POSIX platform. It also contains fixes for 64bit FreeBSD. The patch is based on changes by Mark Peek <mp@FreeBSD.org> and "K. Macy" <kmacy@freebsd.org> in their github repo located at https://github.com/fbsd/lldb. llvm-svn: 147609
* Added code in the Host layer that can report system log messagesGreg Clayton2012-01-052-22/+21
| | | | | | | | | | | | so that we don't have "fprintf (stderr, ...)" calls sprinkled everywhere. Changed all needed locations over to using this. For non-darwin, we log to stderr only. On darwin, we log to stderr _and_ to ASL (Apple System Log facility). This will allow GUI apps to have a place for these error and warning messages to go, and also allows the command line apps to log directly to the terminal. llvm-svn: 147596
* Expose new read memory fucntion through python in SBProcess:Greg Clayton2011-12-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | size_t SBProcess::ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error); uint64_t SBProcess::ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error); lldb::addr_t SBProcess::ReadPointerFromMemory (addr_t addr, lldb::SBError &error); These ReadCStringFromMemory() has some SWIG type magic that makes it return the python string directly and the "buf" is not needed: error = SBError() max_cstr_len = 256 cstr = lldb.process.ReadCStringFromMemory (0x1000, max_cstr_len, error) if error.Success(): .... The other two functions behave as expteced. This will make it easier to get integer values from the inferior process that are correctly byte swapped. Also for pointers, the correct pointer byte size will be used. Also cleaned up a few printf style warnings for the 32 bit lldb build on darwin. llvm-svn: 146636
* On Mac OS X the Objective-C runtime (libobjc) has many criticalJason Molenda2011-12-142-0/+47
| | | | | | | | | | | | | | | | | | | | | dispatch functions that are implemented in hand-written assembly. There is also hand-written eh_frame instructions for unwinding from these functions. Normally we don't use eh_frame instructions for the currently executing function, prefering the assembly instruction profiling method. But in these hand-written dispatch functions, the profiling is doomed and we should use the eh_frame instructions. Unfortunately there's no easy way to flag/extend the eh_frame/debug_frame sections to annotate if the unwind instructions are accurate at all addresses ("asynchronous") or if they are only accurate at locations that can throw an exception ("synchronous" and the normal case for gcc/clang generated eh_frame/debug_frame CFI). <rdar://problem/10508134> llvm-svn: 146551
* Turn off the resolver detection till we find a better method to do so.Jim Ingham2011-11-301-1/+6
| | | | llvm-svn: 145472
* Handle stepping through a trampoline where the jump target is calculated a ↵Jim Ingham2011-11-192-27/+92
| | | | | | | | | | runtime - and so doesn't match the name of the PLT entry. This solution assumes a naming convention agreed upon by us and the system folks, and isn't general. The general solution requires actually finding & calling the resolver function if it hasn't been called yet. That's more tricky. llvm-svn: 144981
* Fixed the Xcode project building of LLVM to be a bit more user friendly:Greg Clayton2011-11-041-7/+7
| | | | | | | | | | | | | | | | | | | - If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LLVM. - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the Xcode project will download the right LLVM sources and build them from scratch - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib" directory, we will use the sources you have placed in the LLDB directory. Python can now be disabled for platforms that don't support it. Changed the way the libllvmclang.a files get used. They now all get built into arch specific directories and never get merged into universal binaries as this was causing issues where you would have to go and delete the file if you wanted to build an extra architecture slice. llvm-svn: 143678
* warnings: Fix a bunch of -Wreorder problems.Daniel Dunbar2011-10-311-2/+2
| | | | llvm-svn: 143381
* Patch from dawn@burble.org to build on linux!Johnny Chen2011-10-101-5/+5
| | | | llvm-svn: 141593
* Adjust kext load messages in DynamicLoaderDarwinKernel::ParseKextSummaries so weJason Molenda2011-09-241-3/+5
| | | | | | print result information if a kext fails to be located or loaded for some reason. llvm-svn: 140447
* Added the ability to restrict breakpoints by function name, function regexp, ↵Jim Ingham2011-09-231-0/+1
| | | | | | | | | | selector etc to specific source files. Added SB API's to specify these source files & also more than one module. Added an "exact" option to CompileUnit's FindLineEntry API. llvm-svn: 140362
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | shared pointers. Changed the ExecutionContext over to use shared pointers for the target, process, thread and frame since these objects can easily go away at any time and any object that was holding onto an ExecutionContext was running the risk of using a bad object. Now that the shared pointers for target, process, thread and frame are just a single pointer (they all use the instrusive shared pointers) the execution context is much safer and still the same size. Made the shared pointers in the the ExecutionContext class protected and made accessors for all of the various ways to get at the pointers, references, and shared pointers. llvm-svn: 140298
* Add a new breakpoint type "break by source regular expression".Jim Ingham2011-09-211-1/+3
| | | | | | | | | Fix the RegularExpression class so it has a real copy constructor. Fix the breakpoint setting with multiple shared libraries so it makes one breakpoint not one per shared library. Add SBFileSpecList, to be used to expose the above to the SB interface (not done yet.) llvm-svn: 140225
* Fixed a problem where expressions would attempt toSean Callanan2011-09-201-0/+3
| | | | | | | | allocate memory in a process that did not support expression execution. Also improved detection of whether or not a process can execute expressions. llvm-svn: 140202
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-202-2/+2
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Finishing the renaming from "MacOSX-Kernel" to "Darwin-Kernel".Greg Clayton2011-08-222-58/+58
| | | | llvm-svn: 138283
* Renaming "MacOSX-Kernel" to "Darwin-Kernel". The file contents and projectGreg Clayton2011-08-223-1/+1
| | | | | | commit will come shortly after this commit. llvm-svn: 138282
* Added the ability to remove orphaned module shared pointers from a ModuleList.Greg Clayton2011-08-112-5/+5
| | | | | | | | | | | | | | This is helping us track down some extra references to ModuleSP objects that are causing things to get kept around for too long. Added a module pointer accessor to target and change a lot of code to use it where it would be more efficient. "taret delete" can now specify "--clean=1" which will cleanup the global module list for any orphaned module in the shared module cache which can save memory and also help track down module reference leaks like we have now. llvm-svn: 137294
* While tracking down memory consumption issue a few things were needed: the Greg Clayton2011-08-101-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ability to dump more information about modules in "target modules list". We can now dump the shared pointer reference count for modules, the pointer to the module itself (in case performance tools can help track down who has references to said pointer), and the modification time. Added "target delete [target-idx ...]" to be able to delete targets when they are no longer needed. This will help track down memory usage issues and help to resolve when module ref counts keep getting incremented. If the command gets no arguments, the currently selected target will be deleted. If any arguments are given, they must all be valid target indexes (use the "target list" command to get the current target indexes). Took care of a bunch of "no newline at end of file" warnings. TimeValue objects can now dump their time to a lldb_private::Stream object. Modified the "target modules list --global" command to not error out if there are no targets since it doesn't require a target. Fixed an issue in the MacOSX DYLD dynamic loader plug-in where if a shared library was updated on disk, we would keep using the older one, even if it was updated. Don't allow the ModuleList::GetSharedModule(...) to return an empty module. Previously we could specify a valid path on disc to a module, and specify an architecture that wasn't contained in that module and get a shared pointer to a module that wouldn't be able to return an object file or a symbol file. We now make sure an object file can be extracted prior to adding the shared pointer to the module to get added to the shared list. llvm-svn: 137196
* When unloading a library, pass the old complete version of the library to ↵Jim Ingham2011-08-091-1/+3
| | | | | | | | | UnloadImageLoadAddress, since that one is completely filled in. The one we make up from the event doesn't have section info since the library has already been unloaded by the time we get to it. llvm-svn: 137143
* Fixed a loop that I was testing changes with and forgotGreg Clayton2011-08-061-1/+1
| | | | | | to revert to zero. llvm-svn: 137008
* Fixed issues for iOS debugging where if a device hasGreg Clayton2011-08-051-23/+25
| | | | | | | | | 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
* 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
* More KDP fixes and logging cleanup.Greg Clayton2011-07-211-0/+13
| | | | llvm-svn: 135652
* Added KDP resume, suspend, set/remove breakpoint, and kernel version support.Greg Clayton2011-07-201-1/+19
| | | | | | Also we now display a live update of the kexts that we are loading. llvm-svn: 135563
* Modified the LocateMacOSXFilesUsingDebugSymbols(...) function to locateGreg Clayton2011-07-192-44/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added the ability to _not_ skip the prologue when settings breakpoints Greg Clayton2011-07-122-21/+40
| | | | | | | | | | | | | | 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
* 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
* 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
* Use the dyld_mode, image_infos & image_infos_count passed into the shared ↵Jim Ingham2011-06-202-200/+363
| | | | | | | | library notification function to update libraries rather than reading the whole all_imaage_infos structure every time we get notified. llvm-svn: 133448
* Remove assert() calls that were firing off and crashing the LLDB framework.Greg Clayton2011-06-141-14/+33
| | | | llvm-svn: 132960
* Don't resolve the path when we extract the path from the dyld info or weGreg Clayton2011-05-231-4/+3
| | | | | | | | | | | | can end up with an invalid path if the path resolves to something different on the local machine. It is very important not to since remote debugging will mention paths that might exist on the current machine (like "/System/Library/Frameworks/CoreFoundation/CoreFoundation" which on the desktop systems is a symlink to "/System/Library/Frameworks/CoreFoundation/Versions/A/CoreFoundation"). We will let the platform plug-ins resolve the paths in a later stage. llvm-svn: 131934
* Calculate the dyld slide from all in memory info without having to use theGreg Clayton2011-05-232-46/+66
| | | | | | lldb module. llvm-svn: 131914
* API fix and missing headers.Johnny Chen2011-05-191-1/+1
| | | | | | | | | | | | | | Host.cpp was missing Error.h and the implementation of LaunchProcess. Once againg I have added a "fake" implementation waiting for a real one. Fixed the call GetAddressRange to reflect the new interface in DynamicLoaderLinuxDYLD.cpp. Added string.h to ARM_DWARF_Registers.cpp that is needed for ::memset. Signed-off-by: Johnny Chen <johnny.chen@apple.com> llvm-svn: 131695
* Fixed the SymbolContext::DumpStopContext() to correctly indent and dumpGreg Clayton2011-04-231-2/+2
| | | | | | | | | | | | | | | | | inline contexts when the deepest most block is not inlined. Added source path remappings to the lldb_private::Target class that allow it to remap paths found in debug info so we can find source files that are elsewhere on the current system. Fixed disassembly by function name to disassemble inline functions that are inside other functions much better and to show enough context before the disassembly output so you can tell where things came from. Added the ability to get more than one address range from a SymbolContext class for the case where a block or function has discontiguous address ranges. llvm-svn: 130044
* Moved the execution context that was in the Debugger intoGreg Clayton2011-04-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the CommandInterpreter where it was always being used. Make sure that Modules can track their object file offsets correctly to allow opening of sub object files (like the "__commpage" on darwin). Modified the Platforms to be able to launch processes. The first part of this move is the platform soon will become the entity that launches your program and when it does, it uses a new ProcessLaunchInfo class which encapsulates all process launching settings. This simplifies the internal APIs needed for launching. I want to slowly phase out process launching from the process classes, so for now we can still launch just as we used to, but eventually the platform is the object that should do the launching. Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able to launch processes with all of the new eLaunchFlag settings. Modified any code that was manually launching processes to use the Host::LaunchProcess functions. Fixed an issue where lldb_private::Args had implicitly defined copy constructors that could do the wrong thing. This has now been fixed by adding an appropriate copy constructor and assignment operator. Make sure we don't add empty ModuleSP entries to a module list. Fixed the commpage module creation on MacOSX, but we still need to train the MacOSX dynamic loader to not get rid of it when it doesn't have an entry in the all image infos. Abstracted many more calls from in ProcessGDBRemote down into the GDBRemoteCommunicationClient subclass to make the classes cleaner and more efficient. Fixed the default iOS ARM register context to be correct and also added support for targets that don't support the qThreadStopInfo packet by selecting the current thread (only if needed) and then sending a stop reply packet. Debugserver can now start up with a --unix-socket (-u for short) and can then bind to port zero and send the port it bound to to a listening process on the other end. This allows the GDB remote platform to spawn new GDB server instances (debugserver) to allow platform debugging. llvm-svn: 129351
* linux: add missing arguments to FindFirstModuleForFileSpecStephen Wilson2011-04-081-2/+3
| | | | | | | Specifying the new arguments as NULL is appropriate for now as this is backwards-compatible with the old invocation. llvm-svn: 129118
* Many improvements to the Platform base class and subclasses. The base PlatformGreg Clayton2011-03-302-74/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class now implements the Host functionality for a lot of things that make sense by default so that subclasses can check: int PlatformSubclass::Foo () { if (IsHost()) return Platform::Foo (); // Let the platform base class do the host specific stuff // Platform subclass specific code... int result = ... return result; } Added new functions to the platform: virtual const char *Platform::GetUserName (uint32_t uid); virtual const char *Platform::GetGroupName (uint32_t gid); The user and group names are cached locally so that remote platforms can avoid sending packets multiple times to resolve this information. Added the parent process ID to the ProcessInfo class. Added a new ProcessInfoMatch class which helps us to match processes up and changed the Host layer over to using this new class. The new class allows us to search for processs: 1 - by name (equal to, starts with, ends with, contains, and regex) 2 - by pid 3 - And further check for parent pid == value, uid == value, gid == value, euid == value, egid == value, arch == value, parent == value. This is all hookup up to the "platform process list" command which required adding dumping routines to dump process information. If the Host class implements the process lookup routines, you can now lists processes on your local machine: machine1.foo.com % lldb (lldb) platform process list PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME ====== ====== ========== ========== ========== ========== ======================== ============================ 99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge 94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker 94852 244 username usergroup username usergroup x86_64-apple-darwin Safari 94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode 92742 92710 username usergroup username usergroup i386-apple-darwin debugserver This of course also works remotely with the lldb-platform: machine1.foo.com % lldb-platform --listen 1234 machine2.foo.com % lldb (lldb) platform create remote-macosx Platform: remote-macosx Connected: no (lldb) platform connect connect://localhost:1444 Platform: remote-macosx Triple: x86_64-apple-darwin OS Version: 10.6.7 (10J869) Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 Hostname: machine1.foo.com Connected: yes (lldb) platform process list PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME ====== ====== ========== ========== ========== ========== ======================== ============================ 99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation 99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb 99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge 94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker 94852 244 username usergroup username usergroup x86_64-apple-darwin Safari The lldb-platform implements everything with the Host:: layer, so this should "just work" for linux. I will probably be adding more stuff to the Host layer for launching processes and attaching to processes so that this support should eventually just work as well. Modified the target to be able to be created with an architecture that differs from the main executable. This is needed for iOS debugging since we can have an "armv6" binary which can run on an "armv7" machine, so we want to be able to do: % lldb (lldb) platform create remote-ios (lldb) file --arch armv7 a.out Where "a.out" is an armv6 executable. The platform then can correctly decide to open all "armv7" images for all dependent shared libraries. Modified the disassembly to show the current PC value. Example output: (lldb) disassemble --frame a.out`main: 0x1eb7: pushl %ebp 0x1eb8: movl %esp, %ebp 0x1eba: pushl %ebx 0x1ebb: subl $20, %esp 0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18 0x1ec3: popl %ebx -> 0x1ec4: calll 0x1f12 ; getpid 0x1ec9: movl %eax, 4(%esp) 0x1ecd: leal 199(%ebx), %eax 0x1ed3: movl %eax, (%esp) 0x1ed6: calll 0x1f18 ; printf 0x1edb: leal 213(%ebx), %eax 0x1ee1: movl %eax, (%esp) 0x1ee4: calll 0x1f1e ; puts 0x1ee9: calll 0x1f0c ; getchar 0x1eee: movl $20, (%esp) 0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6 0x1efa: movl $12, %eax 0x1eff: addl $20, %esp 0x1f02: popl %ebx 0x1f03: leave 0x1f04: ret This can be handy when dealing with the new --line options that was recently added: (lldb) disassemble --line a.out`main + 13 at test.c:19 18 { -> 19 printf("Process: %i\n\n", getpid()); 20 puts("Press any key to continue..."); getchar(); -> 0x1ec4: calll 0x1f12 ; getpid 0x1ec9: movl %eax, 4(%esp) 0x1ecd: leal 199(%ebx), %eax 0x1ed3: movl %eax, (%esp) 0x1ed6: calll 0x1f18 ; printf Modified the ModuleList to have a lookup based solely on a UUID. Since the UUID is typically the MD5 checksum of a binary image, there is no need to give the path and architecture when searching for a pre-existing image in an image list. Now that we support remote debugging a bit better, our lldb_private::Module needs to be able to track what the original path for file was as the platform knows it, as well as where the file is locally. The module has the two following functions to retrieve both paths: const FileSpec &Module::GetFileSpec () const; const FileSpec &Module::GetPlatformFileSpec () const; llvm-svn: 128563
* linux: create thread plans for stepping thru PLT entriesStephen Wilson2011-03-301-6/+47
| | | | | | | | Using the new synthetic symbols generated by ObjectFileELF, have the Linux dynamic loader plugin generate a thread plan that will take us thru a PLT entry to the corresponding target function. llvm-svn: 128552
* Updated to LLVM/Clang revision 127600.Sean Callanan2011-03-151-2/+1
| | | | llvm-svn: 127634
OpenPOWER on IntegriCloud