From 3a5f9b2f7e254cb2bc3b069373d828d1e8f7868a Mon Sep 17 00:00:00 2001 From: spigwitmer Date: Sun, 2 May 2021 14:02:14 -0400 Subject: [PATCH] LibDebug: add DW_LNS_set_basic_block support This adds support for the basic_block register to the Dwarf line number state machine. --- Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp | 6 ++++++ Userland/Libraries/LibDebug/Dwarf/LineProgram.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp index d9f8d14fbc0..238d071fe40 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp @@ -242,6 +242,10 @@ void LineProgram::handle_standard_opcode(u8 opcode) m_address += delta; break; } + case StandardOpcodes::SetBasicBlock: { + m_basic_block = true; + break; + } default: dbgln("Unhandled LineProgram opcode {}", opcode); VERIFY_NOT_REACHED(); @@ -262,6 +266,8 @@ void LineProgram::handle_special_opcode(u8 opcode) } append_to_line_info(); + + m_basic_block = false; } void LineProgram::run_program() diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h index 5c103ad01e8..bef5f211455 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h @@ -171,6 +171,7 @@ private: size_t m_line { 0 }; size_t m_file_index { 0 }; bool m_is_statement { false }; + bool m_basic_block { false }; Vector m_lines; };