History log of /external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
52f792329be5db8e38961350589e97e8f2823acd 12-Jul-2013 Greg Clayton <gclayton@apple.com> Huge change to clean up types.

A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
5226e7dac92875aaf334591edc37f4a9893c352d 03-Jul-2013 Jim Ingham <jingham@apple.com> Workaround for infinite recursion in InitOSO->GetByteSize->GetSymbolVendor.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
00f42bb3118bbeb887692de8b852e2eee3a72c0a 27-Jun-2013 Enrico Granata <egranata@apple.com> Adding support for extracting line table information from .o files that do not have aranges



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
a8b56238ce138e70433a0ce0b4218c9257beae38 19-Jun-2013 Greg Clayton <gclayton@apple.com> Added the ability to get a list of types from a SBModule or SBCompileUnit. Sebastien Metrot wanted this, and sent a hollowed out patch. I filled in the blanks and did the low level implementation. The new functions are:

//------------------------------------------------------------------
/// Get all types matching \a type_mask from debug info in this
/// module.
///
/// @param[in] type_mask
/// A bitfield that consists of one or more bits logically OR'ed
/// together from the lldb::TypeClass enumeration. This allows
/// you to request only structure types, or only class, struct
/// and union types. Passing in lldb::eTypeClassAny will return
/// all types found in the debug information for this module.
///
/// @return
/// A list of types in this module that match \a type_mask
//------------------------------------------------------------------
lldb::SBTypeList
SBModule::GetTypes (uint32_t type_mask)


//------------------------------------------------------------------
/// Get all types matching \a type_mask from debug info in this
/// compile unit.
///
/// @param[in] type_mask
/// A bitfield that consists of one or more bits logically OR'ed
/// together from the lldb::TypeClass enumeration. This allows
/// you to request only structure types, or only class, struct
/// and union types. Passing in lldb::eTypeClassAny will return
/// all types found in the debug information for this compile
/// unit.
///
/// @return
/// A list of types in this compile unit that match \a type_mask
//------------------------------------------------------------------
lldb::SBTypeList
SBCompileUnit::GetTypes (uint32_t type_mask = lldb::eTypeClassAny);

This lets you request types by filling out a mask that contains one or more bits from the lldb::TypeClass enumerations, so you can only get the types you really want.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
53fde4be112df69d2b2f3d700b2556770f1223d5 22-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13455021>

Another fix to make sure that if we aren't able to extract an object file for any reason, we don't crash when trying to parse the debug map info.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
97a19b21dacd9063bb5475812df7781777262198 29-Apr-2013 Greg Clayton <gclayton@apple.com> Cleanup logging to use the new "std::string FileSpec::GetPath()" function. Also added a similar function for modules:

std::string
Module::GetSpecificationDescription () const;

This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
952e9dc874944fcdbbb224f3ec4fc2c859376f64 28-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13521159>

LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
9eead7dccf47e0dd97fa1283f91234ba0ab046ee 23-Mar-2013 Greg Clayton <gclayton@apple.com> Don't need to resolve the .o file path.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
d93d69d12049dc1c99e0c828509730ea3d9b1aaa 13-Mar-2013 Jim Ingham <jingham@apple.com> Add a missing check for getting a NULL oso module back from GetModuleByCompUnitInfo.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
d7d583f2e384a8d4d9c2fac0a10b812fd9fb0926 13-Mar-2013 Jim Ingham <jingham@apple.com> Add a missing call to GetFileRangeMap. It's absence was causing debug info from .o files to sometimes
not get processed.

<rdar://problem/13406310>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
c2fe09b1e9fb58e02b15dfc2a76dbbc9e9d36850 08-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13361742>

Don't resolve .o file locations when setting the file spec for each .o file in DWARF with debug map. We should trust the path.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
a48b8eb95e4217e6ba0e6b3c0c3a909811766d4b 07-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13362109>

LLDB was not parsing line tables correctly for DWARF in .o files after recent debug map changes. This has now been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
3cf7ab5462467121b4ac6cde09ee994030dad0c5 06-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/11109570>

The first part of the fix for having LLDB handle LTO debugging when the DWARF is in the .o files. This part separates the object file's modules into a separate cache map that maps unique C strings for the N_OSO path to the ModuleSP since one object file might be mentioned more than once in LTO binaries.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
0be3134ed957ca5e357caec8928bfe754a1f978e 05-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/12866706>

