mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:17:45 +00:00
LibDebug: Stub out LocListX and remove stub expression evaluator
The expression evaluator is dead code that does nothing but crash on all paths, as no opcodes are implemented. Stubbing out the LocListX form fixes a crash while reading DWARF 5 debug data that contains location lists. These are just a new way to store location expressions, and since we never implemented expressions, we can just ignore these too. As far as I can tell this is enough for DWARF 5 to work for us (since we mainly just use the line tables).
This commit is contained in:
parent
ce634957c1
commit
cf79df0edb
5 changed files with 6 additions and 84 deletions
|
@ -272,6 +272,7 @@ ErrorOr<AttributeValue> DwarfInfo::get_attribute_value(AttributeDataForm form, s
|
|||
value.m_data.as_unsigned = index;
|
||||
break;
|
||||
}
|
||||
case AttributeDataForm::LocListX:
|
||||
case AttributeDataForm::RngListX: {
|
||||
size_t index = TRY(debug_info_stream.read_value<LEB128<size_t>>());
|
||||
value.m_type = AttributeValue::Type::UnsignedNumber;
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "Expression.h"
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <sys/arch/regs.h>
|
||||
|
||||
namespace Debug::Dwarf::Expression {
|
||||
|
||||
ErrorOr<Value> evaluate(ReadonlyBytes bytes, [[maybe_unused]] PtraceRegisters const& regs)
|
||||
{
|
||||
FixedMemoryStream stream { bytes };
|
||||
|
||||
while (!stream.is_eof()) {
|
||||
auto opcode = TRY(stream.read_value<u8>());
|
||||
|
||||
switch (static_cast<Operations>(opcode)) {
|
||||
|
||||
default:
|
||||
dbgln("DWARF expr addr: {:p}", bytes.data());
|
||||
dbgln("unsupported opcode: {}", opcode);
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
struct PtraceRegisters;
|
||||
|
||||
namespace Debug::Dwarf::Expression {
|
||||
|
||||
enum class Type {
|
||||
None,
|
||||
UnsignedInteger,
|
||||
Register,
|
||||
};
|
||||
|
||||
struct Value {
|
||||
Type type;
|
||||
union {
|
||||
FlatPtr as_addr;
|
||||
u32 as_u32;
|
||||
} data { 0 };
|
||||
};
|
||||
|
||||
enum class Operations : u8 {
|
||||
RegEbp = 0x75,
|
||||
FbReg = 0x91,
|
||||
};
|
||||
|
||||
ErrorOr<Value> evaluate(ReadonlyBytes, PtraceRegisters const&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue