summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove insufficient linkedit address check; the problemJason Molenda2012-12-131-1/+1
| | | | | | | | is deeper than that and avoiding the crash in this one part of code won't solve anything. I know where the real problem is now. llvm-svn: 170068
* <rdar://problem/12831670>Jason Molenda2012-12-071-1/+1
| | | | | | | | | | When using the same-device optimization for shared cache libraries, if we have an invalid load address for __LINKEDIT, don't try to read anything out of lldb's own address space. Reading it out of the remote address space will fail gracefully if we have bad addresses but reading it out of lldb's own address space will result in a crash. llvm-svn: 169582
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-292-14/+14
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* <rdar://problem/12106825>Greg Clayton2012-11-271-77/+88
| | | | | | Allow the expression parser to see more than just data symbols. We now accept any symbol that has an address. We take precautions to only accept symbols by their mangled or demangled names only if the demangled name was not synthesized. If the demangled name is synthesized, then we now mark symbols accordingly and only compare against the mangled original name. llvm-svn: 168668
* <rdar://problem/12238339> Greg Clayton2012-11-161-0/+5
| | | | | | Make sure architectures are obeyed for skinny mach files. llvm-svn: 168205
* Fixed an error in the ELF parser that was comparing a bool to 4 causing 32 ↵Greg Clayton2012-11-121-1/+1
| | | | | | bit ELF relocations to get parsed incorrectly. llvm-svn: 167773
* <rdar://problem/12602978>Greg Clayton2012-10-301-1/+13
| | | | | | RegisterContextKDP_i386 was not correctly writing registers due to missing "virtual" keywords. Added the virtual keywords and made the functions pure virtual to ensure subclasses can't get away without implementing these functions. llvm-svn: 167066
* Changed the V1 and V2 runtimes to be able to detect when the ISA hash table ↵Greg Clayton2012-10-251-2/+0
| | | | | | has changed, and auto update as needed. llvm-svn: 166693
* Bunch of cleanups for warnings found by the llvm static analyzer.Jim Ingham2012-10-121-16/+19
| | | | llvm-svn: 165808
* Train LLDB to deal with bad linker N_SO entries that point to our source ↵Greg Clayton2012-09-071-0/+36
| | | | | | files for debug map + DWARF in .o file debugging. llvm-svn: 163417
* <rdar://problem/12237556>Greg Clayton2012-09-051-31/+40
| | | | | | Fixed an issue where we didn't parse N_SO stab pairs where the first N_SO was a relative path. llvm-svn: 163259
* <rdar://problem/12100588>Greg Clayton2012-09-051-1/+7
| | | | | | Don't crash when we can't resolve our stub to a symbol. llvm-svn: 163189
* Removed explicit NULL checks for shared pointersSean Callanan2012-08-091-2/+2
| | | | | | | | | and instead made us use implicit casts to bool. This generated a warning in C++11. <rdar://problem/11930775> llvm-svn: 161559
* Change the things we pass to Mangled::SetValue to be ConstStrings instead of Jason Molenda2012-07-201-5/+5
| | | | | | char*'s - Greg removed the methods which accept char*'s earlier today. llvm-svn: 160539
* Cleaned up the lldb_private::Mangled class to get rid of the tokenizing code ↵Greg Clayton2012-07-182-7/+7
| | | | | | that has bit rotted and isn't being used. Also cleaned up the API to the "lldb_private::Mangled" to always take "const ConstString &" arguments instead of both "const ConstString &" and "const char *". llvm-svn: 160466
* Ran the static analyzer on the codebase and found a few things.Greg Clayton2012-07-172-8/+0
| | | | llvm-svn: 160338
* Blacklisted a UUID that is generated by OpenCL onSean Callanan2012-07-121-0/+13
| | | | | | | | | | Mac OS X, because the UUID is the same for all OpenCL-generated dylibs and therefore would conflict. <rdar://problem/11620586> llvm-svn: 160135
* Additional comment in ObjectFileMachO::ParseSymtab to explainJason Molenda2012-06-221-6/+14
| | | | | | | the layout of the dyld shared cache file and how we're stepping through it; also use offsetof to find offsets of struct elements. llvm-svn: 158962
* Preliminary set of changes to ObjectFileMachO::ParseSymtab when lldbJason Molenda2012-06-211-8/+847
| | | | | | | | | | | | | | | | | is being run on iOS natively and we are examining a binary that is in the shared-cache. The shared cache may be set up to not load the symbol names in memory (and may be missing some local symbols entirely, to boot) so we need to read the on-disk-but-not-mapped-into-memory cache of symbol names/symbols before we start processing the in-memory nlist entries. This code needs to be reorganized into its own separate method, ideally we'll find some way to not duplicate the nlist symbol handling. But we need to handle this new format quickly and we'll clean up later. Thanks for James McIlree for the patch. Fixes <rdar://problem/11639018>. llvm-svn: 158891
* Committed a change to the SectionList that introducesSean Callanan2012-06-083-1/+5
| | | | | | | | | | | a cache of address ranges for child sections, accelerating lookups. This cache is built during object file loading, and is then set in stone once the object files are done loading. (In Debug builds, we ensure that the cache is never invalidated after that.) llvm-svn: 158188
* <rdar://problem/11537498>Greg Clayton2012-05-301-2/+20
| | | | | | | | | | | | | | | | | Fixed an issue with the symbol table parsing of files that have STAB entries in them where there are two N_SO entries where the first has a directory, and the second contains a full path: [ 0] 00000002 64 (N_SO ) 00 0000 0000000000000000 '/Volumes/data/src/' [ 1] 0000001e 64 (N_SO ) 00 0000 0000000000000000 '/Volumes/data/src/Source/main.m' [ 2] 00000047 66 (N_OSO ) 09 0001 000000004fc642d2 '/tmp/main.o' [ 3] 00000001 2e (N_BNSYM ) 01 0000 0000000000003864 [ 4] 000000bd 24 (N_FUN ) 01 0000 0000000000003864 '_main' [ 5] 00000001 24 (N_FUN ) 00 0000 00000000000000ae [ 6] 00000001 4e (N_ENSYM ) 01 0000 00000000000000ae [ 7] 00000001 64 (N_SO ) 01 0000 0000000000000000 We now correctly combine entries 0 and 1 into a single entry. llvm-svn: 157712
* <rdar://problem/11535465> Greg Clayton2012-05-251-8/+15
| | | | | | LC_ENCRYPTION_INFO with "cryptid == 0" is not actually encrypted and LLDB fails to read memory from file. llvm-svn: 157487
* Fixed an issue where we might have easy access to the string table data for ↵Greg Clayton2012-05-251-17/+21
| | | | | | a mach file from memory even though we have a process. So now we don't read the string table strings from memory when we don't have to. llvm-svn: 157482
* Found a quick way to improve the speed with which we can read object files ↵Greg Clayton2012-05-181-23/+48
| | | | | | from memory when they are in the shared cache: always read the symbol table strings from memory and let the process' memory cache do the work. llvm-svn: 157083
* Added support for the LC_ENCRYPTION_INFO load command.Greg Clayton2012-04-241-2/+28
| | | | llvm-svn: 155423
* A small fix for ObjectFileMachO::ParseSymtab() where a pointerJason Molenda2012-04-241-1/+5
| | | | | | | | into the middle of a vector was being used after the vector may have been resized. <rdar://problem/11284937> llvm-svn: 155421
* Added an iOS local debugging optimization when reading the __LINKEDIT ↵Greg Clayton2012-04-181-11/+51
| | | | | | section data for files in the dyld shared cache. llvm-svn: 154984
* Expose GetAddressClass() from both the SBAddress and SBInstruction so ↵Greg Clayton2012-04-131-1/+1
| | | | | | clients can tell the difference between ARM/Thumb opcodes when disassembling ARM. llvm-svn: 154633
* Use integers instead of NULL.Bill Wendling2012-04-031-3/+3
| | | | llvm-svn: 153941
* lldb_private::Section objects have a boolean flag that can be set that Greg Clayton2012-03-271-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indicates that the section is thread specific. Any functions the load a module given a slide, will currently ignore any sections that are thread specific. lldb_private::Section now has: bool Section::IsThreadSpecific () const { return m_thread_specific; } void Section::SetIsThreadSpecific (bool b) { m_thread_specific = b; } The ELF plug-in has been modified to set this for the ".tdata" and the ".tbss" sections. Eventually we need to have each lldb_private::Thread subclass be able to resolve a thread specific section, but for now they will just not resolve. The code for that should be trivual to add, but the address resolving functions will need to be changed to take a "ExecutionContext" object instead of just a target so that thread specific sections can be resolved. llvm-svn: 153537
* Fixed a few things in the ELF object file:Greg Clayton2012-03-271-6/+8
| | | | | | | | | 1 - sections only get a valid VM size if they have SHF_ALLOC in the section flags 2 - symbol names are marked as mangled if they start with "_Z" Also fixed the DWARF parser to correctly use the section file size when extracting the DWARF. llvm-svn: 153496
OpenPOWER on IntegriCloud