Removed asserts and replaced them with conditional code and appropriate errors that prompt for a bug to be filed.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
188091899842b140313b54e097f16efbe165c998 14-Dec-2012 Greg Clayton <gclayton@apple.com> Cleaned up the UUID mismatch just printing itself whenever it wants to by allowing an optional feedback stream to be passed along when getting the symbol vendor.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
b9db9d5bb01963774f28540dbe2c5a11f586ff29 07-Dec-2012 Daniel Malea <daniel.malea@intel.com> Fix a few more clang (3.2) warnings on Linux:
- remove unused members
- add NO_PEDANTIC to selected Makefiles
- fix return values (removed NULL as needed)
- disable warning about four-char-constants
- remove unneeded const from operator*() declaration
- add missing lambda function return types
- fix printf() with no format string
- change sizeof to use a type name instead of variable name
- fix Linux ProcessMonitor.cpp to be 32/64 bit friendly
- disable warnings emitted by swig-generated C++ code

Patch by Matt Kopec!



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
72a005e7ce67677d5180def2ae1c6bb65bd8129a 09-Oct-2012 Greg Clayton <gclayton@apple.com> Make DebugMapModule destructor virtual since it inherits from Module.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
49ce8969d3154e1560106cfe530444c09410f217 29-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11757916>

Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()

Cleaned up header includes a bit as well.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
77f281deb58ad655b36d6fee402730713cb985d0 17-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11852285>

Remove assertions and turn what used the be the assertion into a logged error with instructions on what to attach to a radar so we can track down why this is happening.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
78fa855f46e56858df335b2486900dc43e784166 07-Jul-2012 Sean Callanan <scallanan@apple.com> Fixed a crasher that happens if we try to inspect
a NULL symbol file.

<rdar://problem/11795939>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
cbff0fb344c17ef0699c1375f6ddeb5bcd1bdbe2 24-Apr-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11291668>

Fixed an issue that would happen when using debug map with DWARF in the .o files where we wouldn't ever track down the actual definition for a type when things were in namespaces. We now serialize the decl context information into an intermediate format which allows us to track down the correct definition for a type regardless of which DWARF symbol file it comes from. We do this by creating a "DWARFDeclContext" object that contains the DW_TAG + name for each item in a decl context which we can then use to veto potential accelerator table matches. For example, the accelerator tables store the basename of the type, so if you have "std::vector<int>", we would end up with an accelerator table entry for the type that contained "vector<int>", which we would then search for using a DWARFDeclContext object that contained:

[0] DW_TAG_class_type "vector<int>"
[1] DW_TAG_namespace "std"

This is currently used to track down forward declarations for things like "class a::b::Foo;".


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
fafffe000eb4a3902ecefc82446d11e6838167c6 13-Apr-2012 Sean Callanan <scallanan@apple.com> Added a mechanism for keeping track of where in
the debug information individual Decls came from.

We've had a metadata infrastructure for a while,
which was intended to solve a problem we've since
dealt with in a different way. (It was meant to
keep track of which definition of an Objective-C
class was the "true" definition, but we now find
it by searching the symbols for the class symbol.)
The metadata is attached to the ExternalASTSource,
which means it has a one-to-one correspondence with
AST contexts.

I've repurposed the metadata infrastructure to
hold the object file and DIE offset for the DWARF
information corresponding to a Decl. There are
methods in ClangASTContext that get and set this
metadata, and the ClangASTImporter is capable of
tracking down the metadata for Decls that have been
copied out of the debug information into the
parser's AST context without using any additional
memory.

To see the metadata, you just have to enable the
expression log:
-
(lldb) log enable lldb expr
-
and watch the import messages. The high 32 bits
of the metadata indicate the index of the object
file in its containing DWARFDebugMap; I have also
added a log which you can use to track that mapping:
-
(lldb) log enable dwarf map
-

This adds 64 bits per Decl, which in my testing
hasn't turned out to be very much (debugging Clang
produces around 6500 Decls in my tests). To track
how much data is being consumed, I've also added a
global variable g_TotalSizeOfMetadata which tracks
the total number of Decls that have metadata in all
active AST contexts.

