History log of /external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0bbfea68d47cc401b6f8309acc788d8224401ed6 17-Jul-2013 Michael Sartain <mikesart@valvesoftware.com> simple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment

Differential Revision: http://llvm-reviews.chandlerc.com/D1159

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
513ca6036e91258b84fc38d703ae611b250ed868 11-Jul-2013 Ashok Thirumurthi <ashok.thirumurthi@intel.com> Adds methods to ObjectFileELF to access data in ELF segments
in preparation to add support for ELF core files.

Patch by Samuel Jacob!


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
7940069905bee0b2e5f0661bf37c9f906ddf8603 10-Jul-2013 Greg Clayton <gclayton@apple.com> Cleanup on the unified section list changes. Main changes are:
- 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)



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
4fa5470e29c0f044af634dbda00a461c211ca964 03-Jul-2013 Michael Sartain <mikesart@valvesoftware.com> Fix ObjectFileELF crc32 code used when no build id is present.

Differential Revision: http://llvm-reviews.chandlerc.com/D1081

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
a807ceef5dad2b24e5bae5c5a193ff03aa7ec8d9 01-Jul-2013 Michael Sartain <mikesart@valvesoftware.com> Split symbol support for ELF and Linux.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
d5a5e25deebaf7eef739e3bd2a6cbc0fbce56534 24-May-2013 Filipe Cabecinhas <me@filcab.net> Adds PT_TLS and PT_GNU_EH_FRAME names to DumpELFProgramHeaders

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
0be9b3b58e6ba0929b325c4520d388aafed5891f 23-May-2013 Michael Sartain <mikesart@valvesoftware.com> ObjectFileELF::GetModuleSpecifications on Linux should work now.
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).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
d40be9c53ff657a1dabca12ef2c2cb67e95fc8c1 17-May-2013 Michael Sartain <mikesart@valvesoftware.com> Comment out ObjectFileELF::GetModuleSpecifications() function until I can debug where it's causing tests to fail.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
535df0cfa77054c4bd28d0040441ac1a05e7d1a0 17-May-2013 Michael Sartain <mikesart@valvesoftware.com> Implement ObjectFileELF::GetModuleSpecifications(), and add PlatformLinux code to deal with unknown arch properties.

CR: Greg Clayton



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
f043618acf59de1f269f0b9f29e980fb9000f1f9 17-May-2013 Filipe Cabecinhas <me@filcab.net> Fix ObjectFileELF to not use the file_offset twice.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
0e191607adcb0ea8ebd06c278be648a7f5c0097f 10-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13854277>
<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.






git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
36b877d2d27f7d1890f2d13807a3addb216648e2 25-Apr-2013 Greg Clayton <gclayton@apple.com> Added the ability to extract a ModuleSpecList (a new class) from an 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
102b2c2681c9a830afe25bfea35557421905e42c 19-Apr-2013 Greg Clayton <gclayton@apple.com> After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
81a96aa6242f7b559770f5dc62316253cb8cb0d4 18-Apr-2013 Greg Clayton <gclayton@apple.com> Since we use C++11, we should switch over to using std::unique_ptr when 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
f58438fa7751274b6f4e4b1805940127dce13b00 14-Apr-2013 Greg Clayton <gclayton@apple.com> Fixed issues with the way ELF symbols are parsed:
- 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
464a5063bc59755cb6ec063d0b2491097302d2ab 04-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13338643>

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



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
4f9103faba72fdfc4b4299d6d459bc820ee597b2 27-Feb-2013 Matt Kopec <Matt.Kopec@intel.com> Add GNU indirect function support in expressions for Linux.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
092ea400350a06d959f14d391c0b1facc77e674d 12-Feb-2013 Matt Kopec <Matt.Kopec@intel.com> Fix ELF parsing where undefined symbols were being added to the symbol table with the incorrect symbol type.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
88d0ca9d0196e46494cd73439bd685571d31322d 07-Feb-2013 Greg Clayton <gclayton@apple.com> Be sure to set the data offset to zero if we actually mmap the entire ELF file.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
b7e922a68768c9002c4155cf910d0f683c24692a 07-Feb-2013 Andrew Kaylor <andrew.kaylor@intel.com> Fixing stale pointer problem in ELFObjectFile

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
cbe61bd26db663fa3036866dc33315c6ffc37910 06-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13159777>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
36da2aa6dc5ad9994b638ed09eb81c44cc05540b 25-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13069948>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
5f35a4be95aed0e5b2cb36f7d785bcbfc67284ae 29-Nov-2012 Daniel Malea <daniel.malea@intel.com> Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
f96e9492e90cc2e72486a194a049faaf7d27f8e0 12-Nov-2012 Greg Clayton <gclayton@apple.com> Fixed an error in the ELF parser that was comparing a bool to 4 causing 32 bit ELF relocations to get parsed incorrectly.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
4a379b1194f3e6b308cd6e80b45d6ca5dd0aafd7 17-Jul-2012 Greg Clayton <gclayton@apple.com> Ran the static analyzer on the codebase and found a few things.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
716a6647382d32ea9859027f7eea07e6ff2acf76 08-Jun-2012 Sean Callanan <scallanan@apple.com> Committed a change to the SectionList that introduces
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.)


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@158188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
8c1b38294f9b33d14d10ace3f7bd50fbbe9923d9 03-Apr-2012 Bill Wendling <isanbard@gmail.com> Use integers instead of NULL.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
9ab696e40530fa966e08cab7af77ea62e4fff1c0 27-Mar-2012 Greg Clayton <gclayton@apple.com> lldb_private::Section objects have a boolean flag that can be set that
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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
23d90aea32663f114ffee323775b02dad09f2f18 27-Mar-2012 Greg Clayton <gclayton@apple.com> Fixed a few things in the ELF object file:
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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
3508c387c3f0c9ecc439d98048fd7694d41bab1b 24-Feb-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10103468>

