Implement parsing of DW_AT_calling_convention.

Will be used later in order to determine if a given call obeys the
standard calling convention, in order to determine if we can safely
attempt to retrieve its return value.
This commit is contained in:
Rene Gollent
2011-12-12 22:16:17 -05:00
parent 0e35d5d2e5
commit adaf4b3db1
2 changed files with 17 additions and 2 deletions
+11 -1
View File
@@ -1837,7 +1837,8 @@ DIESubprogram::DIESubprogram()
fAddressClass(0), fAddressClass(0),
fPrototyped(false), fPrototyped(false),
fInline(DW_INL_not_inlined), fInline(DW_INL_not_inlined),
fArtificial(false) fArtificial(false),
fCallingConvention(DW_CC_normal)
{ {
} }
@@ -2005,6 +2006,15 @@ DIESubprogram::AddAttribute_artificial(uint16 attributeName,
} }
status_t
DIESubprogram::AddAttribute_calling_convention(uint16 attributeName,
const AttributeValue& value)
{
fCallingConvention = value.constant;
return B_OK;
}
// #pragma mark - DIETemplateTypeParameter // #pragma mark - DIETemplateTypeParameter
+6 -1
View File
@@ -1225,6 +1225,8 @@ public:
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; } bool IsArtificial() const { return fArtificial; }
uint8 CallingConvention() const
{ return fCallingConvention; }
DIEType* ReturnType() const { return fReturnType; } DIEType* ReturnType() const { return fReturnType; }
@@ -1255,6 +1257,9 @@ public:
virtual status_t AddAttribute_artificial( virtual status_t AddAttribute_artificial(
uint16 attributeName, uint16 attributeName,
const AttributeValue& value); const AttributeValue& value);
virtual status_t AddAttribute_calling_convention(
uint16 attributeName,
const AttributeValue& value);
protected: protected:
DebugInfoEntryList fParameters; DebugInfoEntryList fParameters;
@@ -1273,9 +1278,9 @@ protected:
bool fPrototyped; bool fPrototyped;
uint8 fInline; uint8 fInline;
bool fArtificial; bool fArtificial;
uint8 fCallingConvention;
// TODO: // TODO:
// DW_AT_calling_convention
// DW_AT_elemental // DW_AT_elemental
// DW_AT_entry_pc // DW_AT_entry_pc
// DW_AT_explicit // DW_AT_explicit