Right now this metadata is enormously useful for
tracking down bugs in the debug info parser. In the
future I also want to use this information to provide
more intelligent error messages instead of printing
empty source lines wherever Clang refers to the
location where something is defined.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
0be1edd34ff46e017b1b973c5a57e3de9f613baf 03-Apr-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11160171>

Fixed an issue where there were more than one way to get a CompileUnitSP created when using SymbolFileDWARF with SymbolFileDWARFDebugMap. This led to an assertion that would fire under certain conditions. Now there is only one way to create the compile unit and it will "do the right thing".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
b4a2c82951272d19c50d973ed22e4eb286996864 24-Mar-2012 Sean Callanan <scallanan@apple.com> <rdar://problem/11101372>

We now reject binaries built with LTO and print
an error, rather than crashing later while trying
to parse them.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
0c31d3d3a4a1d00d53346d8a23b0519f47e55d1f 07-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10997402>

This fix really needed to happen as a previous fix I had submitted for
calculating symbol sizes made many symbols appear to have zero size since
the function that was calculating the symbol size was calling another function
that would cause the calculation to happen again. This resulted in some symbols
having zero size when they shouldn't. This could then cause infinite stack
traces and many other side affects.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
302d78c71902398ce1f422bd09216dd53a6abb88 10-Feb-2012 Sean Callanan <scallanan@apple.com> Extended function lookup to allow the user to
indicate whether inline functions are desired.
This allows the expression parser, for instance,
to filter out inlined functions when looking for
functions it can call.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
13d24fb1817faa7ccc4cfd799113ba1a2b8968eb 29-Jan-2012 Greg Clayton <gclayton@apple.com> Switching back to using std::tr1::shared_ptr. We originally switched away
due to RTTI worries since llvm and clang don't use RTTI, but I was able to
switch back with no issues as far as I can tell. Once the RTTI issue wasn't
an issue, we were looking for a way to properly track weak pointers to objects
to solve some of the threading issues we have been running into which naturally
led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared
pointer from just a pointer, which is also easily solved using the
std::tr1::enable_shared_from_this class.

The main reason for this move back is so we can start properly having weak
references to objects. Currently a lldb_private::Thread class has a refrence
to its parent lldb_private::Process. This doesn't work well when we now hand
out a SBThread object that contains a shared pointer to a lldb_private::Thread
as this SBThread can be held onto by external clients and if they end up
using one of these objects we can easily crash.

So the next task is to start adopting std::tr1::weak_ptr where ever it makes
sense which we can do with lldb_private::Debugger, lldb_private::Target,
lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and
many more objects now that they are no longer using intrusive ref counted
pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive
pointers).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
3fc0c4f12b19f1e2bd276d2b6eb0fdd096a01414 28-Jan-2012 Greg Clayton <gclayton@apple.com> Adding the DWARF parser side for assited layout where the AST context
will ask ExternalASTSource objects to help laying out a type. This is needed
because the DWARF typically doesn't contain alignement or packing attribute
values, and we need to be able to match up types that the compiler uses
in expressions.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
e6b976d3f1c42f18c85c87cb179954af7df5a542 12-Jan-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10681814>

Fix DWARF parsing issue we can run into when using llvm-gcc based dSYM files.

Also fix the parsing of objective C built-in types (Class, id and SEL) so
they don't parse more information that is not needed due to the way they
are represented in DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
281700b2216e6b2aa7b09023e427130de473e3d9 12-Jan-2012 Jim Ingham <jingham@apple.com> Don't dereference the oso_dwarf without checking for NULL.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
77917228890a15d40ec6dd28c5865dd1b7895053 03-Dec-2011 Greg Clayton <gclayton@apple.com> Added code to make sure we don't recursively try to find an objective C
class. The thing with Objective C classes is the debug info might have a
definition that isn't just a forward decl, but it is incomplete. So we need to
look and see if we can find the complete definition and avoid recursing a lot
due to the fact that our accelerator tables will have many versions of the
type, but only one complete one. We might not also have the complete type
and we need to deal with this correctly.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
d0b7cfa22722fdaf4111a61d6eeb02a587710e16 03-Dec-2011 Sean Callanan <scallanan@apple.com> Testcase fixes with the new symbol lookup code for
Objective-C, making symbol lookups for various raw
Objective-C symbols work correctly. The IR interpreter
makes these lookups because Clang has emitted raw
symbol references for ivars and classes.

