History log of /external/lldb/source/Core/Section.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/Core/Section.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/Core/Section.cpp
77e67a51acb825d79d25be687c085833713d5205 19-Jun-2013 Greg Clayton <gclayton@apple.com> Implemented a types.py module that allows types to be inspected for padding.

The script was able to point out and save 40 bytes in each lldb_private::Section by being very careful where we need to have virtual destructors and also by re-ordering members.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.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/Core/Section.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/Core/Section.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/Core/Section.cpp
3a98c894078535cccaffbd489020822411e56873 11-Oct-2012 Greg Clayton <gclayton@apple.com> Fixed an indentation issue that only shows up when dumping .o files that use linked addresses (DWARF in .o files with debug map).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
7e26fd3a14ce4507ce8db8d30f056cdfb1c3c4ab 12-Jul-2012 Sean Callanan <scallanan@apple.com> Added a check to the Section to make sure we don't
return sections that don't have valid modules.

<rdar://problem/11605824>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
545762f7780bece4e9255e052c0a50a1ea66ce57 07-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11357711>

Fixed a crasher where the section load list was not thread safe.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.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/Core/Section.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/Core/Section.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/Core/Section.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/Core/Section.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/Core/Section.cpp
4b23ab33d221eaadf40f65a5b5fe3ca4475ff761 06-Jan-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10652336>

Fixed a crasher when trying to load an expression prefix file:

% touch /tmp/carp.txt
% xcrun lldb
(lldb) settings set target.expr-prefix /tmp/carp.txt
Segmentation fault



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
444e35b5fdf15a25a427285650f06f1390e62c75 19-Oct-2011 Greg Clayton <gclayton@apple.com> Moved lldb::user_id_t values to be 64 bit. This was going to be needed for
process IDs, and thread IDs, but was mainly needed for for the UserID's for
Types so that DWARF with debug map can work flawlessly. With DWARF in .o files
the type ID was the DIE offset in the DWARF for the .o file which is not
unique across all .o files, so now the SymbolFileDWARFDebugMap class will
make the .o file index part (the high 32 bits) of the unique type identifier
so it can uniquely identify the types.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
37f962e785be99dc4f0c5e9d02416992ff03bbd0 22-Aug-2011 Greg Clayton <gclayton@apple.com> Added a new plug-in type: lldb_private::OperatingSystem. The operating system
plug-ins are add on plug-ins for the lldb_private::Process class that can add
thread contexts that are read from memory. It is common in kernels to have
a lot of threads that are not currently executing on any cores (JTAG debugging
also follows this sort of thing) and are context switched out whose state is
stored in memory data structures. Clients can now subclass the OperatingSystem
plug-ins and then make sure their Create functions correcltly only enable
themselves when the right binary/target triple are being debugged. The
operating system plug-ins get a chance to attach themselves to processes just
after launching or attaching and are given a lldb_private::Process object
pointer which can be inspected to see if the main executable, target triple,
or any shared libraries match a case where the OS plug-in should be used.
Currently the OS plug-ins can create new threads, define the register contexts
for these threads (which can all be different if desired), and populate and
manage the thread info (stop reason, registers in the register context) as
the debug session goes on.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
801417e453f8531ac176cd952200587bf15d9ccf 07-Jul-2011 Greg Clayton <gclayton@apple.com> Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get
section data correctly filled with zeroes when Target::ReadMemory
reads from the object file section data.

Added new option groups and option values for file lists. I still need
to hook up all of the options to "target variable" to allow more complete
introspection by file and shlib.

Added the ability for ValueObjectVariable objects to be created with
only the target as the execution context. This allows them to be read
from the object files through Target::ReadMemory(...).

Added a "virtual Module * GetModule()" function to the ValueObject
class. By default it will look to the parent variable object and
return its module. The module is needed when we have global variables
that have file addresses (virtual addresses that are specific to
module object files) and in turn allows global variables to be displayed
prior to running.

Removed all of the unused proxy object support that bit rotted in
lldb_private::Value.

Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
with the more efficient "FileSpec::Equal (lhs, rhs)".

Improved logging in GDB remote plug-in.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.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/Core/Section.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/Core/Section.cpp
42c8fdc8acdcbc06bb019c7151025b8b60a34ace 07-Dec-2010 Greg Clayton <gclayton@apple.com> Improved the "image dump section" command output by making sure
it indents and shows things correctly. When we are debugging DWARF
in .o files with debug map, we can see the remapped sections by
dumping the sections for the .o files by explicitly dumping the
module by name. For example, debugging the lldb/test/class_types
example on MacOSX without a dSYM file we can make a query that
causes the main.o file to be loaded, then we can do a:

(lldb) image dump section main.o

