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:
@@ -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
|
#endif // ATTRIBUTE_VALUE_H
|
||||||
|
|||||||
@@ -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
|
// #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
|
// #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
|
// #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
|
// #pragma mark - DebugInfoEntryFactory
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -246,8 +246,14 @@ class DIEDeclaredType : public DIEType {
|
|||||||
public:
|
public:
|
||||||
DIEDeclaredType();
|
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:
|
// TODO:
|
||||||
// DECL
|
|
||||||
// DW_AT_accessibility // !file, !pointer to member
|
// DW_AT_accessibility // !file, !pointer to member
|
||||||
// DW_AT_declaration // !file
|
// DW_AT_declaration // !file
|
||||||
// DW_AT_abstract_origin // !interface
|
// DW_AT_abstract_origin // !interface
|
||||||
@@ -255,6 +261,7 @@ public:
|
|||||||
// DW_AT_visibility // !interface
|
// DW_AT_visibility // !interface
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
DeclarationLocation fDeclarationLocation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -759,8 +766,15 @@ public:
|
|||||||
|
|
||||||
virtual uint16 Tag() const;
|
virtual uint16 Tag() const;
|
||||||
|
|
||||||
// TODO:
|
virtual status_t AddAttribute_decl_file(uint16 attributeName,
|
||||||
// DECL
|
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 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:
|
// TODO:
|
||||||
// DECL
|
|
||||||
// DW_AT_description
|
// DW_AT_description
|
||||||
|
|
||||||
|
private:
|
||||||
|
DeclarationLocation fDeclarationLocation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -852,12 +875,16 @@ public:
|
|||||||
|
|
||||||
virtual status_t AddAttribute_count(uint16 attributeName,
|
virtual status_t AddAttribute_count(uint16 attributeName,
|
||||||
const AttributeValue& value);
|
const AttributeValue& value);
|
||||||
|
virtual status_t AddAttribute_decl_file(uint16 attributeName,
|
||||||
// TODO:
|
const AttributeValue& value);
|
||||||
// DECL
|
virtual status_t AddAttribute_decl_line(uint16 attributeName,
|
||||||
|
const AttributeValue& value);
|
||||||
|
virtual status_t AddAttribute_decl_column(uint16 attributeName,
|
||||||
|
const AttributeValue& value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64 fBlockSize;
|
uint64 fBlockSize;
|
||||||
|
DeclarationLocation fDeclarationLocation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user