Flesh out DIESubprogram a bit more.

- Add accessor for return type.
- Implement DW_AT_artificial parsing.
- Store the subprogram's template parameters and provide accessors
  for them as well. Not used yet but will be handy later if/when we
  want to expose the instantiated types somewhere in the user
  interface when stepping into such a function.
This commit is contained in:
Rene Gollent
2011-12-11 11:20:41 -05:00
parent 6ef7d359c7
commit d68053959e
2 changed files with 30 additions and 2 deletions
+17 -1
View File
@@ -1836,7 +1836,8 @@ DIESubprogram::DIESubprogram()
fReturnType(NULL),
fAddressClass(0),
fPrototyped(false),
fInline(DW_INL_not_inlined)
fInline(DW_INL_not_inlined),
fArtificial(false)
{
}
@@ -1882,6 +1883,12 @@ DIESubprogram::AddChild(DebugInfoEntry* child)
case DW_TAG_lexical_block:
fBlocks.Add(child);
return B_OK;
case DW_TAG_template_type_parameter:
fTemplateTypeParameters.Add(child);
return B_OK;
case DW_TAG_template_value_parameter:
fTemplateValueParameters.Add(child);
return B_OK;
default:
return DIEDeclaredNamedBase::AddChild(child);
}
@@ -1989,6 +1996,15 @@ DIESubprogram::AddAttribute_frame_base(uint16 attributeName,
}
status_t
DIESubprogram::AddAttribute_artificial(uint16 attributeName,
const AttributeValue& value)
{
fArtificial = value.flag;
return B_OK;
}
// #pragma mark - DIETemplateTypeParameter
+13 -1
View File
@@ -1217,9 +1217,16 @@ public:
const DebugInfoEntryList Parameters() const { return fParameters; }
const DebugInfoEntryList Variables() const { return fVariables; }
const DebugInfoEntryList Blocks() const { return fBlocks; }
const DebugInfoEntryList TemplateTypeParameters() const
{ return fTemplateTypeParameters; }
const DebugInfoEntryList TemplateValueParameters() const
{ return fTemplateValueParameters; }
bool IsPrototyped() const { return fPrototyped; }
uint8 Inline() const { return fInline; }
bool IsArtificial() const { return fArtificial; }
DIEType* ReturnType() const { return fReturnType; }
virtual status_t AddChild(DebugInfoEntry* child);
@@ -1245,11 +1252,16 @@ public:
virtual status_t AddAttribute_frame_base(
uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_artificial(
uint16 attributeName,
const AttributeValue& value);
protected:
DebugInfoEntryList fParameters;
DebugInfoEntryList fVariables;
DebugInfoEntryList fBlocks;
DebugInfoEntryList fTemplateTypeParameters;
DebugInfoEntryList fTemplateValueParameters;
target_addr_t fLowPC;
target_addr_t fHighPC;
off_t fAddressRangesOffset;
@@ -1260,9 +1272,9 @@ protected:
uint8 fAddressClass;
bool fPrototyped;
uint8 fInline;
bool fArtificial;
// TODO:
// DW_AT_artificial
// DW_AT_calling_convention
// DW_AT_elemental
// DW_AT_entry_pc