This will show the exact section map that is used and can help
track down when things are going wrong with DWARF in .o files with
debug map.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
9d972a4057f2e72a004b5ab70e12cfdc78fd8cba 07-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed an issue when debugging with DWARF in the .o files where
if two functions had the same demangled names (constructors where
we have the in charge and not in charge version) we could end up
mixing the two up when making the function in the DWARF. This was
because we need to lookup the symbol by name and we need to use the
mangled name if there is one. This ensures we get the correct address
and that we resolve the linked addresses correctly for DWARf with debug
map.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
f3d0b0c8081691128626eb496fdfcbf8ae54c1de 27-Oct-2010 Greg Clayton <gclayton@apple.com> Updated the lldb_private::Flags class to have better method names and made
all of the calls inlined in the header file for better performance.

Fixed the summary for C string types (array of chars (with any combo if
modifiers), and pointers to chars) work in all cases.

Fixed an issue where a forward declaration to a clang type could cause itself
to resolve itself more than once if, during the resolving of the type itself
it caused something to try and resolve itself again. We now remove the clang
type from the forward declaration map in the DWARF parser when we start to
resolve it and avoid this additional call. This should stop any duplicate
members from appearing and throwing all the alignment of structs, unions and
classes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
3fed8b9b2696fc2ea78005c8f9b1c621d5748042 08-Oct-2010 Greg Clayton <gclayton@apple.com> Hooked up ability to look up data symbols so they show up in disassembly
if the address comes from a data section.

Fixed an issue that could occur when looking up a symbol that has a zero
byte size where no match would be returned even if there was an exact symbol
match.

Cleaned up the section dump output and added the section type into the output.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
eea264007bc5fb42c8f3239726a9d28ae42e1b7b 15-Sep-2010 Greg Clayton <gclayton@apple.com> Moved the section load list up into the target so we can use the target
to symbolicate things without the need for a valid process subclass.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
178710cd4307f3d44dc76ebd70fc7daf7ebe17c5 14-Sep-2010 Greg Clayton <gclayton@apple.com> Looking at some of the test suite failures in DWARF in .o files with the
debug map showed that the location lists in the .o files needed some
refactoring in order to work. The case that was failing was where a function
that was in the "__TEXT.__textcoal_nt" in the .o file, and in the
"__TEXT.__text" section in the main executable. This made symbol lookup fail
due to the way we were finding a real address in the debug map which was
by finding the section that the function was in in the .o file and trying to
find this in the main executable. Now the section list supports finding a
linked address in a section or any child sections. After fixing this, we ran
into issue that were due to DWARF and how it represents locations lists.
DWARF makes a list of address ranges and expressions that go along with those
address ranges. The location addresses are expressed in terms of a compile
unit address + offset. This works fine as long as nothing moves around. When
stuff moves around and offsets change between the remapped compile unit base
address and the new function address, then we can run into trouble. To deal
with this, we now store supply a location list slide amount to any location
list expressions that will allow us to make the location list addresses into
zero based offsets from the object that owns the location list (always a
function in our case).

With these fixes we can now re-link random address ranges inside the debugger
for use with our DWARF + debug map, incremental linking, and more.

Another issue that arose when doing the DWARF in the .o files was that GCC
4.2 emits a ".debug_aranges" that only mentions functions that are externally
visible. This makes .debug_aranges useless to us and we now generate a real
address range lookup table in the DWARF parser at the same time as we index
the name tables (that are needed because .debug_pubnames is just as useless).
llvm-gcc doesn't generate a .debug_aranges section, though this could be
fixed, we aren't going to rely upon it.

Renamed a bunch of "UINT_MAX" to "UINT32_MAX".



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.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/Core/Section.cpp
15be8eddf3a2f9aff328197822ad8f338f96232b 21-Jul-2010 Greg Clayton <gclayton@apple.com> Allow searching for a section by SectionType.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
704363531ee4877ccc6d35d0702876096f54c67b 01-Jul-2010 Greg Clayton <gclayton@apple.com> Centralized all disassembly into static functions in source/Core/Disassembler.cpp.

Added the ability to read memory from the target's object files when we aren't
running, so disassembling works before you run!

Cleaned up the API to lldb_private::Target::ReadMemory().

Cleaned up the API to the Disassembler to use actual "lldb_private::Address"
objects instead of just an "addr_t". This is nice because the Address objects
when resolved carry along their section and module which can get us the
object file. This allows Target::ReadMemory to be used when we are not
running.

Added a new lldb_private::Address dump style: DumpStyleDetailedSymbolContext
This will show a full breakdown of what an address points to. To see some
sample output, execute a "image lookup --address <addr>".

Fixed SymbolContext::DumpStopContext(...) to not require a live process in
order to be able to print function and symbol offsets.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.cpp
661825b68e95abdfab2c7242c0d515e8260d1431 29-Jun-2010 Greg Clayton <gclayton@apple.com> Fixed debug map in executable + DWARF in .o debugging on Mac OS X.

Added the ability to dump any file in the global module cache using any of
the "image dump" commands. This allows us to dump the .o files that are used
with DWARF + .o since they don't belong the the target list for the current
target.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Core/Section.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/Core/Section.cpp