Also improved performance in SymbolFiles, caching the
result of asking for SymbolFile abilities.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
a1b9a90b7aef446302de9b845dc4f3b0e1473aa7 13-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10338439>

This is the actual fix for the above radar where global variables that weren't
initialized were not being shown correctly when leaving the DWARF in the .o
files. Global variables that aren't intialized have symbols in the .o files
that specify they are undefined and external to the .o file, yet document the
size of the variable. This allows the compiler to emit a single copy, but makes
it harder for our DWARF in .o files with the executable having a debug map
because the symbol for the global in the .o file doesn't exist in a section
that we can assign a fixed up linked address to, and also the DWARF contains
an invalid address in the "DW_OP_addr" location (always zero). This means that
the DWARF is incorrect and actually maps all such global varaibles to the
first file address in the .o file which is usually the first function. So we
can fix this in either of two ways: make a new fake section in the .o file
so that we have a file address in the .o file that we can relink, or fix the
the variable as it is created in the .o file DWARF parser and actually give it
the file address from the executable. Each variable contains a
SymbolContextScope, or a single pointer that helps us to recreate where the
variables came from (which module, file, function, etc). This context helps
us to resolve any file addresses that might be in the location description of
the variable by pointing us to which file the file address comes from, so we
can just replace the SymbolContextScope and also fix up the location, which we
would have had to do for the other case as well, and update the file address.
Now globals display correctly.

The above changes made it possible to determine if a variable is a global
or static variable when parsing DWARF. The DWARF emits a DW_TAG_variable tag
for each variable (local, global, or static), yet DWARF provides no way for
us to classify these variables into these categories. We can now detect when
a variable has a simple address expressions as its location and this will help
us classify these correctly.

While making the above changes I also noticed that we had two symbol types:
eSymbolTypeExtern and eSymbolTypeUndefined which mean essentially the same
thing: the symbol is not defined in the current object file. Symbol objects
also have a bit that specifies if a symbol is externally visible, so I got
rid of the eSymbolTypeExtern symbol type and moved all code locations that
used it to use the eSymbolTypeUndefined type.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
8688673d87d41f54841907aefd9b8edd814d8ab5 10-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10338439>

Fixed an issue where if you had an initialized global variable, we would not
link it up correctly in the debug info if the .o file had the symbols as
UNDF + EXT (undefined external). We now properly link the globals.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
0fcec13c6639ab49216fa9447b25888b7bc9ff59 13-Oct-2011 Sean Callanan <scallanan@apple.com> Completed the glue that passes a ClangNamespaceDecl *
down through Module and SymbolVendor into SymbolFile.
Added checks to SymbolFileDWARF that restrict symbol
searches when a namespace is passed in.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
e40b6424d9e49306392bec4b44060da36414c382 18-Sep-2011 Greg Clayton <gclayton@apple.com> Don't put modules for .o files into the global shared module list. We
used to do this because we needed to find the shared pointer for a .o
file when the .o file's module was needed in a SymbolContext since the
module in a symbol context was a shared pointer. Now that we are using
intrusive pointers we don't have this limitation anymore since any
instrusive shared pointer can be made from a pointer to an object
all on its own.

Also switched over to having the Module and SymbolVendor use shared
pointers to their object files as had a leak on MacOSX when the
SymbolVendor's object file wasn't the same as the Module's (debug info
in a stand along file (dSYM file)). Now everything will correctly clean
itself up when the module goes away after an executable gets rebuilt.

Now we correctly get rid of .o files that are used with the DWARF with
debug map executables on subsequent runs since the only shared pointer
to the object files in from the DWARF symbol file debug map parser, and
when the module gets replaced, it destroys to old one along with all .o
files.

Also added a small optimization when using BSD archives where we will
remove old BSD containers from the shared list when they are outdated.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
02e210cad27e36108bef493b798c2c1eb3b04cb8 17-Sep-2011 Greg Clayton <gclayton@apple.com> Removed the function:

ModuleSP
Module::GetSP();

