llvm-project/lldb/source/Plugins/SymbolFile/DWARF
Sean Callanan 60217120b5 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.

llvm-svn: 154634
2012-04-13 00:10:03 +00:00
..
DWARFAbbreviationDeclaration.cpp
DWARFAbbreviationDeclaration.h 15-20% speed improvement when parsing DWARF. I used instruments to 2010-09-15 08:33:30 +00:00
DWARFAttribute.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFCompileUnit.cpp Fixed an issue with the Instruction subclasses where the strings might 2012-01-19 03:24:53 +00:00
DWARFCompileUnit.h <rdar://problem/10681814> 2012-01-12 04:33:28 +00:00
DWARFDIECollection.cpp Fixed an issue where if a method funciton was asked to be parsed before 2010-10-01 20:48:32 +00:00
DWARFDIECollection.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFDebugAbbrev.cpp Spelling changes applied from lldb_spelling.diffs from Bruce Mitchener. 2011-01-08 20:28:42 +00:00
DWARFDebugAbbrev.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFDebugArangeSet.cpp
DWARFDebugArangeSet.h Since we use address ranges a lot I added a templatized class that allows us to easily control the base address type, the size type, and the data that is stored with each range. It is designed to be populated by appending all needed items, then sorting the resulting list, and optionally minimizing the list when done. I adopted this new list in the DWARFDebugAranges for even further memory savings. 2011-10-07 03:58:56 +00:00
DWARFDebugAranges.cpp Added more functionality to Range template classes in RangeMap.h and converted remaining DWARF areas that were using ranges over to this class. Also converted lldb_private::Block to use it. 2011-10-08 00:49:15 +00:00
DWARFDebugAranges.h Changed RangeMap over to use llvm::SmallVector and updated the RangeArray and the RangeDataArray to have an extra "unsigned N" template parameter. Updated the lldb_private::Block to use a RangeArray with a uint32_t for both the function base offset and block range size, and then a 1 for the small vector size since most lexical blocks in DWARF only have 1 range. Updates the DWARFDebugRanges RangeArray to use an unsigned of 2 since most blocks that have more than one range usually have 2. Also updated a DWARFDebugAranges to default their RangeArray to use a SmallVector with unsigned size of 1 since this will take care of the .o files when doing DWARF in .o files and since there really isn't any good size we can guess with. 2011-10-08 06:59:54 +00:00
DWARFDebugInfo.cpp Since we use address ranges a lot I added a templatized class that allows us to easily control the base address type, the size type, and the data that is stored with each range. It is designed to be populated by appending all needed items, then sorting the resulting list, and optionally minimizing the list when done. I adopted this new list in the DWARFDebugAranges for even further memory savings. 2011-10-07 03:58:56 +00:00
DWARFDebugInfo.h <rdar://problem/10434005> 2012-03-14 03:07:05 +00:00
DWARFDebugInfoEntry.cpp Fixed an issue where we might accept the wrong type when completing 2012-02-02 05:48:16 +00:00
DWARFDebugInfoEntry.h Fixed an issue where we might accept the wrong type when completing 2012-02-02 05:48:16 +00:00
DWARFDebugLine.cpp <rdar://problem/11072382> 2012-03-19 22:22:41 +00:00
DWARFDebugLine.h <rdar://problem/8196933> 2012-03-15 21:01:31 +00:00
DWARFDebugMacinfo.cpp
DWARFDebugMacinfo.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFDebugMacinfoEntry.cpp Update declarations for all functions/methods that accept printf-style 2011-09-20 21:44:10 +00:00
DWARFDebugMacinfoEntry.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFDebugPubnames.cpp Added a new logging channel to the DWARF called "lookups": 2011-10-06 00:09:08 +00:00
DWARFDebugPubnames.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFDebugPubnamesSet.cpp
DWARFDebugPubnamesSet.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFDebugRanges.cpp Added more functionality to Range template classes in RangeMap.h and converted remaining DWARF areas that were using ranges over to this class. Also converted lldb_private::Block to use it. 2011-10-08 00:49:15 +00:00
DWARFDebugRanges.h Changed RangeMap over to use llvm::SmallVector and updated the RangeArray and the RangeDataArray to have an extra "unsigned N" template parameter. Updated the lldb_private::Block to use a RangeArray with a uint32_t for both the function base offset and block range size, and then a 1 for the small vector size since most lexical blocks in DWARF only have 1 range. Updates the DWARFDebugRanges RangeArray to use an unsigned of 2 since most blocks that have more than one range usually have 2. Also updated a DWARFDebugAranges to default their RangeArray to use a SmallVector with unsigned size of 1 since this will take care of the .o files when doing DWARF in .o files and since there really isn't any good size we can guess with. 2011-10-08 06:59:54 +00:00
DWARFDefines.cpp Did a lot of code cleanup. 2010-11-09 23:46:37 +00:00
DWARFDefines.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFFormValue.cpp Added support for the DWARF 4 DW_FORM values. 2012-02-22 21:17:27 +00:00
DWARFFormValue.h Added a new class called lldb_private::SymbolFileType which is designed to 2011-12-08 02:13:16 +00:00
DWARFLocationDescription.cpp Fix a bunch of places where we were passing Stream *'s but were 2011-08-27 01:24:54 +00:00
DWARFLocationDescription.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
DWARFLocationList.cpp Fixed an issue in the DWARFLocationList::Dump() function where default 2011-11-28 00:51:27 +00:00
DWARFLocationList.h Fixed the header guards. 2011-09-12 04:20:38 +00:00
HashedNameToDIE.h Fixed a problem where maintaining the ObjCInterfaceMap 2012-01-19 02:17:40 +00:00
LogChannelDWARF.cpp Added a mechanism for keeping track of where in 2012-04-13 00:10:03 +00:00
LogChannelDWARF.h Added a mechanism for keeping track of where in 2012-04-13 00:10:03 +00:00
Makefile Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
NameToDIE.cpp Huge memory and performance improvements in the DWARF parser. 2011-09-12 23:21:58 +00:00
NameToDIE.h Huge memory and performance improvements in the DWARF parser. 2011-09-12 23:21:58 +00:00
SymbolFileDWARF.cpp Added a mechanism for keeping track of where in 2012-04-13 00:10:03 +00:00
SymbolFileDWARF.h Fixed a problem where we did not read properties 2012-04-05 00:12:52 +00:00
SymbolFileDWARFDebugMap.cpp Added a mechanism for keeping track of where in 2012-04-13 00:10:03 +00:00
SymbolFileDWARFDebugMap.h <rdar://problem/11101372> 2012-03-24 00:43:18 +00:00
UniqueDWARFASTType.cpp Fix segfault in UniqueDWARFASTTypeList::Find if we are comparing 2011-10-01 01:28:37 +00:00
UniqueDWARFASTType.h Added a fix that should help incorrect type uniquing. There was an issue 2011-03-15 04:38:20 +00:00