I started work on being able to add symbol files after a debug session
had started with a new "target symfile add" command and quickly ran into
problems with stale Address objects in breakpoint locations that had
lldb_private::Section pointers into modules that had been removed or
replaced. This also let to grabbing stale modules from those sections.
So I needed to thread harded the Address, Section and related objects.

To do this I modified the ModuleChild class to now require a ModuleSP
on initialization so that a weak reference can created. I also changed
all places that were handing out "Section *" to have them hand out SectionSP.
All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild
so all of the find plug-in, static creation function and constructors now
require ModuleSP references instead of Module *.

Address objects now have weak references to their sections which can
safely go stale when a module gets destructed.

This checkin doesn't complete the "target symfile add" command, but it
does get us a lot clioser to being able to do such things without a high
risk of crashing or memory corruption.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
b5a8f1498e1ddaeed5187a878d57ea0b74af9c26 05-Feb-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10560053>

Fixed "target modules list" (aliased to "image list") to output more information
by default. Modified the "target modules list" to have a few new options:

"--header" or "-h" => show the image header address
"--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library)

Removed the "--symfile-basename" or "-S" option, and repurposed it to
"--symfile-unique" "-S" which will show the symbol file if it differs from
the executable file.

ObjectFile's can now be loaded from memory for cases where we don't have the
files cached locally in an SDK or net mounted root. ObjectFileMachO can now
read mach files from memory.

Moved the section data reading code into the ObjectFile so that the object
file can get the section data from Process memory if the file is only in
memory.

lldb_private::Module can now load its object file in a target with a rigid
slide (very common operation for most dynamic linkers) by using:

bool
Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)

lldb::SBModule() now has a new constructor in the public interface:

SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr);