Since we are now using intrusive ref counts, we can easily turn any
pointer to a module into a shared pointer just by assigning it.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
144188bc458a35997d2f2e52206ab69747439073 13-Sep-2011 Greg Clayton <gclayton@apple.com> Huge memory and performance improvements in the DWARF parser.

Address ranges are now split up into two different tables:
- one in DWARFDebugInfo that is compile unit specific
- one in each DWARFCompileUnit that has exact function DIE offsets

This helps keep the size of the aranges down since the main table will get
uniqued and sorted and have consecutive ranges merged. We then only parse the
compile unit one on demand once we have determined that a compile unit contains
the address in question. We also now use the .debug_aranges section if there
is one instead of always indexing the DWARF manually.

NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map.
std::map is very bulky as each node has 3 pointers and the key and value types.
This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves
us a lot of memory when we have very large DWARF.

DWARFDebugAranges now has a smaller footprint for each range it contains to
save on memory.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
e6d72ca9a6b22cd062136bbff039c3d8217f798a 25-Jun-2011 Greg Clayton <gclayton@apple.com> This commit adds broad architectural support for hierarchical
inspection of namespaces in the expression parser.

ClangExpressionDeclMap hitherto reported that namespaces had
been completely imported, even though the namespaces are
returned empty. To deal with this situation, ClangASTSource
was recently extended with an API to complete incomplete type
definitions, and, for greater efficiency, to complete these
definitions partially, returning only those objects that have
a given name.

This commit supports these APIs on LLDB's side, and uses it
to provide information on types resident in namespaces.
Namespaces are now imported as they were -- that is to say,
empty -- but with minimal import mode on. This means that
Clang will come back and request their contents by name as
needed. We now respond with information on the contained
types; this will be followed soon by information on functions
and variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
4fdf7602bedd8be648f3c549074cf13d90a05f03 20-Mar-2011 Greg Clayton <gclayton@apple.com> Split all of the core of LLDB.framework/lldb.so into a
static archive that can be linked against. LLDB.framework/lldb.so
exports a very controlled API. Splitting the API into a static
library allows other tools (debugserver for now) to use the power
of the LLDB debugger core, yet not export it as its API is not
portable or maintainable. The Host layer and many of the other
internal only APIs can now be statically linked against.

Now LLDB.framework/lldb.so links against "liblldb-core.a" instead
of compiling the .o files only for the shared library. This fix
is only for compiling with Xcode as the Makefile based build already
does this.

The Xcode projecdt compiler has been changed to LLVM. Anyone using
Xcode 3 will need to manually change the compiler back to GCC 4.2,
or update to Xcode 4.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
dd506e1674073ea3eaec680d5a87d5589ea08362 15-Mar-2011 Greg Clayton <gclayton@apple.com> Added a fix to not re-use object files when doing DWARF with debug map.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
e84d4fdf7f8c8112698c64e824068e1b416eeb9f 08-Mar-2011 Jim Ingham <jingham@apple.com> Reverting the part of the debug-in-ofile patch from earlier today that removes them from the shared module list. That was causing a bunch of asserts. Greg is working on a better fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
2cd9418446c2f8dc83e0ade35a4b313cbe072a36 07-Mar-2011 Greg Clayton <gclayton@apple.com> Don't cache .o files in the debug map + DWARF in .o files. If we cache them
then we end up using older .o files with out of date section remappings if
we debug, compile + fix, and debug again.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
3c12604d5773abb8973e06a006ac460be9e426ea 08-Feb-2011 Greg Clayton <gclayton@apple.com> Fixed a crasher that could happen when trying to look at N_GSYM entries
in the DWARF + debug map symbol file parser.

Also cleaned up the "image lookup --address ADDR" output when we it results
in something that is in an inlined function. Now we correctly dump out the
full inlined call stack.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
cd151697a4b4d32d8818488b793ea44712945448 20-Jan-2011 Greg Clayton <gclayton@apple.com> Made the DWARF + debug map symbol file parser be much more efficient when it isn't
going to actually be used as the symbol file plug-in by looking only for suitable
N_OSO symbols and avoiding sorting function (N_FUN) and global/static (N_GSYM/N_STSYM)
symbols when there are no suitable N_OSO objects.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
b01000fd063629facd45044f137446fb748ee179 17-Jan-2011 Greg Clayton <gclayton@apple.com> A few of the issue I have been trying to track down and fix have been due to
the way LLDB lazily gets complete definitions for types within the debug info.
When we run across a class/struct/union definition in the DWARF, we will only
parse the full definition if we need to. This works fine for top level types
that are assigned directly to variables and arguments, but when we have a
variable with a class, lets say "A" for this example, that has a member:
"B *m_b". Initially we don't need to hunt down a definition for this class
unless we are ever asked to do something with it ("expr m_b->getDecl()" for
example). With my previous approach to lazy type completion, we would be able
to take a "A *a" and get a complete type for it, but we wouldn't be able to
then do an "a->m_b->getDecl()" unless we always expanded all types within a
class prior to handing out the type. Expanding everything is very costly and
it would be great if there were a better way.

A few months ago I worked with the llvm/clang folks to have the
ExternalASTSource class be able to complete classes if there weren't completed
yet:

class ExternalASTSource {
....

virtual void
CompleteType (clang::TagDecl *Tag);

virtual void
CompleteType (clang::ObjCInterfaceDecl *Class);
};

This was great, because we can now have the class that is producing the AST
(SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources
and the object that creates the forward declaration types can now also
complete them anywhere within the clang type system.

This patch makes a few major changes:
- lldb_private::Module classes now own the AST context. Previously the TypeList
objects did.
- The DWARF parsers now sign up as an external AST sources so they can complete
types.
- All of the pure clang type system wrapper code we have in LLDB (ClangASTContext,
ClangASTType, and more) can now be iterating through children of any type,
and if a class/union/struct type (clang::RecordType or ObjC interface)
is found that is incomplete, we can ask the AST to get the definition.
- The SymbolFileDWARFDebugMap class now will create and use a single AST that
all child SymbolFileDWARF classes will share (much like what happens when
we have a complete linked DWARF for an executable).

We will need to modify some of the ClangUserExpression code to take more
advantage of this completion ability in the near future. Meanwhile we should
be better off now that we can be accessing any children of variables through
pointers and always be able to resolve the clang type if needed.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
e4b9df004d1fdd6ae10c9492fa0f504442829a10 13-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where we might not find global variables by name when we have
a debug map with DWARF in the .o files due to the attemted shortcut that was
being taken where the global variables were being searched for by looking in
the symbol table. The problem with the symbols in the symbol table is we don't
break apart the symbol names for symbols when they are mangled into basename
and the fully mangled name since this would take a lot of CPU time to chop up
the mangled names and try and find the basenames. The DWARF info typically has
this broken up for us where the basename of the variable is in a the DW_AT_name
attribute, and the mangled name is in the DW_AT_MIPS_linkage_name attribute.
Now we correctly find globals by searching all OSO's for the information so we
can take advantage of this split information.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
6916e358c9725b75ed91f31236c147f26c9af10e 13-Nov-2010 Greg Clayton <gclayton@apple.com> Modified the lldb_private::Type clang type resolving code to handle three
cases when getting the clang type:
- need only a forward declaration
- need a clang type that can be used for layout (members and args/return types)
- need a full clang type

This allows us to partially parse the clang types and be as lazy as possible.
The first case is when we just need to declare a type and we will complete it
later. The forward declaration happens only for class/union/structs and enums.
The layout type allows us to resolve the full clang type _except_ if we have
any modifiers on a pointer or reference (both R and L value). In this case
when we are adding members or function args or return types, we only need to
know how the type will be laid out and we can defer completing the pointee
type until we later need it. The last type means we need a full definition for
the clang type.

Did some renaming of some enumerations to get rid of the old "DC" prefix (which
stands for DebugCore which is no longer around).

Modified the clang namespace support to be almost ready to be fed to the
expression parser. I made a new ClangNamespaceDecl class that can carry around
the AST and the namespace decl so we can copy it into the expression AST. I
modified the symbol vendor and symbol file plug-ins to use this new class.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
d7cb26e87841731c6452a9f2e997ed0f9c92625c 11-Nov-2010 Greg Clayton <gclayton@apple.com> Added initial support to the lldb_private::SymbolFile for finding
namespaces by name given an optional symbol context. I might end up
dressing up the "clang::NamespaceDecl" into a lldb_private::Namespace
class if we need to do more than is currenlty required of namespaces.
Currently we only need to be able to lookup a namespace by name when
parsing expressions, so I kept it simple for now. The idea here is
even though we are passing around a "clang::NamespaceDecl *", that
we always have it be an opaque pointer (it is forward declared inside
of "lldb/Core/ClangForward.h") and we only use clang::NamespaceDecl
implementations inside of ClangASTContext, or ClangASTType when we need
to extract information from the namespace decl object.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
e98ac25604b3d967158917f6fdd5289b3096fd80 10-Nov-2010 Greg Clayton <gclayton@apple.com> Modified lldb_private::SymboleFile to be able to override where its TypeList
comes from by using a virtual function to provide it from the Module's
SymbolVendor by default. This allows the DWARF parser, when being used to
parse DWARF in .o files with a parent DWARF + debug map parser, to get its
type list from the DWARF + debug map parser so when we go and find full
definitions for types (that might come from other .o files), we can use the
type list from the debug map parser. Otherwise we ended up mixing clang types
from one .o file (say a const pointer to a forward declaration "class A") with
the a full type from another .o file. This causes expression parsing, when
copying the clang types from those parsed by the DWARF parser into the
expression AST, to fail -- for good reason. Now all types are created in the
same list.

Also added host support for crash description strings that can be set before
doing a piece of work. On MacOSX, this ties in with CrashReporter support
that allows a string to be dispalyed when the app crashes and allows
LLDB.framework to print a description string in the crash log. Right now this
is hookup up the the CommandInterpreter::HandleCommand() where each command
notes that it is about to be executed, so if we crash while trying to do this
command, we should be able to see the command that caused LLDB to exit. For
all other platforms, this is a nop.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
95e33b7b4b832ff5a8dfd0720fe6a100be894df6 07-Nov-2010 Greg Clayton <gclayton@apple.com> Modified the DWARF parser for both the single DWARF file and for the case
where the DWARF is in the .o files so they can track down the actual type for
a forward declaration. This was working before for just DWARF files, but not
for DWARF in .o files where the actual definition was in another .o file.

Modified the main thread name in the driver to be more consistent with the
other LLDB thread names.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
462d4147f3bb9141bf62d904f58a623db00669df 29-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed the forward declaration issue that was present in the DWARF parser after
adding methods to C++ and objective C classes. In order to make methods, we
need the function prototype which means we need the arguments. Parsing these
could cause a circular reference that caused an assertion.

Added a new typedef for the clang opaque types which are just void pointers:
lldb::clang_type_t. This appears in lldb-types.h.

This was fixed by enabling struct, union, class, and enum types to only get
a forward declaration when we make the clang opaque qual type for these
types. When they need to actually be resolved, lldb_private::Type will call
a new function in the SymbolFile protocol to resolve a clang type when it is
not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows
us to be a lot more lazy when parsing clang types and keeps down the amount
of data that gets parsed into the ASTContext for each module.

Getting the clang type from a "lldb_private::Type" object now takes a boolean
that indicates if a forward declaration is ok:

clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok);

