DIESubprogram: Add parsing for main subprogram attribute.

- Will be used later to recognize the main function of a given program.
This commit is contained in:
Rene Gollent
2013-05-28 22:36:55 -04:00
parent cc428f5bbf
commit 54a0525eca
2 changed files with 22 additions and 0 deletions
@@ -1840,6 +1840,7 @@ DIESubprogram::DIESubprogram()
fAddressClass(0),
fPrototyped(false),
fInline(DW_INL_not_inlined),
fMain(false),
fArtificial(false),
fCallingConvention(DW_CC_normal)
{
@@ -1893,6 +1894,9 @@ DIESubprogram::AddChild(DebugInfoEntry* child)
case DW_TAG_template_value_parameter:
fTemplateValueParameters.Add(child);
return B_OK;
case DW_TAG_GNU_call_site:
fCallSites.Add(child);
return B_OK;
default:
return DIEDeclaredNamedBase::AddChild(child);
}
@@ -2018,6 +2022,15 @@ DIESubprogram::AddAttribute_calling_convention(uint16 attributeName,
}
status_t
DIESubprogram::AddAttribute_main_subprogram(uint16 attributeName,
const AttributeValue& value)
{
fMain = true;
return B_OK;
}
// #pragma mark - DIETemplateTypeParameter
@@ -1225,12 +1225,15 @@ public:
{ return fTemplateTypeParameters; }
const DebugInfoEntryList TemplateValueParameters() const
{ return fTemplateValueParameters; }
const DebugInfoEntryList CallSites() const
{ return fCallSites; }
bool IsPrototyped() const { return fPrototyped; }
uint8 Inline() const { return fInline; }
bool IsArtificial() const { return fArtificial; }
uint8 CallingConvention() const
{ return fCallingConvention; }
bool IsMain() const { return fMain; }
DIEType* ReturnType() const { return fReturnType; }
@@ -1264,6 +1267,10 @@ public:
virtual status_t AddAttribute_calling_convention(
uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_main_subprogram(
uint16 attributeName,
const AttributeValue& value);
protected:
DebugInfoEntryList fParameters;
@@ -1271,6 +1278,7 @@ protected:
DebugInfoEntryList fBlocks;
DebugInfoEntryList fTemplateTypeParameters;
DebugInfoEntryList fTemplateValueParameters;
DebugInfoEntryList fCallSites;
target_addr_t fLowPC;
target_addr_t fHighPC;
off_t fAddressRangesOffset;
@@ -1281,6 +1289,7 @@ protected:
uint8 fAddressClass;
bool fPrototyped;
uint8 fInline;
bool fMain;
bool fArtificial;
uint8 fCallingConvention;