summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-201-9/+9
| | | | | | | | 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
* Added the ability to get an abstract file type (executable, object file, Greg Clayton2011-07-091-0/+71
| | | | | | | | 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
* Scan dynamic symbol table of ELF object filesPeter Collingbourne2011-06-031-1/+1
| | | | llvm-svn: 132582
* elf: synthesize symbols for PLT entriesStephen Wilson2011-03-301-47/+421
| | | | | | | | | | | When populating symbol tables ObjectFileELF now generates a set of synthetic trampoline symbols. These new symbols correspond to entries in the program linkage table and have a (possibly mangled) name identifying the corresponding symbol in some DSO. These symbols will be used by the DynamicLoader loader plugin on Linux to provide thread plans when execution flows from one DSO to another. llvm-svn: 128550
* Fixed the LLDB build so that we can have private types, private enums andGreg Clayton2011-03-241-2/+2
| | | | | | | | public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't needed, and allows us to abstract our API better. llvm-svn: 128239
* LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provideGreg Clayton2011-03-081-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an interface to a local or remote debugging platform. By default each host OS that supports LLDB should be registering a "default" platform that will be used unless a new platform is selected. Platforms are responsible for things such as: - getting process information by name or by processs ID - finding platform files. This is useful for remote debugging where there is an SDK with files that might already or need to be cached for debug access. - getting a list of platform supported architectures in the exact order they should be selected. This helps the native x86 platform on MacOSX select the correct x86_64/i386 slice from universal binaries. - Connect to remote platforms for remote debugging - Resolving an executable including finding an executable inside platform specific bundles (macosx uses .app bundles that contain files) and also selecting the appropriate slice of universal files for a given platform. So by default there is always a local platform, but remote platforms can be connected to. I will soon be adding a new "platform" command that will support the following commands: (lldb) platform connect --name machine1 macosx connect://host:port Connected to "machine1" platform. (lldb) platform disconnect macosx This allows LLDB to be well setup to do remote debugging and also once connected process listing and finding for things like: (lldb) process attach --name x<TAB> The currently selected platform plug-in can now auto complete any available processes that start with "x". The responsibilities for the platform plug-in will soon grow and expand. llvm-svn: 127286
* Fix ObjectFileElf::GetEntryPointAddress()Stephen Wilson2011-03-081-18/+18
| | | | | | | | | | | | | | ELF object files do not implicitly have a symbol named "start" as an entry point. For example, on Linux it is often named "_start", but can be trivially set to any symbol by passing an --entry argument to the linker. Use the ELF header to determine the entry point and resolve the associated section based on that address. Also, update the linux dynamic loader to call GetEntryPointAddress instead of GetEntryPoint. llvm-svn: 127218
* I didn't notice there was already an ObjectFile::GetEntryPoint. Move that ↵Jim Ingham2011-03-081-9/+0
| | | | | | over to GetEntryPointAddress 'cause that's more consistent with other functions in ObjectFile, do the mutatis mutandi and also in the ELF case I return a section offset address rather than a bare load address. llvm-svn: 127205
* Add a method "GetEntryPoint" to the ObjectFile class, and implement it on ↵Jim Ingham2011-03-071-0/+28
| | | | | | MachO & ELF - though the ELF implementation is probably a little weak. Then use this method in place of directly looking for "start" in the ThreadPlanCallFunction constructor to find the stopping point for our function evaluation. llvm-svn: 127194
* linux: Remove a local ObjectFileELF version of GetArchitecture.Stephen Wilson2011-02-241-11/+7
| | | | | | | | | Also fix a bug where we were not lazily parsing the ELF header and thus returning an ArchSpec with invalid cpu type components. Initialize the cpu subtype as LLDB_INVALID_CPUTYPE for compatibility with the new ArchSpec implementation. llvm-svn: 126405
* Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified formGreg Clayton2011-02-231-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up doing was: - Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple to give us the machine type from llvm::Triple::ArchType. - There is a new ArchSpec::Core definition which further qualifies the CPU core we are dealing with into a single enumeration. If you need support for a new Core and want to debug it in LLDB, it must be added to this list. In the future we can allow for dynamic core registration, but for now it is hard coded. - The ArchSpec can now be initialized with a llvm::Triple or with a C string that represents the triple (it can just be an arch still like "i386"). - The ArchSpec can still initialize itself with a architecture type -- mach-o with cpu type and subtype, or ELF with e_machine + e_flags -- and this will then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core. The mach-o cpu type and subtype can be accessed using the getter functions: uint32_t ArchSpec::GetMachOCPUType () const; uint32_t ArchSpec::GetMachOCPUSubType () const; But these functions are just converting out internal llvm::Triple::ArchSpec + ArchSpec::Core back into mach-o. Same goes for ELF. All code has been updated to deal with the changes. This should abstract us until later when the llvm::TargetSpec stuff gets finalized and we can then adopt it. llvm-svn: 126278
* linux: Set ArchSpec m_type correctly from object file.Stephen Wilson2011-02-161-0/+2
| | | | | | | An ArchSpec's type defaults to MachO. Ensure the type is properly set on ELF systems. llvm-svn: 125654
* Made lldb_private::ArchSpec contain much more than just an architecture. ItGreg Clayton2011-02-151-25/+13
| | | | | | | | | | now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection. llvm-svn: 125602
* Applied a fix to qualify "UUID" with the lldb_private namespace to fixGreg Clayton2011-02-041-1/+1
| | | | | | build issues on MinGW. llvm-svn: 124888
* Test if an ELF object is executable by checking if an entry point is defined.Stephen Wilson2011-01-151-1/+1
| | | | | | | The previous check on header type ET_EXEC is not general enough. Position independent executables have type ET_DYN. llvm-svn: 123498
* Implement GetEntryPoint, GetImageInfoAddress and GetArchitecture for ↵Stephen Wilson2011-01-151-2/+76
| | | | | | ObjectFileELF. llvm-svn: 123496
* Added the ability to dump sections to a certain depth (for when sectionsGreg Clayton2010-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | have children sections). Modified SectionLoadList to do it's own multi-threaded protected on its map. The ThreadSafeSTLMap class was difficult to deal with and wasn't providing much utility, it was only getting in the way. Make sure when the communication read thread is about to exit, it clears the thread in the main class. Fixed the ModuleList to correctly ignore architectures and UUIDs if they aren't valid when searching for a matching module. If we specified a file with no arch, and then modified the file and loaded it again, it would not match on subsequent searches if the arch was invalid since it would compare an invalid architecture to the one that was found or selected within the shared library or executable. This was causing stale modules to stay around in the global module list when they should have been removed. Removed deprecated functions from the DynamicLoaderMacOSXDYLD class. Modified "ProcessGDBRemote::IsAlive" to check if we are connected to a gdb server and also make sure our process hasn't exited. llvm-svn: 121236
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fixed the Objective C method prototypes to be correct (the selectors weren'tGreg Clayton2010-10-121-5/+5
| | | | | | | | 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
* Added mutex protection to the Symtab class.Greg Clayton2010-10-081-2/+4
| | | | | | | | 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
* Looks like this is how you identify executables in ELF.Jim Ingham2010-08-101-2/+1
| | | | llvm-svn: 110641
* Change Target & Process so they can really be initialized with an invalid ↵Jim Ingham2010-08-091-0/+7
| | | | | | | | | | | | architecture. Arrange that this then gets properly set on attach, or when a "file" is set. Add a completer for "process attach -n". Caveats: there isn't currently a way to handle multiple processes with the same name. That will have to wait on a way to pass annotations along with the completion strings. llvm-svn: 110624
* Modified both the ObjectFileMachO and ObjectFileELF to correctly set theGreg Clayton2010-07-211-10/+45
| | | | | | | | | | | | | SectionType for Section objects for DWARF. Modified the DWARF plug-in to get the DWARF sections by SectionType so we can safely abstract the LLDB core from section names for the various object file formats. Modified the SectionType definitions for .debug_pubnames and .debug_pubtypes to use the correct case. llvm-svn: 109054
* Combine 32 and 64 bit ELF readers.Stephen Wilson2010-07-131-404/+467
| | | | | | | This patch provides a generic ELF reader plugin to handle both 32 and 64 bit formats. llvm-svn: 108292
* 64 bit ELF support from Stephen Wilson.Greg Clayton2010-07-071-10/+16
| | | | llvm-svn: 107817
* Remove Mac-specific includes.Eli Friedman2010-06-131-5/+0
| | | | llvm-svn: 105905
* Made lldb_private::ArchSpec more generic so that it can take a mach-o cpuGreg Clayton2010-06-111-32/+4
| | | | | | | | | | | | | | | | type and sub-type, or an ELF e_machine value. Also added a generic CPU type to the arch spec class so we can have a single arch definition that the LLDB core code can use. Previously a lot of places in the code were using the mach-o definitions from a macosx header file. Switches over to using "llvm/Support/MachO.h" for the llvm::MachO::XXX for the CPU types and sub types for mach-o ArchSpecs. Added "llvm/Support/ELF.h" so we can use the "llvm::ELF::XXX" defines for the ELF ArchSpecs. Got rid of all CPU_TYPE_ and CPU_SUBTYPE_ defines that were previously being used in LLDB. llvm-svn: 105806
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+929
llvm-svn: 105619
OpenPOWER on IntegriCloud