This will find an appropriate ObjectFile plug-in to load an image from memory
where the object file header is at "header_addr".




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
db2dc2b824b61ef7578dc8cdad7b338aa82b1f17 12-Jan-2012 Greg Clayton <gclayton@apple.com> Big change in the way ObjectFile file contents are managed. We now
mmap() the entire object file contents into memory with MAP_PRIVATE.
We do this because object file contents can change on us and currently
this helps alleviate this situation. It also make the code for accessing
object file data much easier to manage and we don't end up opening the
file, reading some data and closing the file over and over.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
7e5fa7fc1f8efd24c078e063b2c4b5e13ba5be20 20-Sep-2011 Jason Molenda <jmolenda@apple.com> Update declarations for all functions/methods that accept printf-style
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
ca31997f0ff24dbba39623054d5a94a0181c52d6 09-Jul-2011 Greg Clayton <gclayton@apple.com> Added the ability to get an abstract file type (executable, object file,
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
182c286f30516af0eea3b661e06e7a2d7e7b9d68 03-Jun-2011 Peter Collingbourne <peter@pcc.me.uk> Scan dynamic symbol table of ELF object files

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@132582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
ce477324f5175d409623856b1bde088f0109a535 30-Mar-2011 Stephen Wilson <wilsons@start.ca> elf: synthesize symbols for PLT entries

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
b344843f75ef893762c93fd0a22d2d45712ce74d 24-Mar-2011 Greg Clayton <gclayton@apple.com> Fixed the LLDB build so that we can have private types, private enums and
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
e4b9c1fb338ee1ada72e6a3c198afb342d68c5c1 08-Mar-2011 Greg Clayton <gclayton@apple.com> LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
791af3bfcea2942267e92b4dfa1cdd0e44c7f3ca 08-Mar-2011 Stephen Wilson <wilsons@start.ca> Fix ObjectFileElf::GetEntryPointAddress()

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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
e45140f9916841ea356ef707541945efa20ba042 08-Mar-2011 Jim Ingham <jingham@apple.com> I didn't notice there was already an ObjectFile::GetEntryPoint. Move that 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
2877594f4442cfc4d0ed2abd30af6b8027a84fc1 08-Mar-2011 Jim Ingham <jingham@apple.com> Add a method "GetEntryPoint" to the ObjectFile class, and implement it on 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
f7cc64d65f527ae132b4d6e014eeadca8175f3a8 24-Feb-2011 Stephen Wilson <wilsons@start.ca> linux: Remove a local ObjectFileELF version of GetArchitecture.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
940b103224f3062578c7a7e6e76d8bf4a7956f2a 23-Feb-2011 Greg Clayton <gclayton@apple.com> Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified form
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
cd298d8af1dce57282b6d7635896ea297255f776 16-Feb-2011 Stephen Wilson <wilsons@start.ca> linux: Set ArchSpec m_type correctly from object file.

An ArchSpec's type defaults to MachO. Ensure the type is properly set
on ELF systems.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
395fc33dc4b06c048ed35047ec461bc092ef2df3 15-Feb-2011 Greg Clayton <gclayton@apple.com> Made lldb_private::ArchSpec contain much more than just an architecture. It
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
0467c78e9a75eff9ec33d3c1f39fa83e1c5d9241 04-Feb-2011 Greg Clayton <gclayton@apple.com> Applied a fix to qualify "UUID" with the lldb_private namespace to fix
build issues on MinGW.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
90987395d3649450dfad93b5d2776974e5adab7f 15-Jan-2011 Stephen Wilson <wilsons@start.ca> Test if an ELF object is executable by checking if an entry point is defined.

The previous check on header type ET_EXEC is not general enough. Position
independent executables have type ET_DYN.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
f2ad3259066acd7e365dbe014de2f039f771fca3 15-Jan-2011 Stephen Wilson <wilsons@start.ca> Implement GetEntryPoint, GetImageInfoAddress and GetArchitecture for ObjectFileELF.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
58e844b3561848e73e69d6d98746d4851e78306e 08-Dec-2010 Greg Clayton <gclayton@apple.com> Added the ability to dump sections to a certain depth (for when sections
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.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
537a7a86687683fd403ce652d178fbc89e06ef9f 20-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where we were resolving paths when we should have been.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
ad60bf486dee699dd524225b63271ddc5b6329b9 12-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed the Objective C method prototypes to be correct (the selectors weren't
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
8d3802d9d6c1be4c0d37c4d269b18bcb865823e6 08-Oct-2010 Greg Clayton <gclayton@apple.com> Added mutex protection to the Symtab class.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
1240b9152b87cd0fd0d418794213f34b4b273dd2 10-Aug-2010 Jim Ingham <jingham@apple.com> Looks like this is how you identify executables in ELF.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
7508e732818c32e1cfeaaf7d1d507fe3834ce9d2 10-Aug-2010 Jim Ingham <jingham@apple.com> Change Target & Process so they can really be initialized with an invalid 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
32a8c7e02b84fbc36ee0fdb553002a1880c8d83e 22-Jul-2010 Greg Clayton <gclayton@apple.com> Modified both the ObjectFileMachO and ObjectFileELF to correctly set the
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
ddd2962a3b9f22ddfe472ef6ba225d0c55b23727 14-Jul-2010 Stephen Wilson <wilsons@start.ca> Combine 32 and 64 bit ELF readers.

This patch provides a generic ELF reader plugin to handle both 32 and 64 bit
formats.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
596ba27e55725bf1795e6abe79a17aaf72935c8d 07-Jul-2010 Greg Clayton <gclayton@apple.com> 64 bit ELF support from Stephen Wilson.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
c3d2139c62581bbb5185fc4825e0be5214d6455b 13-Jun-2010 Eli Friedman <eli.friedman@gmail.com> Remove Mac-specific includes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
cf0150574a0a97049efe2dce2cc0aa433705feb3 11-Jun-2010 Greg Clayton <gclayton@apple.com> Made lldb_private::ArchSpec more generic so that it can take a mach-o cpu
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp