summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
Commit message (Collapse)AuthorAgeFilesLines
...
* Get rid of ARM_ELF_SYM_IS_THUMB flag.Stephane Sezer2016-01-121-4/+0
| | | | | | | | | | | | | | Summary: This was used with the old ARM vs. Thumb detection code but is not required anymore. Reviewers: tberghammer, clayborg Subscribers: fjricci, aemerson, lldb-commits, rengolin Differential Revision: http://reviews.llvm.org/D16099 llvm-svn: 257429
* Strip trailing whitespaceEd Maste2016-01-041-48/+48
| | | | | | | | (There are changes in the copies of these four files in the FreeBSD base system, and I've changed these ones to reduce gratuitous diffs in future imports.) llvm-svn: 256723
* Read macro info from .debug_macro section and use it for expression evaluation.Siva Chandra2015-12-162-0/+5
| | | | | | | | | | | | | | | | | Summary: DWARF 5 proposes a reinvented .debug_macro section. This change follows that spec. Currently, only GCC produces the .debug_macro section and hence the added test is annottated with expectedFailureClang. Reviewers: spyffe, clayborg, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15437 llvm-svn: 255729
* [LLDB][MIPS] Added support for MIPS1, MIPS2, MIPS3, MIPS4 and MIPS5 ↵Sagar Thakur2015-12-151-0/+5
| | | | | | | | | | | | | instruction sets Patch by Nitesh Jain. Summary: This Patch will allowed LLDB to debug respective instruction sets binaries. Reviewers: jaydeep, clayborg Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan Differential: http://reviews.llvm.org/D15487 llvm-svn: 255619
* Implement GetMemoryRegionInfo for mini dumps.Adrian McCarthy2015-12-041-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D15218 llvm-svn: 254780
* Enable saving of mini dumps with lldb process save-core.Adrian McCarthy2015-11-205-1/+97
| | | | | | | | Also adds SB API to save a core and tests that use it. Differential Revision: http://reviews.llvm.org/D14793 llvm-svn: 253734
* Revert "FOO"Adrian McCarthy2015-11-205-97/+1
| | | | | | | | Accidentally commited before I was done. This reverts commit 2ec2da4ee52780582d5e9c88b2e982a688fbdbe1. llvm-svn: 253685
* FOOAdrian McCarthy2015-11-205-1/+97
| | | | llvm-svn: 253684
* Add support for tvos and watchos to ObjectFileMachO.Jason Molenda2015-11-102-147/+217
| | | | | | | | Add support for the new dyld shared cache format on ios etc devices. Small changes for classifying ObjC metadata symbols. llvm-svn: 252588
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-071-10/+10
| | | | | | | | | | | | | | | | | | Summary: Since this is within the lldb namespace, the compiler tries to export a symbol for it. Unfortunately, since it is inlined, the symbol is hidden and this results in a mess of warnings when building on OS X with cmake. Moving it to the lldb_private namespace eliminates that problem. Reviewers: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D14417 llvm-svn: 252396
* Make sure we don't over specify an architecture when we connect to KDP and ↵Greg Clayton2015-10-281-11/+16
| | | | | | | | use the CPU type and subtype to fill out an architecture. We do this by letting the vendor be an unspecified unknown, or any. We also grab the target architecture, get the KDP host arch, and then merge the two before putting it back into the target. Also change MH_PRELOAD to be use "unspecified unknown" (any) for the OS and vendor since these mach files can really be anything. llvm-svn: 251579
* Don't crash when opening a fuzzed mach-o file that has bad dyld trie data.Greg Clayton2015-10-281-9/+17
| | | | | | <rdar://problem/21991784> llvm-svn: 251555
* Make core files not crash when you load a core file into LLDB with just ↵Greg Clayton2015-10-282-22/+106
| | | | | | | | | | | | | | | "lldb -c core". To do this I added a few new ways to determine the OS from PT_NOTE notes in the ELF file: 1 - Look for "LINUX" notes which indicate "linux" should be the OS 2 - Look through the "CORE" notes with NT_FILE as the type and sniff data from the paths listed in this section. On Ubuntu they contain "/lib/x86_64-linux-gnu" which has the triple and allows us to set "linux" as the OS in the architecture returned from ObjectFileELF::GetArchitecture(). Setting the OS correctly allows us to get the triple correct so we can extract registers without asserting and killing LLDB. Also use the data from the NT_FILE to set the main executable if one isn't set in ProcessElfCore::DoLoadCore(). llvm-svn: 251537
* Some minor improvements on the symtab parsing codeTamas Berghammer2015-10-271-7/+16
| | | | | | | | | | | | | | | * Remove an unneccessary re-computaion on arch spec from the ELF file * Use a local cache to optimize name based section lookups in symtab parsing * Optimize C++ method basename validation with replacing a regex with hand written code These modifications reduce the time required to parse the symtab from large applications by ~25% (tested with LLDB as inferior) Differential revision: http://reviews.llvm.org/D14088 llvm-svn: 251402
* Fix Clang-tidy modernize-use-override warnings in ↵Eugene Zelenko2015-10-235-282/+270
| | | | | | source/Plugins/ObjectContainer and ObjectFile; other minor fixes. llvm-svn: 251119
* ArchSpec: fix unintentional promotion of unspecified unknowns to specified ↵Todd Fiala2015-10-131-0/+6
| | | | | | | | | | | | | | | | | | | | | unknowns * ArchSpec::MergeFrom() would erroneously promote an unspecified unknown to a specified unknown when both the ArchSpec and the merged in ArchSpec were both unspecified unknowns. This no longer happens, which fixes issues with global module cache lookup in some situations. * Added ArchSpec::DumpTriple(Stream&) that now properly prints unspecified unknowns as '*' and specified unknows as 'unknown'. This makes it trivial to tell the difference between the two. Converted printing code over ot using DumpTriple() rather than building from scratch. * Fixed up a couple places that were not guaranteeing that an unspecified unknown was recorded as such. llvm-svn: 250253
* Romove accidentially added statement in r249020Sagar Thakur2015-10-011-2/+0
| | | | llvm-svn: 249021
* [LLDB][MIPS] Fix gp register value for o32 applications on 64-bit targetSagar Thakur2015-10-011-0/+2
| | | | | | | GP registers for o32 applications were always giving zero value because SetType() on the RegisterValue was causing the accessor functions to pickup the value from m_scalar of RegisterValue which is zero. In this patch byte size and byte order of register value is set at the time of setting the value of the register. llvm-svn: 249020
* Add support for .ARM.exidx unwind informationTamas Berghammer2015-09-302-0/+6
| | | | | | | | | .ARM.exidx/.ARM.extab sections contain unwind information used on ARM architecture from unwinding from an exception. Differential revision: http://reviews.llvm.org/D13245 llvm-svn: 248903
* [LLDB][MIPS] microMIPS breakpoints, disassembly and compressed addressesJaydeep Patil2015-09-221-0/+35
| | | | | | | | | | | | SUMMARY: This patch detects microMIPS symbols, sets breakpoints using un-compressed address and display disassembly in mixed mode for microMIPS applications (running on bare-iron targets). Reviewers: clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D12079 llvm-svn: 248248
* Add an OperatingSystem plugin to support goroutinesRyan Brown2015-09-163-0/+8
| | | | | | | | | | The Go runtime schedules user level threads (goroutines) across real threads. This adds an OS plugin to create memory threads for goroutines. It supports the 1.4 and 1.5 go runtime. Differential Revision: http://reviews.llvm.org/D5871 llvm-svn: 247852
* [LLDB][MIPS] Add support for DT_MIPS_RLD_MAP_RELBhushan D. Attarde2015-09-151-4/+23
| | | | | | | | | | | | SUMMARY: This patch provides support for MIPS specific DT_MIPS_RLD_MAP_REL tag in LLDB. This tag allows debugging of MIPS position independent executables and provides access to shared library information. Reviewers: clayborg Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D12794 llvm-svn: 247666
* Fix a small typo in ObjectFileELF.cpp.Stephane Sezer2015-09-111-1/+1
| | | | llvm-svn: 247452
* Improve the arm/aarch64 mapping symbol handlingTamas Berghammer2015-09-111-36/+51
| | | | | | | | | | | | Change the mapping symbol handling to handle the case when the mapping symbols are prefixed with an arbitrary prefix. This isn't strictly standard compliance, but if all symbols in an object file is prefixed with objcopy then the prefix will be added to the mapping symbol also. We still want to treat these symbols as mapping symbols to get the correct address class data. Differential revision: http://reviews.llvm.org/D12755 llvm-svn: 247400
* [LLDB][MIPS] Added support for the debugging of N32/O32 applications on ↵Mohit K. Bhakkad2015-09-091-10/+20
| | | | | | | | | | | | MIPS64 target. Patch by Nitesh Jain Reviewers: clayborg, ovyalov. Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D12671 llvm-svn: 247134
* Add basic fission support to SymbolFileDWARFTamas Berghammer2015-09-091-14/+26
| | | | | | | | | | | | | * Create new dwo symbol file class * Add handling for .dwo sections * Change indexes in SymbolFileDWARF to store compile unit offset next to DIE offset * Propagate queries from dwarf compile unit to the dwo compile unit where applicable Differential revision: http://reviews.llvm.org/D12291 llvm-svn: 247132
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-034-8/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Add support for DW_FORM_GNU_[addr,str]_indexTamas Berghammer2015-08-252-15/+23
| | | | | | | | | These are 2 new value currently in experimental status used when split debug info is enabled. Differential revision: http://reviews.llvm.org/D12238 llvm-svn: 245931
* Final bit of type system cleanup that abstracts declaration contexts into ↵Greg Clayton2015-08-241-1/+0
| | | | | | | | | | | | | | | | | | | | lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions. Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files. Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types. Bulk renames for things that used to return a ClangASTType which is now CompilerType: "Type::GetClangFullType()" to "Type::GetFullCompilerType()" "Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()" "Type::GetClangForwardType()" to "Type::GetForwardCompilerType()" "Value::GetClangType()" to "Value::GetCompilerType()" "Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)" "ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()" many more renames that are similar. llvm-svn: 245905
* Add absolute load address support for the DynamicLoader pluginsTamas Berghammer2015-08-241-26/+38
| | | | | | | | | | | | The POSIX linker generally reports the load bias for the loaded libraries but in some case it is useful to handle a library based on absolute load address. Example usecases: * Windows linker uses absolute addresses * Library list came from different source (e.g. /proc/<pid>/maps) Differential revision: http://reviews.llvm.org/D12233 llvm-svn: 245834
* The llvm Triple for an armv6m now comes back as llvm::Triple::thumb.Jason Molenda2015-08-211-0/+1
| | | | | | | | | | | | | | This was breaking disassembly for arm machines that we force to be thumb mode all the time because we were only checking for llvm::Triple::arm. i.e. armv6m (ARM Cortex-M0) armv7m (ARM Cortex-M3) armv7em (ARM Cortex-M4) <rdar://problem/22334522> llvm-svn: 245645
* A messy bit of cleanup: Move towards more descriptive namesJason Molenda2015-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for eh_frame and stabs register numberings. This is not complete but it's a step in the right direction. It's almost entirely mechanical. lldb informally uses "gcc register numbering" to mean eh_frame. Why? Probably because there's a notorious bug with gcc on i386 darwin where the register numbers in eh_frame were incorrect. In all other cases, eh_frame register numbering is identical to dwarf. lldb informally uses "gdb register numbering" to mean stabs. There are no official definitions of stabs register numbers for different architectures, so the implementations of gdb and gcc are the de facto reference source. There were some incorrect uses of these register number types in lldb already. I fixed the ones that I saw as I made this change. This commit changes all references to "gcc" and "gdb" register numbers in lldb to "eh_frame" and "stabs" to make it clear what is actually being represented. lldb cannot parse the stabs debug format, and given that no one is using stabs any more, it is unlikely that it ever will. A more comprehensive cleanup would remove the stabs register numbers altogether - it's unnecessary cruft / complication to all of our register structures. In ProcessGDBRemote, when we get register definitions from the gdb-remote stub, we expect to see "gcc:" (qRegisterInfo) or "gcc_regnum" (qXfer:features:read: packet to get xml payload). This patch changes ProcessGDBRemote to also accept "ehframe:" and "ehframe_regnum" from these remotes. I did not change GDBRemoteCommunicationServerLLGS or debugserver to send these new packets. I don't know what kind of interoperability constraints we might be working under. At some point in the future we should transition to using the more descriptive names. Throughout lldb we're still using enum names like "gcc_r0" and "gdb_r0", for eh_frame and stabs register numberings. These should be cleaned up eventually too. The sources link cleanly on macosx native with xcode build. I don't think we'll see problems on other platforms but please let me know if I broke anyone. llvm-svn: 245141
* Fix issues with separate symbolfile handlingTamas Berghammer2015-07-301-12/+29
| | | | | | Differential revision: http://reviews.llvm.org/D11595 llvm-svn: 243637
* Make sure we detect symbols in the new __DATA_DIRTY and __DATA_CONST ↵Greg Clayton2015-07-272-2/+26
| | | | | | | | segments and classify them correctly. <rdar://problem/20942073> llvm-svn: 243344
* Fix typos.Bruce Mitchener2015-07-221-5/+5
| | | | | | | | | | | | Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
* Make sure we calculate resolver symbol addresses correctly for ARM. The trie ↵Greg Clayton2015-07-161-8/+14
| | | | | | | | entries have bit 0 set for Thumb functions and we need to remove that so we can correctly determine which symbols are resolvers. <rdar://problem/21396553> llvm-svn: 242435
* [LLDB][MIPS] Detect MIPS application specific extensions like micromipsJaydeep Patil2015-07-161-0/+35
| | | | | | | | | | | | | | SUMMARY: The patch detects MIPS application specific extensions (ASE) like micromips by reading ELF header.e_flags and SHT_MIPS_ABIFLAGS section. MIPS triple does not contain ASE information like micromips, mips16, DSP, MSA etc. These can be read from header.e_flags or SHT_MIPS_ABIFLAGS section. Reviewers: clayborg Subscribers: mohit.bhakkad, sagar, lldb-commits Differential Revision: http://reviews.llvm.org/D11133 llvm-svn: 242381
* Skip oatdata and oatexec symbols in system@framework@boot.oatTamas Berghammer2015-07-131-2/+14
| | | | | | | | | | | | | | On Android the oatdata and the oatexec symbols in system@framework@boot.oat covers the full .text section what causes issues with displaying unusable symbol name to the user and very slow unwinding speed because the instruction emulation based unwind plans try to emulate all instructions in these symbols. Don't add these symbols to the symbol list as they have no use for the debugger and they are causing a lot of trouble. Differential revision: http://reviews.llvm.org/D11065 llvm-svn: 242017
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-082-7/+8
| | | | | | a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so. llvm-svn: 241751
* Use string::find(char) for single character strings.Bruce Mitchener2015-07-041-1/+1
| | | | | | | | | | | | Summary: Use string::find(char) for single character strings. Reviewers: abidh, ki.stfu, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10943 llvm-svn: 241390
* Check to make sure we have a valid N_GSYM symbol name before we use it for ↵Greg Clayton2015-07-011-29/+45
| | | | | | anything. llvm-svn: 241210
* Fix [vdso] handling on Android (x86 and aarch64)Tamas Berghammer2015-06-302-5/+33
| | | | | | | | | | | | | | * Add in-memory object file handling to the core dynamic loader * Fix in memory object file handling in ObjectFileELF (previously only part of the file was loaded before parsing) * Fix load address setting in ObjectFileELF for 32-bit targets when the load bias is negative * Change hack in DYLDRendezvous.cpp to be more specific and not to interfere with object files with fixed load address Differential revision: http://reviews.llvm.org/D10800 llvm-svn: 241057
* Re-enable 'process save-core' for arm64 targets.Jason Molenda2015-06-251-5/+1
| | | | | | | | | Whatever problem I saw that caused me to disable this initially is not a problem today. <rdar://problem/21173317> <rdar://problem/20266253> llvm-svn: 240737
* Resubmitting 240466 after fixing the linux test suite failures.Greg Clayton2015-06-253-16/+16
| | | | | | | | | | | | | | | A few extras were fixed - Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected. - Since some places want to access the address as a reference, I added a few new functions to symbol: Address &Symbol::GetAddressRef(); const Address &Symbol::GetAddressRef() const; Linux test suite passes just fine now. <rdar://problem/21494354> llvm-svn: 240702
* Fix location of symbol size calculation in ObjectFileELFTamas Berghammer2015-06-241-1/+1
| | | | | | Bug introduced by r240533 llvm-svn: 240537
* Improve instruction emulation based stack unwinding on ARMTamas Berghammer2015-06-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | * Add and fix the emulation of several instruction. * Disable frame pointer usage on Android. * Specify return address register for the unwind plan instead of explict tracking the value of RA. * Replace prologue detection heuristics (unreliable in several cases) with a logic to follow the branch instructions and restore the CFI value based on them. The target address for a branch should have the same CFI as the source address (if they are in the same function). * Handle symbols in ELF files where the symbol size is not specified with calcualting their size based on the next symbol (already done in MachO files). * Fix architecture in FuncUnwinders with filling up the inforamtion missing from the object file with the architecture of the target. * Add code to read register wehn the value is set to "IsSame" as it meanse the value of a register in the parent frame is the same as the value in the current frame. Differential revision: http://reviews.llvm.org/D10447 llvm-svn: 240533
* Fix build breakage after llvm r240426Pavel Labath2015-06-231-2/+1
| | | | | | | | | | | | Test Plan: It builds, tests pass. Reviewers: tstellarAMD, rafael Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10660 llvm-svn: 240429
* Fix the lldb build for the EM_486 change.Rafael Espindola2015-06-191-1/+1
| | | | llvm-svn: 240138
* If we have a MachO file loaded from memory, make sure we can always get the ↵Greg Clayton2015-06-082-53/+92
| | | | | | | | symbol table even if we don't have the __LINKEDIT load address set in the target. <rdar://problem/21208168> llvm-svn: 239354
* Improve OSType initialization in elf object file's arch_specEd Maste2015-06-051-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the OSType in the ArchSpec triple is needed to correctly setup up the register context plugin. ArchSpec::SetArchitecture, for Mach-O only, sets the OSType. For ELF it was left to the ObjectFileELF to fill in the missing OSType. This change moves the ObjectFileELF logic into ArchSpec. A new optional 'os' parameter has been added to SetArchitecture. For ELF, this value is the from the ELF header.e_ident[EI_OSABI]. The default value is 0 or ELFOSABI_NONE. The real work of determining the OSType was done by the ObjectFileELF helper function GetOsFromOSABI. This logic has been moved SetArchitecture. GetOsFromOSABI has been commented as being deprectated. It is left in to support asserts. For ELF the vendor value returned from SetArchitecture should be UnknownVendor. An unneeded resetting in ObjectFileELF has been removed and replaced with an assert. This fixes a problem reading a core file on FreeBSD/ARM because the spec triple was arm-unknown-unknown. Patch by Tom Rix. Differential Revision: http://reviews.llvm.org/D9292 llvm-svn: 239148
OpenPOWER on IntegriCloud