summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-2/+1
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Use the unified section list when generating a symbol tablePavel Labath2015-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Symbol table generation code was failing to take into account the debug symbols because the object file was looking only into its own section list when doing the generation, even though the debug symbols from another object file were correctly detected and loaded by the SymbolVendor. This changes the code to use the unified section list, which fixes this problem. Test Plan: I do not intend do submit this yet since it causes (or more like, exposes) the issue in D7884, but I wanted to put this out here, so that anyone who wants to take a look at it can do so. (And I also wanted to know if this is the right approach to the problem :). Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7913 llvm-svn: 231229
* Correctly resolve symbol names containing linker annotationsPavel Labath2015-03-042-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Symbols in ELF files can be versioned, but LLDB currently does not understand these. This problem becomes apparent once one loads glibc with debug info. Here (in the .symtab section) the versions are embedded in the name (name@VERSION), which causes issues when evaluating expressions referencing memcpy for example (current glibc contains memcpy@@GLIBC_2.14 and memcpy@GLIBC_2.2.5). This problem was not evident without debug symbols as the .dynsym section stores the bare names and the actual versions are present in a separate section (.gnu.version_d), which LLDB ignores. This resulted in two definitions of memcpy in the symbol table. This patch adds support for storing annotated names to the Symbol class. If Symbol.m_contains_linker_annotations is true then this symbol is annotated. Unannotated name can be obtained by calling StripLinkerAnnotations on the corresponding ObjectFile. ObjectFileELF implements this to strip @VERSION suffixes when requested. Symtab uses this function to add the bare name as well as the annotated name to the name lookup table. To preserve the size of the Symbol class, I had to steal one bit from the m_type field. Test Plan: This fixes TestExprHelpExamples.py when run with a glibc with debug symbols. Writing an environment agnostic test case would require building a custom shared library with symbol versions and testing symbol resolution against that, which is somewhat challenging. Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8036 llvm-svn: 231228
* Avoid crashing by not mmap'ing files on network mounted file systems.Greg Clayton2015-02-231-6/+6
| | | | | | | | | | | | | | | | | | | | This is implemented by making a new FileSystem function: bool FileSystem::IsLocal(const FileSpec &spec) Then using this in a new function: DataBufferSP FileSpec::MemoryMapFileContentsIfLocal(off_t file_offset, size_t file_size) const; This function only mmaps data if the file is a local file since that means we can reliably page in data. We were experiencing crashes where people would use debug info files on network mounted file systems and that mount would go away and cause the next access to a page that wasn't paged in to crash LLDB. We now avoid this by just copying the data into a heap buffer and keeping a permanent copy to avoid the crash. Updated all previous users of FileSpec::MemoryMapFileContentsIfLocal() in ObjectFile subclasses over to use the new FileSpec::MemoryMapFileContentsIfLocal() function. <rdar://problem/19470249> llvm-svn: 230283
* Exit early from DumpELFProgramHeaders if parse failsEd Maste2015-02-231-15/+15
| | | | | | | This matches the way DumpELFSectionHeaders is implemented and is recommended by the LLVM coding conventions. llvm-svn: 230228
* [LLDB][MIPS] Adding SoftwareBreakpointTrapOpcode and RelocationJumpSlotType ↵Mohit K. Bhakkad2015-01-081-0/+3
| | | | | | | | | | | | | | | | for MIPS Patch by Bhushan Attarde Reviewers: clayborg Reviewed By: clayborg Subscribers: petarj, dsanders, mohit.bhakkad, lldb-commits Differential Revision: http://reviews.llvm.org/D6861 llvm-svn: 225436
* First cut of PowerPC(64) support in LLDB.Justin Hibbits2014-10-312-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds preliminary support for PowerPC/PowerPC64, for FreeBSD. There are some issues still: * Breakpoints don't work well on powerpc64. * Shared libraries don't yet get loaded for a 32-bit process on powerpc64 host. * Backtraces don't work. This is due to PowerPC ABI using a backchain pointer in memory, instead of a dedicated frame pointer register for the backchain. * Breakpoints on functions without debug info may not work correctly for 32-bit powerpc. Reviewers: emaste, tfiala, jingham, clayborg Reviewed By: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D5988 llvm-svn: 220944
* Improve the handling of kalimba ELF file section type recognition.Matthew Gardiner2014-10-151-8/+15
| | | | | | | | Recognise the SHT_NOBITS property in kalimba ELF, and determine this to be of type zerofilled. Subsequently recognise this type to represent bytes on the target's DATA address space, and therefore be sized accordingly. llvm-svn: 219782
* Very minimal support 24-bit kalimbas. Vanilla "memory read" for data sectionsMatthew Gardiner2014-09-291-3/+43
| | | | | | | | | | | works, as do breakpoints, run and pause, display zeroth frame. See http://reviews.llvm.org/D5503 for a fuller description of the changes in this commit. llvm-svn: 218596
* ELF: store the thumbness of a function in symbol flags.Todd Fiala2014-09-152-2/+56
| | | | | | | | | | | | This allows us to fixup the address of the symbol as soon as we parse it so that lldb is not confused thinking there are two different symbols in the binary (one with the thumb bit, one without). Also, differentiating between THUMB and ARM symbols allows the debugger to place the right type of breakpoint. Change by Stephane Sezer. llvm-svn: 217841
* Handle ARM ELF symbols properly: skip $t* and $a* symbols in ObjectFileELF.Todd Fiala2014-09-151-0/+26
| | | | | | | | | | | | | | | ELF objects contain marker symbols to differentiate between ARM and THUMB functions. Instead of storing them internally and having garbage show up when symbols are searched for by the user, we can just skip them and not store them at all, as we never actually need them. Change by Stephane Sezer. Tested: Ubuntu 14.04 x86_64 MacOSX 10.9.4 x86_64 llvm-svn: 217782
* lldb - ELF: add ARM64 relocation jump slot handling in ELFHeader.Todd Fiala2014-08-291-0/+3
| | | | | | | | See http://reviews.llvm.org/D4579 for more details. Change by Paul Osmialowski. llvm-svn: 216739
* Add support for kalimba architecture variants 3, 4 and 5.Matthew Gardiner2014-08-271-2/+36
| | | | | | | | Add entries to core_definitions and elf_arch_entries for those variants. Select the subtype for the variant by parsing the e_flags field of the elf header. llvm-svn: 216541
* Move Host::GetArchitecture to HostInfo::GetArchitecture.Zachary Turner2014-08-201-4/+3
| | | | | | | | As a side effect, this patch also eliminates all of the preprocessor conditionals previously used to implement GetArchitecture(). llvm-svn: 216074
* Move some Host logic into HostInfo class.Zachary Turner2014-08-191-4/+6
| | | | | | | | | | | | | | | | | | This patch creates a HostInfo class, a static class used to answer basic queries about the host platform. As part of this change, some functionality is moved from Host to HostInfo, and relevant fixups are performed in the rest of the codebase. This is part of a larger effort to isolate more code in the Host layer into platform-specific groups, to make it easier to make platform specific changes for a particular Host without breaking other hosts. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D4963 llvm-svn: 215992
* Fix an issue where an entry point of 0x00 would cause LLDB to think that the ↵Deepak Panickal2014-07-221-1/+1
| | | | | | ELF is not executable without checking for ET_EXEC llvm-svn: 213644
* Dynamic loader for the Hexagon DSPDeepak Panickal2014-07-211-0/+3
| | | | llvm-svn: 213565
* Add kalimba as a platform.Todd Fiala2014-07-161-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This change comprises of additions and some minor changes in order that "kalimba" is listed as a supported platform and that debugging any kalimbas results in PlatformKalimba being associated with the target. The changes are as follows: * The PlatformKalimba implementation itself * A tweak to ArchSpec * .note parsing for Kalimba in ObjectFileELF.cpp * Plugin registration * Makefile additions Change by Matthew Gardiner Minor tweak for cmake and Xcode by Todd Fiala Tested: Ubuntu 14.04 x86_64, clang 3.5-built lldb, all tests pass. MacOSX 10.9.4, Xcode 6.0 Beta 1-built lldb, all tests pass. llvm-svn: 213158
* Allow generic ARM cores to match any more specific ARM architecture.Greg Clayton2014-07-121-2/+23
| | | | | | <rdar://problem/15932248> llvm-svn: 212863
* Modify ObjectFileELF::GetArchitecture() to avoid calling ↵Todd Fiala2014-07-111-2/+5
| | | | | | | | ParseSectionHeaders() when we have headers. Change by Matthew Gardiner. llvm-svn: 212825
* Prevent ObjectFileELF::GetSectionHeaderInfo() from reparsing section headers.Todd Fiala2014-07-111-4/+4
| | | | | | | | | | | | | If we have any section headers in the collection, we already parsed them. Therefore, don't reparse the section headers when the section_headers collection is not empty. See this thread for more details: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140707/011721.html Change by Matthew Gardiner llvm-svn: 212822
* Fix typos.Bruce Mitchener2014-07-081-4/+4
| | | | llvm-svn: 212553
* Fix typos.Bruce Mitchener2014-07-011-3/+3
| | | | llvm-svn: 212132
* Fix ObjectFileELF to determine architectures independent of host.Todd Fiala2014-06-272-37/+303
| | | | | | | | | | | | | | | | | | Previously ObjectFileELF was simplifying and assuming the object file it was looking at was the same as the host architecture/triple. This would break attempts to run, say, lldb on MacOSX against lldb-gdbserver on Linux since the MacOSX lldb would say that the linux elf file was really an Apple MacOSX architecture. Chaos would ensue. This change allows the elf file to parse ELF notes for Linux, FreeBSD and NetBSD, and determine the OS appropriately from them. It also initializes the OS type from the ELF header OSABI if it is set (which it is for FreeBSD but not for Linux). Added a test with freebsd and linux images that verify that '(lldb) image list -t -A' prints out the expected architecture for each. llvm-svn: 211907
* Replace GCC-specific intrinsic with portable alternative.Zachary Turner2014-06-251-1/+5
| | | | | | | | | | | | | | | | Not all supported compilers have GCC intrinsics, so this patch uses the correct portable alternative. Additionally, this patch fixes an off-by-one error. __builtin_ffs returns the 1-based index of the least-significant 1-bit, but the function expects the base 2 logarithm of the number, which is equivalent to the 0-based index of the least-significant 1-bit. Reviewed by: Keno Fischer Differential Revision: http://reviews.llvm.org/D4284 llvm-svn: 211669
* Patch from Keno Fischer to enable JITLoaderGDB with mach-o file support.Greg Clayton2014-06-241-0/+1
| | | | | | The patch is as is with the functionality left disabled for apple vendors because of performance regressions. If this is enabled it ends up searching for symbols in all shared libraries that are loadeded. llvm-svn: 211638
* <rdar://problem/14515139>Enrico Granata2014-03-251-1/+1
| | | | | | | Add a GetFoundationVersion() to AppleObjCRuntime This API is used to return and cache the major version of Foundation.framework, which is potentially a useful piece of data to key off of to enable or disable certain ObjC related behaviors (especially in data formatters) llvm-svn: 204756
* Improve Elf object file UUID calculation performance.Todd Fiala2014-03-252-26/+162
| | | | | | | | | | | This change makes significant improvements in the performance of calculating a UUID within ObjectFileELF, and handles both running processes and core files correctly. This does lazy evaluation of UUID generation and caches the result when calculated. Change by Piotr Rak. llvm-svn: 204749
* Cleanup some dead assignements reported by scan-buildArnaud A. de Grandmaison2014-03-221-5/+3
| | | | | | No functionnal change. llvm-svn: 204545
* Add support for JIT debugging on Linux using the GDB JIT interface. Patch ↵Andrew MacPherson2014-03-052-5/+263
| | | | | | written with Keno Fischer. llvm-svn: 202956
* remove dead code + simplify a littleSylvestre Ledru2014-02-211-4/+2
| | | | llvm-svn: 201865
* Modified ObjectFile::SetLoadAddress() to now be:Greg Clayton2014-02-072-14/+27
| | | | | | | | | | | | | | ObjectFile::SetLoadAddress (Target &target, lldb::addr_t value, bool value_is_offset); Now "value" is a slide if "value_is_offset" is true, and "value" is an image base address otherwise. All previous usage of this API was using slides. Updated the ObjectFileELF and ObjectFileMachO SetLoadAddress methods to do the right thing. Also updated the ObjectFileMachO::SetLoadAddress() function to not load __LINKEDIT when it isn't needed and to only load sections that belong to the executable object file. llvm-svn: 201003
* Factor some methods that were in DynamicLoaderPOSIXDYLD.Steve Pucci2014-02-062-0/+36
| | | | | | | | | | | | | | | Move some code that was in DynamicLoaderPOSIXDLYD into the base class DynamicLoader. In the case of UpdateLoadedSections(), the test to see whether a file is loadable (its address is zero) is not generally applicable so that test is changed to a more universally applicable check for the SHF_ALLOC flag on the section. Also make it explicit that the reading of the module_id in DynamicLoaderPOSIXDYLD::GetThreadLocalData() is using a hardcoded size (of module_id) of 4, which might not be appropriate on big-endian 64-bit systems, leaving a FIXME comment in place. llvm-svn: 200939
* elf: Move elf note parsing to ObjectFileELF.cppEd Maste2013-12-022-25/+76
| | | | | | | | | Separate ELF note implementations were introduced for core files and GNU build-id. Move the more general one from elf-core to ObjectFileELF and use it for build-id as well. Review: http://llvm-reviews.chandlerc.com/D1902 llvm-svn: 196125
* Simplify indirect rld_map for mips (rework r192408).Ed Maste2013-10-112-4/+15
| | | | | | | | | Just pass a Target* into ObjectFileELF::GetImageInfoAddress so that it can do the extra dereference necessary on MIPS, instead of passing a flag back to the caller. Review: http://llvm-reviews.chandlerc.com/D1899 llvm-svn: 192469
* Support mips shared object debug infoEd Maste2013-10-112-3/+4
| | | | | | | | | | MIPS's .dyanamic section is read-only. Instead of using DT_DEBUG for the pointer to dyld information it uses a separate tag DT_MIPS_RLD_MAP which points to storage in the read-write .rld_map section, which in turn points to the dyld information. Review: http://llvm-reviews.chandlerc.com/D1890 llvm-svn: 192408
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-251-6/+6
| | | | llvm-svn: 191367
* Adds an option to resolve a symbol from an address that can be usedAshok Thirumurthi2013-09-242-0/+55
| | | | | | | | | | | | | | | | | to build out the symbol table as addresses are used, and implements the mechanism for ELF to add stripped symbols from eh_frame. Uses this mechanism to allow disassembly for addresses corresponding to stripped symbols for ELF, and provide hooks to implement this for PE COFF. Also removes eSymbolContextTailCall in favor of an option for ResolveSymbolContextForAddress for consistency with the documentation for eSymbolContextEverything. Essentially, this is just an option for interpreting the so_addr. llvm-svn: 191307
* Round plt entsize to addralignMichael Sartain2013-08-221-2/+17
| | | | llvm-svn: 189066
* Fix the lldb build after the removal of mblaze.Rafael Espindola2013-07-251-2/+0
| | | | llvm-svn: 187151
* simple plugin now works with Linux fix assert in SetPluginInfo implement ↵Michael Sartain2013-07-171-1/+2
| | | | | | | | Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment Differential Revision: http://llvm-reviews.chandlerc.com/D1159 llvm-svn: 186475
* 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-102-206/+167
| | | | | | | | | | | | | | | - 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-012-184/+414
| | | | llvm-svn: 185366
* 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
OpenPOWER on IntegriCloud