summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed GetModuleSpecifications() to work better overall:Greg Clayton2013-07-121-1/+2
| | | | | | | | | | | - MachO files now correctly extract the UUID all the time - More file size and offset verification done for universal mach-o files to watch for truncated files - ObjectContainerBSDArchive now supports enumerating all objects in BSD archives (.a files) - lldb_private::Module() can not be properly constructed using a ModuleSpec for a .o file in a .a file - The BSD archive plug-in shares its cache for GetModuleSpecifications() and the create callback - Improved printing for ModuleSpec objects llvm-svn: 186211
* Adds methods to ObjectFileELF to access data in ELF segmentsAshok Thirumurthi2013-07-112-1/+40
| | | | | | | | in preparation to add support for ELF core files. Patch by Samuel Jacob! llvm-svn: 186114
* Cleanup on the unified section list changes. Main changes are:Greg Clayton2013-07-106-685/+667
| | | | | | | | | | | | | | | - ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags - Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections. Other cleanups: - Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly - Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently - Modified the Symtab class to store a file address lookup table for more efficient lookups - Removed Section::Finalize() and SectionList::Finalize() as they did nothing - Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs - Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement) llvm-svn: 185990
* Fix ObjectFileELF crc32 code used when no build id is present.Michael Sartain2013-07-031-67/+86
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1081 llvm-svn: 185494
* Split symbol support for ELF and Linux.Michael Sartain2013-07-016-190/+428
| | | | llvm-svn: 185366
* A collection of 3 patches to the COFF file ObjectFile parser from Virgile Bello:Greg Clayton2013-06-181-5/+40
| | | | | | | | | 3 patches, aiming to improve PE/COFF support: - First patch fix symbol reading (invalid header size from sizeof() == 20 != 18, and various bugfixes such as invalid skipping of auxiliary symbols, 4 bytes shift from beginning, etc...). - Second patch add image_base to section vmaddr offset so that VM addr is in image_base space. - Third patch add support for DWARF section in PECOFF (taken from ELF counterpart), since they are generated by gcc/clang under windows. llvm-svn: 184153
* <rdar://problem/13941992>Greg Clayton2013-06-041-5/+7
| | | | | | Accept mach-o files with bad segments. Many core files are not created correctly and we should still be able to glean any information we can from them. llvm-svn: 183247
* Fix various build warnings.Matt Kopec2013-06-031-1/+1
| | | | llvm-svn: 183140
* Adds PT_TLS and PT_GNU_EH_FRAME names to DumpELFProgramHeadersFilipe Cabecinhas2013-05-231-10/+12
| | | | llvm-svn: 182619
* ObjectFileELF::GetModuleSpecifications on Linux should work now.Michael Sartain2013-05-233-12/+78
| | | | | | | Which means "platform process list" should work and list the architecture. We are now parsing the elf build-id if it exists, which should allow us to load stripped symbols (looking at that next). llvm-svn: 182610
* Comment out ObjectFileELF::GetModuleSpecifications() function until I can ↵Michael Sartain2013-05-171-1/+5
| | | | | | debug where it's causing tests to fail. llvm-svn: 182069
* Implement ObjectFileELF::GetModuleSpecifications(), and add PlatformLinux ↵Michael Sartain2013-05-172-1/+45
| | | | | | | code to deal with unknown arch properties. CR: Greg Clayton llvm-svn: 182065
* Fix ObjectFileELF to not use the file_offset twice.Filipe Cabecinhas2013-05-161-1/+1
| | | | llvm-svn: 182061
* <rdar://problem/13128331>Greg Clayton2013-05-151-24/+21
| | | | | | | | Fixed "target symbols add" to correctly extract all module specifications from a dSYM file that is supplied and match the symbol file to a current target module using the UUID values if they are available. This fixes the case where you add a dSYM file (like "foo.dSYM") which is for a renamed executable (like "bar"). In our case it was "mach_kernel.dSYM" which didn't match "mach_kernel.sys". llvm-svn: 181916
* <rdar://problem/13748253>Greg Clayton2013-05-141-91/+141
| | | | | | Combine N_GSYM stab entries with their non-stab counterpart (data symbols) to make the symbol table smaller with less duplicate named symbols. llvm-svn: 181841
* A few more small tweaks to arm core file handling.Jason Molenda2013-05-141-7/+20
| | | | | | | | | | | | Most importantly, have DoReadGPR/DoReadFPU/DoReadEXC return -1 to indicate failure if they're called. Else these could override the Error setting for the relevant thread state -- if the core file didn't include a floating point thread state, for instance, these functions would clear the Error setting for that register set and lldb would display random bytes as those registers' contents. <rdar://problem/13665075> llvm-svn: 181757
* Small change to the previous checkin, read in the fpu register contextJason Molenda2013-05-141-4/+10
| | | | | | | in one large block - and be sure toget the fpscr value as well when processing a core file. llvm-svn: 181756
* Fixes to read the floating point and exception registers sets outJason Molenda2013-05-141-18/+36
| | | | | | | of arm Mach-O core files. <rdar://problem/13665075> llvm-svn: 181755
* <rdar://problem/13854277>Greg Clayton2013-05-106-42/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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
* Cleanup logging to use the new "std::string FileSpec::GetPath()" function. ↵Greg Clayton2013-04-291-6/+4
| | | | | | | | | | | 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
* Added the ability to extract a ModuleSpecList (a new class) from an ↵Greg Clayton2013-04-246-37/+209
| | | | | | | | | | | | | | | | | ObjectFile. This is designed to be used when you have an object file that contains one or more architectures (MacOSX universal (fat) files) and/or one or more objects (BSD archive (.a files)). There is a new static ObjectFile function you can call: size_t ObjectFile::GetModuleSpecifications (const FileSpec &file, lldb::offset_t file_offset, ModuleSpecList &specs) This will fill in "specs" which the details of all the module specs (file + arch + UUID (if there is one) + object name (for BSD archive objects eventually) + file offset to the object in question). This helps us when a user specifies a file that contains a single architecture, and also helps us when we are given a debug symbol file (like a dSYM file on MacOSX) that contains one or more architectures and we need to be able to match it up to an existing Module that has no debug info. llvm-svn: 180224
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-184-5/+5
| | | | | | 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-184-5/+5
| | | | | | | | 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-171-3/+1
| | | | | | - will commit a different workaround momentarily llvm-svn: 179705
* Fix Linux build of LLDBDaniel Malea2013-04-171-1/+3
| | | | | | | - 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
* Fix a pointer arithmetic thinko in ObjectFileMachO::GetLLDBSharedCacheUUID().Jason Molenda2013-04-161-1/+1
| | | | llvm-svn: 179643
* Add warning messages for the cases where the inferior process shared cacheJason Molenda2013-04-161-5/+10
| | | | | | | | | differs from lldb's own shared cache, and where the inferior process shared cache does not match up with the on-disk shared cache file. Simplify the code where lldb gets its own shared cache uuid a little bit. llvm-svn: 179633
* <rdar://problem/13468295>Greg Clayton2013-04-161-13/+24
| | | | | | Show an error message when we have a corrupt mach-o file where the LC_SEGMENT or LC_SEGMENT_64 load command have file offsets or file offsets + sizes that extend beyond the end of the file. llvm-svn: 179605
* The dyld_all_image_infos structure, at version 13 and higher, hasJason Molenda2013-04-162-13/+127
| | | | | | | | | | | | a UUID for the shared cache libraries that can be used to confirm that one process' shared cache is the same as another, or that a process' in-memory shared cache is a match for a given on-disk dyld_shared_cache binary file. Use these UUIDs to catch some uncommon problems when the shared caches are being changed for debug purposes. <rdar://problem/13524467> llvm-svn: 179583
* Fix some minor code indentation mistakes in ObjectFileMachO.Jason Molenda2013-04-161-39/+39
| | | | | | No code changes in this checkin, only whitespace. llvm-svn: 179579
* Fixed issues with the way ELF symbols are parsed:Greg Clayton2013-04-133-2/+114
| | | | | | | | | | - Do not add symbols with no names - Make sure that symbols from ELF symbol tables know that the byte size is correct. Previously the symbols would calculate their sizes by looking for the next symbol and take symbols that had zero size and make them have invalid sizes. - Added the ability to dump raw ELF symbols by adding a Dump method to ELFSymbol Also removed some unused code from lldb_private::Symtab. llvm-svn: 179466
* When ObjectFileMachO::ParseSections() notices that it has a truncated file, ↵Jason Molenda2013-04-101-0/+26
| | | | | | | | | | | zero out the SectionList so we don't try to do anything with this file. Currently we end up crashing later in the debug session when we read past the end of the file -- this at least gets us closer with something like ProcessMachCore printing "error: core file has no sections". <rdar://problem/13468295> llvm-svn: 179152
* <rdar://problem/13521159>Greg Clayton2013-03-271-8/+8
| | | | | | | | 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
* Don't try to read the eh_frame section out of a dSYM.Jason Molenda2013-03-221-1/+5
| | | | | | It won't have one and it isn't needed. llvm-svn: 177688
* Add a new method GetFunctionAddressAndSizeVector to DWARFCallFrameInfo.Jason Molenda2013-03-211-0/+33
| | | | | | | | | | | | | | | | | | | | | | | This returns a vector of <file address, size> entries for all of the functions in the module that have an eh_frame FDE. Update ObjectFileMachO to use the eh_frame FDE function addresses if the LC_FUNCTION_STARTS section is missing, to fill in the start addresses of any symbols that have been stripped from the binary. Generally speaking, lldb works best if it knows the actual start address of every function in a module - it's especially important for unwinding, where lldb inspects the instructions in the prologue of the function. In a stripped binary, it is deprived of this information and it reduces the quality of our unwinds and saved register retrieval. Other ObjectFile users may want to use the function addresses from DWARFCallFrameInfo to fill in any stripped symbols like ObjectFileMachO does already. <rdar://problem/13365659> llvm-svn: 177624
* Remove some tabs and extraneous space chars from ObjectFileMachO.cpp.Jason Molenda2013-03-061-136/+136
| | | | | | Noticed these while working on the last commit. llvm-svn: 176590
* Retrieve the dyld shared cache mapping offset from the shared cache instead ↵Jason Molenda2013-03-061-14/+64
| | | | | | | | | of hardcoding the value. Read the version number of the dyld shared cache. <rdar://problem/13311882> llvm-svn: 176589
* <rdar://problem/13338643>Greg Clayton2013-03-045-17/+1
| | | | | | | | | | | | | | | | DWARF with .o files now uses 40-60% less memory! Big fixes include: - Change line table internal representation to contain "file addresses". Since each line table is owned by a compile unit that is owned by a module, it makes address translation into lldb_private::Address easy to do when needed. - Removed linked address members/methods from lldb_private::Section and lldb_private::Address - lldb_private::LineTable can now relink itself using a FileRangeMap to make it easier to re-link line tables in the future - Added ObjectFile::ClearSymtab() so that we can get rid of the object file symbol tables after we parse them once since they are not needed and kept memory allocated for no reason - Moved the m_sections_ap (std::auto_ptr to section list) and m_symtab_ap (std::auto_ptr to the lldb_private::Symtab) out of each of the ObjectFile subclasses and put it into lldb_private::ObjectFile. - Changed how the debug map is parsed and stored to be able to: - Lazily parse the debug map for each object file - not require the address map for a .o file until debug information is linked for a .o file llvm-svn: 176454
* Added eSymbolTypeResolver to a few switch statements that needed it.Greg Clayton2013-02-271-0/+1
| | | | llvm-svn: 176210
* Add GNU indirect function support in expressions for Linux.Matt Kopec2013-02-271-0/+6
| | | | llvm-svn: 176206
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-214-0/+19
| | | | | | | | | | | | | | - generate-vers.pl has to be called by cmake to generate the version number - parallel builds not yet supported; dependency on clang must be explicitly specified Tested on Linux. - Building on Mac will require code-signing logic to be implemented. - Building on Windows will require OS-detection logic and some selective directory inclusion Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir who ported them to Linux! llvm-svn: 175795
* Fix ELF parsing where undefined symbols were being added to the symbol table ↵Matt Kopec2013-02-121-26/+30
| | | | | | with the incorrect symbol type. llvm-svn: 174984
* Be sure to set the data offset to zero if we actually mmap the entire ELF file.Greg Clayton2013-02-071-1/+2
| | | | llvm-svn: 174668
* Fixing stale pointer problem in ELFObjectFileAndrew Kaylor2013-02-071-2/+3
| | | | llvm-svn: 174665
* <rdar://problem/13159777> Greg Clayton2013-02-066-50/+104
| | | | | | | | | | | | | | lldb was mmap'ing archive files once per .o file it loads, now it correctly shares the archive between modules. LLDB was also always mapping entire contents of universal mach-o files, now it maps just the slice that is required. Added a new logging channel for "lldb" called "mmap" to help track future regressions. Modified the ObjectFile and ObjectContainer plugin interfaces to take a data offset along with the file offset and size so we can implement the correct caching and efficient reading of parts of files without mmap'ing the entire file like we used to. The current implementation still keeps entire .a files mmaped (once) and entire slices from universal files mmaped to ensure that if a client builds their binaries during a debug session we don't lose our data and get corrupt object file info and debug info. llvm-svn: 174524
* Change ObjectFileMachO::ParseSymtab to read the externalJason Molenda2013-02-051-2/+14
| | | | | | | | | function stub routine addresses from an in-memory-only MachO object file. This was the only remaining part of ParseSymtab() that was assuming a file exists. <rdar://problem/13139585> llvm-svn: 174455
* One more change of a uint32_t variable to offset_tJason Molenda2013-01-261-1/+1
| | | | | | | to match Greg's dataextractor patch, this one in some #if defined arm code. llvm-svn: 173564
* <rdar://problem/13069948>Greg Clayton2013-01-258-97/+105
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* Removed the == and != operators from ArchSpec, sinceSean Callanan2012-12-131-1/+1
| | | | | | | | | | | | equality can be strict or loose and we want code to explicitly choose one or the other. Also renamed the Compare function to IsEqualTo, to avoid confusion. <rdar://problem/12856749> llvm-svn: 170152
OpenPOWER on IntegriCloud