mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
LibDebug: Add AttributeForm field to Dwarf::AttributeValue
In some contexts, it's helpful to also know the "Attribute Form", in addition to the "Attribute Type". An example for such context is the interpretation of the "DW_AT_high_pc" attribute, which has different meaning if the form is an address or a constant.
This commit is contained in:
parent
a45ce0c6eb
commit
84609aecc1
2 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
|
#include <LibDebug/Dwarf/DwarfTypes.h>
|
||||||
|
|
||||||
namespace Debug::Dwarf {
|
namespace Debug::Dwarf {
|
||||||
|
|
||||||
|
@ -34,6 +35,8 @@ struct AttributeValue {
|
||||||
const u8* bytes; // points to bytes in the memory mapped elf image
|
const u8* bytes; // points to bytes in the memory mapped elf image
|
||||||
} as_raw_bytes;
|
} as_raw_bytes;
|
||||||
} data {};
|
} data {};
|
||||||
|
|
||||||
|
AttributeDataForm form {};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "DwarfInfo.h"
|
#include "DwarfInfo.h"
|
||||||
|
#include "AttributeValue.h"
|
||||||
|
|
||||||
#include <AK/MemoryStream.h>
|
#include <AK/MemoryStream.h>
|
||||||
|
|
||||||
|
@ -61,6 +62,7 @@ AttributeValue DwarfInfo::get_attribute_value(AttributeDataForm form, ssize_t im
|
||||||
InputMemoryStream& debug_info_stream, const CompilationUnit* unit) const
|
InputMemoryStream& debug_info_stream, const CompilationUnit* unit) const
|
||||||
{
|
{
|
||||||
AttributeValue value;
|
AttributeValue value;
|
||||||
|
value.form = form;
|
||||||
|
|
||||||
auto assign_raw_bytes_value = [&](size_t length) {
|
auto assign_raw_bytes_value = [&](size_t length) {
|
||||||
value.data.as_raw_bytes.length = length;
|
value.data.as_raw_bytes.length = length;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue