2010-06-09 00:52:24 +08:00
|
|
|
//===-- SymbolFileDWARF.h --------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2011-09-13 07:21:58 +08:00
|
|
|
#ifndef SymbolFileDWARF_SymbolFileDWARF_h_
|
|
|
|
#define SymbolFileDWARF_SymbolFileDWARF_h_
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
// C Includes
|
|
|
|
// C++ Includes
|
|
|
|
#include <list>
|
|
|
|
#include <map>
|
2013-06-19 06:51:05 +08:00
|
|
|
#include <set>
|
2010-06-09 00:52:24 +08:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
// Other libraries and framework includes
|
2012-01-28 08:48:57 +08:00
|
|
|
#include "clang/AST/CharUnits.h"
|
2011-06-25 08:44:06 +08:00
|
|
|
#include "clang/AST/ExternalASTSource.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2011-10-14 07:49:28 +08:00
|
|
|
#include "llvm/ADT/SmallPtrSet.h"
|
2013-02-26 09:12:25 +08:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2012-01-12 12:33:28 +08:00
|
|
|
#include "lldb/lldb-private.h"
|
2010-11-10 07:46:37 +08:00
|
|
|
#include "lldb/Core/ClangForward.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Core/ConstString.h"
|
2010-07-07 06:38:03 +08:00
|
|
|
#include "lldb/Core/dwarf.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Core/DataExtractor.h"
|
|
|
|
#include "lldb/Core/Flags.h"
|
|
|
|
#include "lldb/Core/UniqueCStringMap.h"
|
2011-10-22 11:33:13 +08:00
|
|
|
#include "lldb/Symbol/ClangASTContext.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Symbol/SymbolFile.h"
|
|
|
|
#include "lldb/Symbol/SymbolContext.h"
|
|
|
|
|
|
|
|
// Project includes
|
|
|
|
#include "DWARFDefines.h"
|
2011-09-02 12:03:59 +08:00
|
|
|
#include "HashedNameToDIE.h"
|
2010-09-15 12:15:46 +08:00
|
|
|
#include "NameToDIE.h"
|
2011-02-10 03:06:17 +08:00
|
|
|
#include "UniqueDWARFASTType.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Forward Declarations for this DWARF plugin
|
|
|
|
//----------------------------------------------------------------------
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
class DebugMapModule;
|
2010-06-09 00:52:24 +08:00
|
|
|
class DWARFAbbreviationDeclaration;
|
|
|
|
class DWARFAbbreviationDeclarationSet;
|
2012-04-25 05:22:41 +08:00
|
|
|
class DWARFileUnit;
|
2010-06-09 00:52:24 +08:00
|
|
|
class DWARFDebugAbbrev;
|
|
|
|
class DWARFDebugAranges;
|
|
|
|
class DWARFDebugInfo;
|
|
|
|
class DWARFDebugInfoEntry;
|
|
|
|
class DWARFDebugLine;
|
|
|
|
class DWARFDebugPubnames;
|
|
|
|
class DWARFDebugRanges;
|
2012-04-25 05:22:41 +08:00
|
|
|
class DWARFDeclContext;
|
2010-06-09 00:52:24 +08:00
|
|
|
class DWARFDIECollection;
|
|
|
|
class DWARFFormValue;
|
2010-10-12 10:24:53 +08:00
|
|
|
class SymbolFileDWARFDebugMap;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-10-20 02:09:39 +08:00
|
|
|
class SymbolFileDWARF : public lldb_private::SymbolFile, public lldb_private::UserID
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-12-06 07:37:14 +08:00
|
|
|
friend class SymbolFileDWARFDebugMap;
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
friend class DebugMapModule;
|
2012-12-13 01:30:52 +08:00
|
|
|
friend class DWARFCompileUnit;
|
2010-06-09 00:52:24 +08:00
|
|
|
//------------------------------------------------------------------
|
|
|
|
// Static Functions
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
static void
|
|
|
|
Initialize();
|
|
|
|
|
|
|
|
static void
|
|
|
|
Terminate();
|
|
|
|
|
2013-05-11 05:47:16 +08:00
|
|
|
static lldb_private::ConstString
|
2010-06-09 00:52:24 +08:00
|
|
|
GetPluginNameStatic();
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
GetPluginDescriptionStatic();
|
|
|
|
|
|
|
|
static lldb_private::SymbolFile*
|
|
|
|
CreateInstance (lldb_private::ObjectFile* obj_file);
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
// Constructors and Destructors
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
SymbolFileDWARF(lldb_private::ObjectFile* ofile);
|
|
|
|
virtual ~SymbolFileDWARF();
|
|
|
|
|
2011-12-03 12:38:43 +08:00
|
|
|
virtual uint32_t CalculateAbilities ();
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
virtual void InitializeObject();
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
// Compile Unit function calls
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
virtual uint32_t GetNumCompileUnits();
|
|
|
|
virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index);
|
|
|
|
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
virtual lldb::LanguageType ParseCompileUnitLanguage (const lldb_private::SymbolContext& sc);
|
2010-06-09 00:52:24 +08:00
|
|
|
virtual size_t ParseCompileUnitFunctions (const lldb_private::SymbolContext& sc);
|
|
|
|
virtual bool ParseCompileUnitLineTable (const lldb_private::SymbolContext& sc);
|
|
|
|
virtual bool ParseCompileUnitSupportFiles (const lldb_private::SymbolContext& sc, lldb_private::FileSpecList& support_files);
|
|
|
|
virtual size_t ParseFunctionBlocks (const lldb_private::SymbolContext& sc);
|
|
|
|
virtual size_t ParseTypes (const lldb_private::SymbolContext& sc);
|
|
|
|
virtual size_t ParseVariablesForContext (const lldb_private::SymbolContext& sc);
|
|
|
|
|
2010-09-15 12:15:46 +08:00
|
|
|
virtual lldb_private::Type* ResolveTypeUID(lldb::user_id_t type_uid);
|
2013-07-12 06:46:58 +08:00
|
|
|
virtual bool ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type);
|
2010-09-29 09:12:09 +08:00
|
|
|
|
2012-04-03 06:59:12 +08:00
|
|
|
virtual lldb_private::Type* ResolveType (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* type_die, bool assert_not_being_parsed = true);
|
2011-08-06 07:43:37 +08:00
|
|
|
virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid);
|
|
|
|
virtual clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc);
|
|
|
|
virtual uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list);
|
2011-10-13 09:49:10 +08:00
|
|
|
virtual uint32_t FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables);
|
2010-06-09 00:52:24 +08:00
|
|
|
virtual uint32_t FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables);
|
2012-02-11 06:52:19 +08:00
|
|
|
virtual uint32_t FindFunctions(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list);
|
|
|
|
virtual uint32_t FindFunctions(const lldb_private::RegularExpression& regex, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list);
|
2011-10-13 09:49:10 +08:00
|
|
|
virtual uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types);
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
virtual lldb_private::TypeList *
|
|
|
|
GetTypeList ();
|
2013-06-19 06:51:05 +08:00
|
|
|
virtual size_t GetTypes (lldb_private::SymbolContextScope *sc_scope,
|
|
|
|
uint32_t type_mask,
|
|
|
|
lldb_private::TypeList &type_list);
|
|
|
|
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
virtual lldb_private::ClangASTContext &
|
|
|
|
GetClangASTContext ();
|
|
|
|
|
2010-11-13 11:52:47 +08:00
|
|
|
virtual lldb_private::ClangNamespaceDecl
|
2010-11-11 07:42:09 +08:00
|
|
|
FindNamespace (const lldb_private::SymbolContext& sc,
|
2011-10-13 09:49:10 +08:00
|
|
|
const lldb_private::ConstString &name,
|
|
|
|
const lldb_private::ClangNamespaceDecl *parent_namespace_decl);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
// ClangASTContext callbacks for external source lookups.
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
static void
|
|
|
|
CompleteTagDecl (void *baton, clang::TagDecl *);
|
|
|
|
|
|
|
|
static void
|
|
|
|
CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *);
|
2011-06-25 08:44:06 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
FindExternalVisibleDeclsByName (void *baton,
|
|
|
|
const clang::DeclContext *DC,
|
|
|
|
clang::DeclarationName Name,
|
|
|
|
llvm::SmallVectorImpl <clang::NamedDecl *> *results);
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
|
2012-01-28 08:48:57 +08:00
|
|
|
static bool
|
|
|
|
LayoutRecordType (void *baton,
|
|
|
|
const clang::RecordDecl *record_decl,
|
|
|
|
uint64_t &size,
|
|
|
|
uint64_t &alignment,
|
|
|
|
llvm::DenseMap <const clang::FieldDecl *, uint64_t> &field_offsets,
|
|
|
|
llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> &base_offsets,
|
|
|
|
llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> &vbase_offsets);
|
|
|
|
|
|
|
|
bool
|
|
|
|
LayoutRecordType (const clang::RecordDecl *record_decl,
|
|
|
|
uint64_t &size,
|
|
|
|
uint64_t &alignment,
|
|
|
|
llvm::DenseMap <const clang::FieldDecl *, uint64_t> &field_offsets,
|
|
|
|
llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> &base_offsets,
|
|
|
|
llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> &vbase_offsets);
|
|
|
|
|
|
|
|
struct LayoutInfo
|
|
|
|
{
|
|
|
|
LayoutInfo () :
|
|
|
|
bit_size(0),
|
|
|
|
alignment(0),
|
2012-11-02 07:20:02 +08:00
|
|
|
field_offsets(),
|
|
|
|
base_offsets(),
|
|
|
|
vbase_offsets()
|
2012-01-28 08:48:57 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
uint64_t bit_size;
|
|
|
|
uint64_t alignment;
|
|
|
|
llvm::DenseMap <const clang::FieldDecl *, uint64_t> field_offsets;
|
2012-11-02 07:20:02 +08:00
|
|
|
llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> base_offsets;
|
|
|
|
llvm::DenseMap <const clang::CXXRecordDecl *, clang::CharUnits> vbase_offsets;
|
2012-01-28 08:48:57 +08:00
|
|
|
};
|
2010-06-09 00:52:24 +08:00
|
|
|
//------------------------------------------------------------------
|
|
|
|
// PluginInterface protocol
|
|
|
|
//------------------------------------------------------------------
|
2013-05-11 05:47:16 +08:00
|
|
|
virtual lldb_private::ConstString
|
2010-06-09 00:52:24 +08:00
|
|
|
GetPluginName();
|
|
|
|
|
|
|
|
virtual uint32_t
|
|
|
|
GetPluginVersion();
|
|
|
|
|
|
|
|
// Approach 2 - count + accessor
|
|
|
|
// Index compile units would scan the initial compile units and register
|
|
|
|
// them with the module. This would only be done on demand if and only if
|
|
|
|
// the compile units were needed.
|
|
|
|
//virtual size_t GetCompUnitCount() = 0;
|
|
|
|
//virtual CompUnitSP GetCompUnitAtIndex(size_t cu_idx) = 0;
|
|
|
|
|
2011-09-13 07:21:58 +08:00
|
|
|
const lldb_private::DataExtractor& get_debug_abbrev_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_aranges_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_frame_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_info_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_line_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_loc_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_ranges_data ();
|
|
|
|
const lldb_private::DataExtractor& get_debug_str_data ();
|
2011-09-29 01:06:40 +08:00
|
|
|
const lldb_private::DataExtractor& get_apple_names_data ();
|
|
|
|
const lldb_private::DataExtractor& get_apple_types_data ();
|
2011-10-05 06:41:51 +08:00
|
|
|
const lldb_private::DataExtractor& get_apple_namespaces_data ();
|
Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.
Added 3 new formats which can be used to display data:
eFormatAddressInfo
eFormatHexFloat
eFormatInstruction
eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".
eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".
eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".
Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.
llvm-svn: 143114
2011-10-28 01:55:14 +08:00
|
|
|
const lldb_private::DataExtractor& get_apple_objc_data ();
|
2011-10-05 06:41:51 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
DWARFDebugAbbrev* DebugAbbrev();
|
|
|
|
const DWARFDebugAbbrev* DebugAbbrev() const;
|
|
|
|
|
|
|
|
DWARFDebugInfo* DebugInfo();
|
|
|
|
const DWARFDebugInfo* DebugInfo() const;
|
|
|
|
|
|
|
|
DWARFDebugRanges* DebugRanges();
|
|
|
|
const DWARFDebugRanges* DebugRanges() const;
|
|
|
|
|
|
|
|
const lldb_private::DataExtractor&
|
2011-03-31 09:08:07 +08:00
|
|
|
GetCachedSectionData (uint32_t got_flag,
|
|
|
|
lldb::SectionType sect_type,
|
|
|
|
lldb_private::DataExtractor &data);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2010-07-22 06:54:26 +08:00
|
|
|
static bool
|
|
|
|
SupportedVersion(uint16_t version);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-10-06 06:22:08 +08:00
|
|
|
clang::DeclContext *
|
|
|
|
GetCachedClangDeclContextForDIE (const DWARFDebugInfoEntry *die)
|
|
|
|
{
|
|
|
|
DIEToDeclContextMap::iterator pos = m_die_to_decl_ctx.find(die);
|
|
|
|
if (pos != m_die_to_decl_ctx.end())
|
|
|
|
return pos->second;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
clang::DeclContext *
|
2011-08-06 07:43:37 +08:00
|
|
|
GetClangDeclContextForDIE (const lldb_private::SymbolContext &sc, DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die);
|
|
|
|
|
|
|
|
clang::DeclContext *
|
|
|
|
GetClangDeclContextForDIEOffset (const lldb_private::SymbolContext &sc, dw_offset_t die_offset);
|
|
|
|
|
|
|
|
clang::DeclContext *
|
2011-10-14 07:49:28 +08:00
|
|
|
GetClangDeclContextContainingDIE (DWARFCompileUnit *cu,
|
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
const DWARFDebugInfoEntry **decl_ctx_die);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
clang::DeclContext *
|
2011-08-06 07:43:37 +08:00
|
|
|
GetClangDeclContextContainingDIEOffset (dw_offset_t die_offset);
|
2011-09-30 11:20:47 +08:00
|
|
|
|
|
|
|
const DWARFDebugInfoEntry *
|
|
|
|
GetDeclContextDIEContainingDIE (DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die);
|
|
|
|
|
2011-06-25 08:44:06 +08:00
|
|
|
void
|
2011-07-30 10:42:06 +08:00
|
|
|
SearchDeclContext (const clang::DeclContext *decl_context,
|
|
|
|
const char *name,
|
|
|
|
llvm::SmallVectorImpl <clang::NamedDecl *> *results);
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
lldb_private::Flags&
|
|
|
|
GetFlags ()
|
|
|
|
{
|
|
|
|
return m_flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
const lldb_private::Flags&
|
|
|
|
GetFlags () const
|
|
|
|
{
|
|
|
|
return m_flags;
|
|
|
|
}
|
|
|
|
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
bool
|
2013-07-12 06:46:58 +08:00
|
|
|
HasForwardDeclForClangType (const lldb_private::ClangASTType &clang_type);
|
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.
llvm-svn: 123613
2011-01-17 11:46:26 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
protected:
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
flagsGotDebugAbbrevData = (1 << 0),
|
|
|
|
flagsGotDebugArangesData = (1 << 1),
|
|
|
|
flagsGotDebugFrameData = (1 << 2),
|
|
|
|
flagsGotDebugInfoData = (1 << 3),
|
|
|
|
flagsGotDebugLineData = (1 << 4),
|
|
|
|
flagsGotDebugLocData = (1 << 5),
|
|
|
|
flagsGotDebugMacInfoData = (1 << 6),
|
|
|
|
flagsGotDebugPubNamesData = (1 << 7),
|
|
|
|
flagsGotDebugPubTypesData = (1 << 8),
|
|
|
|
flagsGotDebugRangesData = (1 << 9),
|
2011-09-02 07:16:13 +08:00
|
|
|
flagsGotDebugStrData = (1 << 10),
|
Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.
Added 3 new formats which can be used to display data:
eFormatAddressInfo
eFormatHexFloat
eFormatInstruction
eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".
eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".
eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".
Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.
llvm-svn: 143114
2011-10-28 01:55:14 +08:00
|
|
|
flagsGotAppleNamesData = (1 << 11),
|
|
|
|
flagsGotAppleTypesData = (1 << 12),
|
|
|
|
flagsGotAppleNamespacesData = (1 << 13),
|
|
|
|
flagsGotAppleObjCData = (1 << 14)
|
2010-06-09 00:52:24 +08:00
|
|
|
};
|
2011-10-13 07:34:26 +08:00
|
|
|
|
2011-10-13 08:00:53 +08:00
|
|
|
bool NamespaceDeclMatchesThisSymbolFile (const lldb_private::ClangNamespaceDecl *namespace_decl);
|
|
|
|
|
2011-10-13 07:34:26 +08:00
|
|
|
bool DIEIsInNamespace (const lldb_private::ClangNamespaceDecl *namespace_decl,
|
2012-04-03 06:59:12 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2011-10-13 07:34:26 +08:00
|
|
|
const DWARFDebugInfoEntry* die);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN (SymbolFileDWARF);
|
2012-04-03 06:59:12 +08:00
|
|
|
lldb::CompUnitSP ParseCompileUnit (DWARFCompileUnit* dwarf_cu, uint32_t cu_idx);
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
DWARFCompileUnit* GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit);
|
2010-06-09 00:52:24 +08:00
|
|
|
DWARFCompileUnit* GetNextUnparsedDWARFCompileUnit(DWARFCompileUnit* prev_cu);
|
2012-04-03 06:59:12 +08:00
|
|
|
lldb_private::CompileUnit* GetCompUnitForDWARFCompUnit(DWARFCompileUnit* dwarf_cu, uint32_t cu_idx = UINT32_MAX);
|
|
|
|
bool GetFunction (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* func_die, lldb_private::SymbolContext& sc);
|
2010-09-24 13:15:53 +08:00
|
|
|
lldb_private::Function * ParseCompileUnitFunction (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die);
|
2010-06-09 00:52:24 +08:00
|
|
|
size_t ParseFunctionBlocks (const lldb_private::SymbolContext& sc,
|
2010-08-21 10:22:51 +08:00
|
|
|
lldb_private::Block *parent_block,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-06-09 00:52:24 +08:00
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
lldb::addr_t subprogram_low_pc,
|
2011-08-13 01:54:33 +08:00
|
|
|
uint32_t depth);
|
2010-09-24 13:15:53 +08:00
|
|
|
size_t ParseTypes (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool parse_siblings, bool parse_children);
|
2010-09-29 09:12:09 +08:00
|
|
|
lldb::TypeSP ParseType (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool *type_is_new);
|
2012-04-03 06:59:12 +08:00
|
|
|
lldb_private::Type* ResolveTypeUID (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* die, bool assert_not_being_parsed);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
lldb::VariableSP ParseVariableDIE(
|
|
|
|
const lldb_private::SymbolContext& sc,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-09-14 10:20:48 +08:00
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
const lldb::addr_t func_low_pc);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
size_t ParseVariables(
|
|
|
|
const lldb_private::SymbolContext& sc,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-09-14 10:20:48 +08:00
|
|
|
const lldb::addr_t func_low_pc,
|
2010-06-09 00:52:24 +08:00
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
bool parse_siblings,
|
|
|
|
bool parse_children,
|
|
|
|
lldb_private::VariableList* cc_variable_list = NULL);
|
|
|
|
|
2012-06-05 06:28:05 +08:00
|
|
|
class DelayedAddObjCClassProperty;
|
|
|
|
typedef std::vector <DelayedAddObjCClassProperty> DelayedPropertyList;
|
|
|
|
|
2013-03-08 09:37:30 +08:00
|
|
|
bool ClassOrStructIsVirtual (
|
|
|
|
DWARFCompileUnit* dwarf_cu,
|
|
|
|
const DWARFDebugInfoEntry *parent_die);
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
size_t ParseChildMembers(
|
|
|
|
const lldb_private::SymbolContext& sc,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-06-09 00:52:24 +08:00
|
|
|
const DWARFDebugInfoEntry *die,
|
2013-07-12 06:46:58 +08:00
|
|
|
lldb_private::ClangASTType &class_clang_type,
|
2010-07-28 10:04:09 +08:00
|
|
|
const lldb::LanguageType class_language,
|
2010-06-09 00:52:24 +08:00
|
|
|
std::vector<clang::CXXBaseSpecifier *>& base_classes,
|
|
|
|
std::vector<int>& member_accessibilities,
|
2010-10-02 04:48:32 +08:00
|
|
|
DWARFDIECollection& member_function_dies,
|
2012-06-05 06:28:05 +08:00
|
|
|
DelayedPropertyList& delayed_properties,
|
2010-08-06 08:32:49 +08:00
|
|
|
lldb::AccessType &default_accessibility,
|
2012-01-28 08:48:57 +08:00
|
|
|
bool &is_a_class,
|
|
|
|
LayoutInfo &layout_info);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
size_t ParseChildParameters(
|
|
|
|
const lldb_private::SymbolContext& sc,
|
2011-08-12 14:47:54 +08:00
|
|
|
clang::DeclContext *containing_decl_ctx,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-06-09 00:52:24 +08:00
|
|
|
const DWARFDebugInfoEntry *parent_die,
|
2010-09-23 09:09:21 +08:00
|
|
|
bool skip_artificial,
|
2011-08-03 06:21:50 +08:00
|
|
|
bool &is_static,
|
2010-06-09 00:52:24 +08:00
|
|
|
lldb_private::TypeList* type_list,
|
2013-07-12 06:46:58 +08:00
|
|
|
std::vector<lldb_private::ClangASTType>& function_args,
|
2010-11-16 10:10:54 +08:00
|
|
|
std::vector<clang::ParmVarDecl*>& function_param_decls,
|
2012-02-06 14:42:51 +08:00
|
|
|
unsigned &type_quals,
|
|
|
|
lldb_private::ClangASTContext::TemplateParameterInfos &template_param_infos);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
size_t ParseChildEnumerators(
|
|
|
|
const lldb_private::SymbolContext& sc,
|
2013-07-12 06:46:58 +08:00
|
|
|
lldb_private::ClangASTType &clang_type,
|
2013-03-06 07:54:39 +08:00
|
|
|
bool is_signed,
|
2010-06-09 00:52:24 +08:00
|
|
|
uint32_t enumerator_byte_size,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-06-09 00:52:24 +08:00
|
|
|
const DWARFDebugInfoEntry *enum_die);
|
|
|
|
|
|
|
|
void ParseChildArrayInfo(
|
|
|
|
const lldb_private::SymbolContext& sc,
|
2010-09-24 13:15:53 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-06-09 00:52:24 +08:00
|
|
|
const DWARFDebugInfoEntry *parent_die,
|
|
|
|
int64_t& first_index,
|
|
|
|
std::vector<uint64_t>& element_orders,
|
|
|
|
uint32_t& byte_stride,
|
|
|
|
uint32_t& bit_stride);
|
|
|
|
|
2011-10-08 06:23:45 +08:00
|
|
|
// Given a die_offset, figure out the symbol context representing that die.
|
2011-10-13 08:59:38 +08:00
|
|
|
bool ResolveFunction (dw_offset_t offset,
|
|
|
|
DWARFCompileUnit *&dwarf_cu,
|
|
|
|
lldb_private::SymbolContextList& sc_list);
|
|
|
|
|
|
|
|
bool ResolveFunction (DWARFCompileUnit *cu,
|
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
lldb_private::SymbolContextList& sc_list);
|
|
|
|
|
2011-10-08 06:23:45 +08:00
|
|
|
bool FunctionDieMatchesPartialName (
|
|
|
|
const DWARFDebugInfoEntry* die,
|
|
|
|
const DWARFCompileUnit *dwarf_cu,
|
|
|
|
uint32_t name_type_mask,
|
|
|
|
const char *partial_name,
|
|
|
|
const char *base_name_start,
|
|
|
|
const char *base_name_end);
|
2011-09-02 12:03:59 +08:00
|
|
|
|
2010-06-29 05:30:43 +08:00
|
|
|
void FindFunctions(
|
|
|
|
const lldb_private::ConstString &name,
|
2010-09-15 12:15:46 +08:00
|
|
|
const NameToDIE &name_to_die,
|
|
|
|
lldb_private::SymbolContextList& sc_list);
|
|
|
|
|
|
|
|
void FindFunctions (
|
|
|
|
const lldb_private::RegularExpression ®ex,
|
|
|
|
const NameToDIE &name_to_die,
|
2010-06-29 05:30:43 +08:00
|
|
|
lldb_private::SymbolContextList& sc_list);
|
|
|
|
|
2011-10-05 06:41:51 +08:00
|
|
|
void FindFunctions (
|
|
|
|
const lldb_private::RegularExpression ®ex,
|
|
|
|
const DWARFMappedHash::MemoryTable &memory_table,
|
|
|
|
lldb_private::SymbolContextList& sc_list);
|
|
|
|
|
2010-11-08 05:02:03 +08:00
|
|
|
lldb::TypeSP FindDefinitionTypeForDIE (
|
2012-04-03 06:59:12 +08:00
|
|
|
DWARFCompileUnit* dwarf_cu,
|
2010-11-08 05:02:03 +08:00
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
const lldb_private::ConstString &type_name);
|
2012-04-25 05:22:41 +08:00
|
|
|
|
|
|
|
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext (
|
|
|
|
const DWARFDeclContext &die_decl_ctx);
|
2011-12-03 12:40:03 +08:00
|
|
|
|
|
|
|
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE (
|
|
|
|
const DWARFDebugInfoEntry *die,
|
2012-01-12 12:33:28 +08:00
|
|
|
const lldb_private::ConstString &type_name,
|
|
|
|
bool must_be_implementation);
|
|
|
|
|
|
|
|
bool Supports_DW_AT_APPLE_objc_complete_type (DWARFCompileUnit *cu);
|
|
|
|
|
|
|
|
lldb::TypeSP FindCompleteObjCDefinitionType (const lldb_private::ConstString &type_name,
|
|
|
|
bool header_definition_ok);
|
2011-12-03 12:40:03 +08:00
|
|
|
|
|
|
|
lldb_private::Symbol * GetObjCClassSymbol (const lldb_private::ConstString &objc_class_name);
|
|
|
|
|
2011-10-05 06:41:51 +08:00
|
|
|
void ParseFunctions (const DIEArray &die_offsets,
|
|
|
|
lldb_private::SymbolContextList& sc_list);
|
2010-09-28 05:07:38 +08:00
|
|
|
lldb::TypeSP GetTypeForDIE (DWARFCompileUnit *cu,
|
2010-09-29 09:12:09 +08:00
|
|
|
const DWARFDebugInfoEntry* die);
|
2010-09-28 05:07:38 +08:00
|
|
|
|
2010-08-03 08:35:52 +08:00
|
|
|
uint32_t FindTypes(std::vector<dw_offset_t> die_offsets, uint32_t max_matches, lldb_private::TypeList& types);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
void Index();
|
2011-07-30 10:42:06 +08:00
|
|
|
|
|
|
|
void DumpIndexes();
|
2010-06-09 00:52:24 +08:00
|
|
|
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
void SetDebugMapModule (const lldb::ModuleSP &module_sp)
|
2010-10-12 10:24:53 +08:00
|
|
|
{
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
m_debug_map_module_wp = module_sp;
|
2010-10-12 10:24:53 +08:00
|
|
|
}
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
|
|
|
|
SymbolFileDWARFDebugMap *
|
|
|
|
GetDebugMapSymfile ();
|
2010-10-12 10:24:53 +08:00
|
|
|
|
2011-06-18 06:10:16 +08:00
|
|
|
const DWARFDebugInfoEntry *
|
|
|
|
FindBlockContainingSpecification (dw_offset_t func_die_offset,
|
|
|
|
dw_offset_t spec_block_die_offset,
|
|
|
|
DWARFCompileUnit **dwarf_cu_handle);
|
|
|
|
|
|
|
|
const DWARFDebugInfoEntry *
|
|
|
|
FindBlockContainingSpecification (DWARFCompileUnit* dwarf_cu,
|
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
dw_offset_t spec_block_die_offset,
|
|
|
|
DWARFCompileUnit **dwarf_cu_handle);
|
|
|
|
|
2010-11-11 07:42:09 +08:00
|
|
|
clang::NamespaceDecl *
|
|
|
|
ResolveNamespaceDIE (DWARFCompileUnit *curr_cu, const DWARFDebugInfoEntry *die);
|
|
|
|
|
2011-02-15 08:19:15 +08:00
|
|
|
UniqueDWARFASTTypeMap &
|
|
|
|
GetUniqueDWARFASTTypeMap ();
|
|
|
|
|
2011-06-25 08:44:06 +08:00
|
|
|
void LinkDeclContextToDIE (clang::DeclContext *decl_ctx,
|
|
|
|
const DWARFDebugInfoEntry *die)
|
|
|
|
{
|
|
|
|
m_die_to_decl_ctx[die] = decl_ctx;
|
2011-10-14 07:49:28 +08:00
|
|
|
// There can be many DIEs for a single decl context
|
|
|
|
m_decl_ctx_to_die[decl_ctx].insert(die);
|
2011-06-25 08:44:06 +08:00
|
|
|
}
|
|
|
|
|
2011-10-20 02:09:39 +08:00
|
|
|
bool
|
|
|
|
UserIDMatches (lldb::user_id_t uid) const
|
|
|
|
{
|
|
|
|
const lldb::user_id_t high_uid = uid & 0xffffffff00000000ull;
|
|
|
|
if (high_uid)
|
|
|
|
return high_uid == GetID();
|
|
|
|
return true;
|
|
|
|
}
|
2011-12-09 16:48:30 +08:00
|
|
|
|
2011-10-20 02:09:39 +08:00
|
|
|
lldb::user_id_t
|
|
|
|
MakeUserID (dw_offset_t die_offset) const
|
|
|
|
{
|
|
|
|
return GetID() | die_offset;
|
|
|
|
}
|
|
|
|
|
2011-10-22 11:33:13 +08:00
|
|
|
static bool
|
|
|
|
DeclKindIsCXXClass (clang::Decl::Kind decl_kind)
|
|
|
|
{
|
|
|
|
switch (decl_kind)
|
|
|
|
{
|
|
|
|
case clang::Decl::CXXRecord:
|
|
|
|
case clang::Decl::ClassTemplateSpecialization:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ParseTemplateParameterInfos (DWARFCompileUnit* dwarf_cu,
|
|
|
|
const DWARFDebugInfoEntry *parent_die,
|
|
|
|
lldb_private::ClangASTContext::TemplateParameterInfos &template_param_infos);
|
|
|
|
|
2012-02-06 14:42:51 +08:00
|
|
|
bool
|
|
|
|
ParseTemplateDIE (DWARFCompileUnit* dwarf_cu,
|
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
lldb_private::ClangASTContext::TemplateParameterInfos &template_param_infos);
|
|
|
|
|
2011-10-22 11:33:13 +08:00
|
|
|
clang::ClassTemplateDecl *
|
|
|
|
ParseClassTemplateDecl (clang::DeclContext *decl_ctx,
|
2011-10-26 11:31:36 +08:00
|
|
|
lldb::AccessType access_type,
|
2011-10-22 11:33:13 +08:00
|
|
|
const char *parent_name,
|
|
|
|
int tag_decl_kind,
|
|
|
|
const lldb_private::ClangASTContext::TemplateParameterInfos &template_param_infos);
|
|
|
|
|
2012-02-02 13:48:16 +08:00
|
|
|
bool
|
|
|
|
DIEDeclContextsMatch (DWARFCompileUnit* cu1, const DWARFDebugInfoEntry *die1,
|
|
|
|
DWARFCompileUnit* cu2, const DWARFDebugInfoEntry *die2);
|
2012-04-05 08:12:52 +08:00
|
|
|
|
|
|
|
bool
|
|
|
|
ClassContainsSelector (DWARFCompileUnit *dwarf_cu,
|
|
|
|
const DWARFDebugInfoEntry *class_die,
|
|
|
|
const lldb_private::ConstString &selector);
|
2011-10-22 11:33:13 +08:00
|
|
|
|
2012-05-15 10:33:01 +08:00
|
|
|
bool
|
2013-02-26 09:12:25 +08:00
|
|
|
CopyUniqueClassMethodTypes (SymbolFileDWARF *class_symfile,
|
|
|
|
lldb_private::Type *class_type,
|
2012-05-15 10:33:01 +08:00
|
|
|
DWARFCompileUnit* src_cu,
|
|
|
|
const DWARFDebugInfoEntry *src_class_die,
|
|
|
|
DWARFCompileUnit* dst_cu,
|
2013-02-26 09:12:25 +08:00
|
|
|
const DWARFDebugInfoEntry *dst_class_die,
|
|
|
|
llvm::SmallVectorImpl <const DWARFDebugInfoEntry *> &failures);
|
2012-05-15 10:33:01 +08:00
|
|
|
|
2013-03-05 05:46:16 +08:00
|
|
|
bool
|
|
|
|
FixupAddress (lldb_private::Address &addr);
|
|
|
|
|
2013-06-19 06:51:05 +08:00
|
|
|
typedef std::set<lldb_private::Type *> TypeSet;
|
|
|
|
|
|
|
|
void
|
|
|
|
GetTypes (DWARFCompileUnit* dwarf_cu,
|
|
|
|
const DWARFDebugInfoEntry *die,
|
|
|
|
dw_offset_t min_die_offset,
|
|
|
|
dw_offset_t max_die_offset,
|
|
|
|
uint32_t type_mask,
|
|
|
|
TypeSet &type_set);
|
|
|
|
|
<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.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
lldb::ModuleWP m_debug_map_module_wp;
|
2010-11-10 07:46:37 +08:00
|
|
|
SymbolFileDWARFDebugMap * m_debug_map_symfile;
|
|
|
|
clang::TranslationUnitDecl * m_clang_tu_decl;
|
2010-06-09 00:52:24 +08:00
|
|
|
lldb_private::Flags m_flags;
|
|
|
|
lldb_private::DataExtractor m_dwarf_data;
|
|
|
|
lldb_private::DataExtractor m_data_debug_abbrev;
|
2011-09-13 07:21:58 +08:00
|
|
|
lldb_private::DataExtractor m_data_debug_aranges;
|
2010-06-09 00:52:24 +08:00
|
|
|
lldb_private::DataExtractor m_data_debug_frame;
|
|
|
|
lldb_private::DataExtractor m_data_debug_info;
|
|
|
|
lldb_private::DataExtractor m_data_debug_line;
|
|
|
|
lldb_private::DataExtractor m_data_debug_loc;
|
|
|
|
lldb_private::DataExtractor m_data_debug_ranges;
|
|
|
|
lldb_private::DataExtractor m_data_debug_str;
|
2011-09-29 01:06:40 +08:00
|
|
|
lldb_private::DataExtractor m_data_apple_names;
|
|
|
|
lldb_private::DataExtractor m_data_apple_types;
|
2011-10-05 06:41:51 +08:00
|
|
|
lldb_private::DataExtractor m_data_apple_namespaces;
|
Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.
Added 3 new formats which can be used to display data:
eFormatAddressInfo
eFormatHexFloat
eFormatInstruction
eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".
eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".
eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".
Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.
llvm-svn: 143114
2011-10-28 01:55:14 +08:00
|
|
|
lldb_private::DataExtractor m_data_apple_objc;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2013-04-19 02:10:51 +08:00
|
|
|
// The unique pointer items below are generated on demand if and when someone accesses
|
2010-06-09 00:52:24 +08:00
|
|
|
// them through a non const version of this class.
|
2013-04-19 06:45:39 +08:00
|
|
|
std::unique_ptr<DWARFDebugAbbrev> m_abbr;
|
|
|
|
std::unique_ptr<DWARFDebugInfo> m_info;
|
|
|
|
std::unique_ptr<DWARFDebugLine> m_line;
|
|
|
|
std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_ap;
|
|
|
|
std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_ap;
|
|
|
|
std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_ap;
|
|
|
|
std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_ap;
|
2010-09-15 12:15:46 +08:00
|
|
|
NameToDIE m_function_basename_index; // All concrete functions
|
|
|
|
NameToDIE m_function_fullname_index; // All concrete functions
|
|
|
|
NameToDIE m_function_method_index; // All inlined functions
|
|
|
|
NameToDIE m_function_selector_index; // All method names for functions of classes
|
2010-10-12 10:24:53 +08:00
|
|
|
NameToDIE m_objc_class_selectors_index; // Given a class name, find all selectors for the class
|
2011-10-05 06:41:51 +08:00
|
|
|
NameToDIE m_global_index; // Global and static variables
|
|
|
|
NameToDIE m_type_index; // All type DIE offsets
|
|
|
|
NameToDIE m_namespace_index; // All type DIE offsets
|
2012-01-12 12:33:28 +08:00
|
|
|
bool m_indexed:1,
|
|
|
|
m_is_external_ast_source:1,
|
|
|
|
m_using_apple_tables:1;
|
|
|
|
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2013-04-19 06:45:39 +08:00
|
|
|
std::unique_ptr<DWARFDebugRanges> m_ranges;
|
2011-02-10 03:06:17 +08:00
|
|
|
UniqueDWARFASTTypeMap m_unique_ast_type_map;
|
2011-10-14 07:49:28 +08:00
|
|
|
typedef llvm::SmallPtrSet<const DWARFDebugInfoEntry *, 4> DIEPointerSet;
|
2010-06-09 00:52:24 +08:00
|
|
|
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::DeclContext *> DIEToDeclContextMap;
|
2011-10-14 07:49:28 +08:00
|
|
|
typedef llvm::DenseMap<const clang::DeclContext *, DIEPointerSet> DeclContextToDIEMap;
|
2010-09-28 05:07:38 +08:00
|
|
|
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *> DIEToTypePtr;
|
|
|
|
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::VariableSP> DIEToVariableSP;
|
2010-09-29 09:12:09 +08:00
|
|
|
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb::clang_type_t> DIEToClangType;
|
|
|
|
typedef llvm::DenseMap<lldb::clang_type_t, const DWARFDebugInfoEntry *> ClangTypeToDIE;
|
2012-01-28 08:48:57 +08:00
|
|
|
typedef llvm::DenseMap<const clang::RecordDecl *, LayoutInfo> RecordDeclToLayoutMap;
|
2010-06-09 00:52:24 +08:00
|
|
|
DIEToDeclContextMap m_die_to_decl_ctx;
|
2011-06-25 08:44:06 +08:00
|
|
|
DeclContextToDIEMap m_decl_ctx_to_die;
|
2010-09-28 05:07:38 +08:00
|
|
|
DIEToTypePtr m_die_to_type;
|
|
|
|
DIEToVariableSP m_die_to_variable_sp;
|
2010-09-29 09:12:09 +08:00
|
|
|
DIEToClangType m_forward_decl_die_to_clang_type;
|
|
|
|
ClangTypeToDIE m_forward_decl_clang_type_to_die;
|
2012-01-28 08:48:57 +08:00
|
|
|
RecordDeclToLayoutMap m_record_decl_to_layout_map;
|
2010-06-09 00:52:24 +08:00
|
|
|
};
|
|
|
|
|
2011-09-13 07:21:58 +08:00
|
|
|
#endif // SymbolFileDWARF_SymbolFileDWARF_h_
|