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:
@@ -1836,7 +1836,8 @@ DIESubprogram::DIESubprogram()
|
|||||||
fReturnType(NULL),
|
fReturnType(NULL),
|
||||||
fAddressClass(0),
|
fAddressClass(0),
|
||||||
fPrototyped(false),
|
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:
|
case DW_TAG_lexical_block:
|
||||||
fBlocks.Add(child);
|
fBlocks.Add(child);
|
||||||
return B_OK;
|
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:
|
default:
|
||||||
return DIEDeclaredNamedBase::AddChild(child);
|
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
|
// #pragma mark - DIETemplateTypeParameter
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1217,9 +1217,16 @@ public:
|
|||||||
const DebugInfoEntryList Parameters() const { return fParameters; }
|
const DebugInfoEntryList Parameters() const { return fParameters; }
|
||||||
const DebugInfoEntryList Variables() const { return fVariables; }
|
const DebugInfoEntryList Variables() const { return fVariables; }
|
||||||
const DebugInfoEntryList Blocks() const { return fBlocks; }
|
const DebugInfoEntryList Blocks() const { return fBlocks; }
|
||||||
|
const DebugInfoEntryList TemplateTypeParameters() const
|
||||||
|
{ return fTemplateTypeParameters; }
|
||||||
|
const DebugInfoEntryList TemplateValueParameters() const
|
||||||
|
{ return fTemplateValueParameters; }
|
||||||
|
|
||||||
bool IsPrototyped() const { return fPrototyped; }
|
bool IsPrototyped() const { return fPrototyped; }
|
||||||
uint8 Inline() const { return fInline; }
|
uint8 Inline() const { return fInline; }
|
||||||
|
bool IsArtificial() const { return fArtificial; }
|
||||||
|
|
||||||
|
DIEType* ReturnType() const { return fReturnType; }
|
||||||
|
|
||||||
virtual status_t AddChild(DebugInfoEntry* child);
|
virtual status_t AddChild(DebugInfoEntry* child);
|
||||||
|
|
||||||
@@ -1245,11 +1252,16 @@ public:
|
|||||||
virtual status_t AddAttribute_frame_base(
|
virtual status_t AddAttribute_frame_base(
|
||||||
uint16 attributeName,
|
uint16 attributeName,
|
||||||
const AttributeValue& value);
|
const AttributeValue& value);
|
||||||
|
virtual status_t AddAttribute_artificial(
|
||||||
|
uint16 attributeName,
|
||||||
|
const AttributeValue& value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DebugInfoEntryList fParameters;
|
DebugInfoEntryList fParameters;
|
||||||
DebugInfoEntryList fVariables;
|
DebugInfoEntryList fVariables;
|
||||||
DebugInfoEntryList fBlocks;
|
DebugInfoEntryList fBlocks;
|
||||||
|
DebugInfoEntryList fTemplateTypeParameters;
|
||||||
|
DebugInfoEntryList fTemplateValueParameters;
|
||||||
target_addr_t fLowPC;
|
target_addr_t fLowPC;
|
||||||
target_addr_t fHighPC;
|
target_addr_t fHighPC;
|
||||||
off_t fAddressRangesOffset;
|
off_t fAddressRangesOffset;
|
||||||
@@ -1260,9 +1272,9 @@ protected:
|
|||||||
uint8 fAddressClass;
|
uint8 fAddressClass;
|
||||||
bool fPrototyped;
|
bool fPrototyped;
|
||||||
uint8 fInline;
|
uint8 fInline;
|
||||||
|
bool fArtificial;
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// DW_AT_artificial
|
|
||||||
// DW_AT_calling_convention
|
// DW_AT_calling_convention
|
||||||
// DW_AT_elemental
|
// DW_AT_elemental
|
||||||
// DW_AT_entry_pc
|
// DW_AT_entry_pc
|
||||||
|
|||||||
Reference in New Issue
Block a user