Serenity Operating System
1/*
2 * Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include "Expression.h"
8
9#include <AK/Format.h>
10#include <AK/MemoryStream.h>
11#include <sys/arch/regs.h>
12
13namespace Debug::Dwarf::Expression {
14
15ErrorOr<Value> evaluate(ReadonlyBytes bytes, [[maybe_unused]] PtraceRegisters const& regs)
16{
17 FixedMemoryStream stream { bytes };
18
19 while (!stream.is_eof()) {
20 auto opcode = TRY(stream.read_value<u8>());
21
22 switch (static_cast<Operations>(opcode)) {
23
24 default:
25 dbgln("DWARF expr addr: {:p}", bytes.data());
26 dbgln("unsupported opcode: {}", opcode);
27 VERIFY_NOT_REACHED();
28 }
29 }
30 VERIFY_NOT_REACHED();
31}
32
33}