So function prototypes that define parameters that are "const T&" can now just
parse the forward declaration for type 'T' and we avoid circular references in
the type system.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
1924e2408687e0ee41976010c6b9410bdd01270d 15-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed a missing newline when dumping mixed disassembly.

Added a "bool show_fullpaths" to many more objects that were
previously always dumping full paths.

Fixed a few places where the DWARF was not indexed when we
we needed it to be when making queries. Also fixed an issue
where the DWARF in .o files wasn't searching all .o files
for the types.

Fixed an issue with the output from "image lookup --type <TYPENAME>"
where the name and byte size might not be resolved and might not
display. We now call the accessors so we end up seeing all of the
type info.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.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/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
7c36fa07bc2c2c7efc4a28ad540f7711491f379d 11-Sep-2010 Greg Clayton <gclayton@apple.com> Remove the eSymbolTypeFunction, eSymbolTypeGlobal, and eSymbolTypeStatic.
They will now be represented as:
eSymbolTypeFunction: eSymbolTypeCode with IsDebug() == true
eSymbolTypeGlobal: eSymbolTypeData with IsDebug() == true and IsExternal() == true
eSymbolTypeStatic: eSymbolTypeData with IsDebug() == true and IsExternal() == false

This simplifies the logic when dealing with symbols and allows for symbols
to be coalesced into a single symbol most of the time.

