From 9229ba0fe9b04a7eab116925ecdee4797815281d Mon Sep 17 00:00:00 2001 From: asynts Date: Fri, 15 Jan 2021 21:46:23 +0100 Subject: Everywhere: Replace a bundle of dbg with dbgln. These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect. --- Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp') diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp index 2bc89a885f..180c0f7c95 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp @@ -25,11 +25,10 @@ */ #include "LineProgram.h" +#include #include #include -//#define DWARF_DEBUG - namespace Debug::Dwarf { LineProgram::LineProgram(InputMemoryStream& stream) @@ -236,10 +235,10 @@ void LineProgram::handle_sepcial_opcode(u8 opcode) m_address += address_increment; m_line += line_increment; -#ifdef DWARF_DEBUG - dbgln("Special adjusted_opcode: {}, address_increment: {}, line_increment: {}", adjusted_opcode, address_increment, line_increment); - dbg() << "Address is now:" << (void*)m_address << ", and line is: " << m_source_files[m_file_index].name << ":" << m_line; -#endif + if constexpr (debug_dwarf) { + dbgln("Special adjusted_opcode: {}, address_increment: {}, line_increment: {}", adjusted_opcode, address_increment, line_increment); + dbgln("Address is now: {:p}, and line is: {}:{}", m_address, m_source_files[m_file_index].name, m_line); + } append_to_line_info(); } @@ -252,9 +251,7 @@ void LineProgram::run_program() u8 opcode = 0; m_stream >> opcode; -#ifdef DWARF_DEBUG - dbg() << (void*)(m_stream.offset() - 1) << ": opcode: " << opcode; -#endif + dbgln("{:p}: opcode: {}", m_stream.offset() - 1, opcode); if (opcode == 0) { handle_extended_opcode(); -- cgit v1.2.3