#
213f6727 |
| 07-Feb-2013 |
Andrew Kaylor <andrew.kaylor@intel.com> |
Fixing stale pointer problem in ELFObjectFile
llvm-svn: 174665
|
#
5ce9c565 |
| 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
<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.
llvm-svn: 174524
show more ...
|
#
c7bece56 |
| 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
<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.
llvm-svn: 173463
show more ...
|
Revision tags: llvmorg-3.2.0, llvmorg-3.2.0-rc3, llvmorg-3.2.0-rc2 |
|
#
d01b2953 |
| 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!
llvm-svn: 168945
|
Revision tags: llvmorg-3.2.0-rc1 |
|
#
d091afe6 |
| 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.
llvm-svn: 167773
|
#
23f59509 |
| 17-Jul-2012 |
Greg Clayton <gclayton@apple.com> |
Ran the static analyzer on the codebase and found a few things.
llvm-svn: 160338
|
#
5677536b |
| 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 onc
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.)
llvm-svn: 158188
show more ...
|
Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2, llvmorg-3.1.0-rc1 |
|
#
ed24dcc0 |
| 03-Apr-2012 |
Bill Wendling <isanbard@gmail.com> |
Use integers instead of NULL.
llvm-svn: 153941
|
#
741f3f9a |
| 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 section
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.
llvm-svn: 153537
show more ...
|
#
47037bc4 |
| 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
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.
llvm-svn: 153496
show more ...
|
#
e72dfb32 |
| 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
<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.
llvm-svn: 151336
show more ...
|
#
c9660546 |
| 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 "-
<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".
llvm-svn: 149804
show more ...
|
#
44435ed0 |
| 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 cu
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.
llvm-svn: 148017
show more ...
|
Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4, llvmorg-3.0.0-rc3, llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1 |
|
#
fd54b368 |
| 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
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.
llvm-svn: 140185
show more ...
|
#
9e00b6a6 |
| 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 gi
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.
llvm-svn: 134779
show more ...
|
#
b4aabeb8 |
| 03-Jun-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
Scan dynamic symbol table of ELF object files
llvm-svn: 132582
|
Revision tags: llvmorg-2.9.0 |
|
#
499b40e8 |
| 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 l
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.
llvm-svn: 128550
show more ...
|
Revision tags: llvmorg-2.9.0-rc3, llvmorg-2.9.0-rc2 |
|
#
e0d378b3 |
| 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 ne
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.
llvm-svn: 128239
show more ...
|
#
e996fd30 |
| 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
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.
llvm-svn: 127286
show more ...
|
Revision tags: llvmorg-2.9.0-rc1 |
|
#
d126c8cc |
| 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 se
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.
llvm-svn: 127218
show more ...
|
#
bd3f2606 |
| 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 al
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.
llvm-svn: 127205
show more ...
|
#
672e6f59 |
| 07-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
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.
llvm-svn: 127194
show more ...
|
#
3f4200fd |
| 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. Initi
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.
llvm-svn: 126405
show more ...
|
#
64195a2c |
| 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
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.
llvm-svn: 126278
show more ...
|
#
de049291 |
| 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.
llvm-svn: 125654
|