Support DW_AT_decl_{file,line,column} attributes for types.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31049 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-06-14 14:02:50 +00:00
parent 1b83621bf1
commit 676040f030
3 changed files with 171 additions and 7 deletions

View File

@ -66,4 +66,33 @@ struct DynamicAttributeValue {
};
struct DeclarationLocation {
uint32 file;
uint32 line;
uint32 column;
DeclarationLocation()
:
file(0),
line(0),
column(0)
{
}
void SetFile(uint32 file)
{
this->file = file;
}
void SetLine(uint32 line)
{
this->line = line;
}
void SetColumn(uint32 column)
{
this->column = column;
}
};
#endif // ATTRIBUTE_VALUE_H

View File

@ -273,6 +273,33 @@ DIEDeclaredType::DIEDeclaredType()
}
status_t
DIEDeclaredType::AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetFile(value.constant);
return B_OK;
}
status_t
DIEDeclaredType::AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetLine(value.constant);
return B_OK;
}
status_t
DIEDeclaredType::AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetColumn(value.constant);
return B_OK;
}
// #pragma mark - DIEDerivedType
@ -1128,6 +1155,33 @@ DIEVolatileType::Tag() const
}
status_t
DIEVolatileType::AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetFile(value.constant);
return B_OK;
}
status_t
DIEVolatileType::AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetLine(value.constant);
return B_OK;
}
status_t
DIEVolatileType::AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetColumn(value.constant);
return B_OK;
}
// #pragma mark - DIEDwarfProcedure
@ -1218,6 +1272,33 @@ DIEUnspecifiedType::Tag() const
}
status_t
DIEUnspecifiedType::AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetFile(value.constant);
return B_OK;
}
status_t
DIEUnspecifiedType::AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetLine(value.constant);
return B_OK;
}
status_t
DIEUnspecifiedType::AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetColumn(value.constant);
return B_OK;
}
// #pragma mark - DIEPartialUnit
@ -1289,6 +1370,33 @@ DIESharedType::AddAttribute_count(uint16 attributeName,
}
status_t
DIESharedType::AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetFile(value.constant);
return B_OK;
}
status_t
DIESharedType::AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetLine(value.constant);
return B_OK;
}
status_t
DIESharedType::AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value)
{
fDeclarationLocation.SetColumn(value.constant);
return B_OK;
}
// #pragma mark - DebugInfoEntryFactory

View File

@ -246,8 +246,14 @@ class DIEDeclaredType : public DIEType {
public:
DIEDeclaredType();
virtual status_t AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value);
// TODO:
// DECL
// DW_AT_accessibility // !file, !pointer to member
// DW_AT_declaration // !file
// DW_AT_abstract_origin // !interface
@ -255,6 +261,7 @@ public:
// DW_AT_visibility // !interface
protected:
DeclarationLocation fDeclarationLocation;
};
@ -759,8 +766,15 @@ public:
virtual uint16 Tag() const;
// TODO:
// DECL
virtual status_t AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value);
private:
DeclarationLocation fDeclarationLocation;
};
@ -810,9 +824,18 @@ public:
virtual uint16 Tag() const;
virtual status_t AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value);
// TODO:
// DECL
// DW_AT_description
private:
DeclarationLocation fDeclarationLocation;
};
@ -852,12 +875,16 @@ public:
virtual status_t AddAttribute_count(uint16 attributeName,
const AttributeValue& value);
// TODO:
// DECL
virtual status_t AddAttribute_decl_file(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_line(uint16 attributeName,
const AttributeValue& value);
virtual status_t AddAttribute_decl_column(uint16 attributeName,
const AttributeValue& value);
private:
uint64 fBlockSize;
DeclarationLocation fDeclarationLocation;
};