Enabled the minimal symbol table for mach-o again after working out all the
kinks. We now get nice concise symbol tables and debugging with DWARF in the
.o files with a debug map in the binary works well again. There were issues
where the SymbolFileDWARFDebugMap symbol file parser was using symbol IDs and
symbol indexes interchangeably. Now that all those issues are resolved
debugging is working nicely.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
88957ff55a292dd6fc050453bccd17b7c8bc3fd5 18-Aug-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where we would return matches for DWARF in the .o files when
the resulting function from the .o file DWARF didn't make it into the final
executable. I recently changed the way FindFunctions() worked in the DWARF
with debug map case that caused regressions in our test suite for dead
stripped functions. The previous changes allowed us to leverage the powerful
searching added to the DWARF parser (search by full name, basename, selector,
or method name), without having to chop up the symbol names from the symbol
table and do any special parsing of the names to extract the basename,
selector or method. Previously we would look through the symbol table for
matches first, then try and find the .o file with DWARF for that symbol and
only search those .o files. Now we let the DWARF for the .o file search using
the new search styles, and filter out any functions that didn't make it.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
7241ba77d41c1a2f43552d676a0fb3d0113a9cef 17-Aug-2010 Greg Clayton <gclayton@apple.com> Fixed FindFunctions so it works with all the new name types for the DWARF in object files case.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
960d6a40711f05effe6fcc5b66f0952450f79ea2 03-Aug-2010 Greg Clayton <gclayton@apple.com> Added support for objective C built-in types: id, Class, and SEL. This
involved watching for the objective C built-in types in DWARF and making sure
when we convert the DWARF types into clang types that we use the appropriate
ASTContext types.

Added a way to find and dump types in lldb (something equivalent to gdb's
"ptype" command):

image lookup --type <TYPENAME>

This only works for looking up types by name and won't work with variables.
It also currently dumps out verbose internal information. I will modify it
to dump more appropriate user level info in my next submission.

Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so
we can lookup types by name in one or more images.

Fixed "image lookup --address <ADDRESS>" to be able to correctly show all
symbol context information, but it will only show this extra information when
the new "--verbose" flag is used.

Updated to latest LLVM to get a few needed fixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
9488b7423b556c7c777b721d2094fd5ec4a47578 28-Jul-2010 Greg Clayton <gclayton@apple.com> Created lldb::LanguageType by moving an enumeration from the
lldb_private::Language class into the enumerations header so it can be freely
used by other interfaces.

Added correct objective C class support to the DWARF symbol parser. Prior to
this fix we were parsing objective C classes as C++ classes and now that the
expression parser is ready to call functions we need to make sure the objective
C classes have correct AST types.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
12bec71b323dc520f0e985a86e09c4712559e115 28-Jun-2010 Greg Clayton <gclayton@apple.com> Added function name types to allow us to set breakpoints by name more
intelligently. The four name types we currently have are:

eFunctionNameTypeFull = (1 << 1), // The function name.
// For C this is the same as just the name of the function
// For C++ this is the demangled version of the mangled name.
// For ObjC this is the full function signature with the + or
// - and the square brackets and the class and selector
eFunctionNameTypeBase = (1 << 2), // The function name only, no namespaces or arguments and no class
// methods or selectors will be searched.
eFunctionNameTypeMethod = (1 << 3), // Find function by method name (C++) with no namespace or arguments
eFunctionNameTypeSelector = (1 << 4) // Find function by selector name (ObjC) names


this allows much more flexibility when setting breakoints:

(lldb) breakpoint set --name main --basename
(lldb) breakpoint set --name main --fullname
(lldb) breakpoint set --name main --method
(lldb) breakpoint set --name main --selector

The default:

(lldb) breakpoint set --name main

will inspect the name "main" and look for any parens, or if the name starts
with "-[" or "+[" and if any are found then a full name search will happen.
Else a basename search will be the default.

Fixed some command option structures so not all options are required when they
shouldn't be.

Cleaned up the breakpoint output summary.

Made the "image lookup --address <addr>" output much more verbose so it shows
all the important symbol context results. Added a GetDescription method to
many of the SymbolContext objects for the more verbose output.





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