summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-09 15:07:10 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-09 15:22:23 +0100
commitd56f4f635a497a5a7aa21031a4ef6f559353601d (patch)
tree8f4380e1f69353b9faa621023b27fbe94147d368
parent08190dd0ce5f23de6dffcd2c7521314202b05514 (diff)
downloadserenity-d56f4f635a497a5a7aa21031a4ef6f559353601d.zip
LibDebug: Convert a bunch of dbg() to dbgln()
-rw-r--r--Libraries/LibDebug/DebugInfo.cpp8
-rw-r--r--Libraries/LibDebug/DebugSession.h2
-rw-r--r--Libraries/LibDebug/Dwarf/DIE.cpp2
-rw-r--r--Libraries/LibDebug/Dwarf/Expression.cpp4
-rw-r--r--Libraries/LibDebug/Dwarf/LineProgram.cpp29
5 files changed, 22 insertions, 23 deletions
diff --git a/Libraries/LibDebug/DebugInfo.cpp b/Libraries/LibDebug/DebugInfo.cpp
index 907d3f4c8d..c9e773d0ac 100644
--- a/Libraries/LibDebug/DebugInfo.cpp
+++ b/Libraries/LibDebug/DebugInfo.cpp
@@ -64,13 +64,13 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
if (child.get_attribute(Dwarf::Attribute::Inline).has_value()) {
#ifdef DEBUG_SPAM
- dbg() << "DWARF inlined functions are not supported";
+ dbgln("DWARF inlined functions are not supported");
#endif
return;
}
if (child.get_attribute(Dwarf::Attribute::Ranges).has_value()) {
#ifdef DEBUG_SPAM
- dbg() << "DWARF ranges are not supported";
+ dbgln("DWARF ranges are not supported");
#endif
return;
}
@@ -83,7 +83,7 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
if (!child.get_attribute(Dwarf::Attribute::LowPc).has_value()) {
#ifdef DEBUG_SPAM
- dbg() << "DWARF: Couldn't find attribute LowPc for scope";
+ dbgln("DWARF: Couldn't find attribute LowPc for scope");
#endif
return;
}
@@ -215,7 +215,7 @@ static Optional<Dwarf::DIE> parse_variable_type_die(const Dwarf::DIE& variable_d
if (type_name.has_value()) {
variable_info.type_name = type_name.value().data.as_string;
} else {
- dbg() << "Unnamed DWARF type at offset: " << type_die.offset();
+ dbgln("Unnamed DWARF type at offset: {}", type_die.offset());
variable_info.name = "[Unnamed Type]";
}
diff --git a/Libraries/LibDebug/DebugSession.h b/Libraries/LibDebug/DebugSession.h
index 5081135b1a..bc8bde54f7 100644
--- a/Libraries/LibDebug/DebugSession.h
+++ b/Libraries/LibDebug/DebugSession.h
@@ -90,7 +90,7 @@ public:
void dump_breakpoints()
{
for (auto addr : m_breakpoints.keys()) {
- dbg() << addr;
+ dbgln("{}", addr);
}
}
diff --git a/Libraries/LibDebug/Dwarf/DIE.cpp b/Libraries/LibDebug/Dwarf/DIE.cpp
index d96dbd3cb5..96ad0875d6 100644
--- a/Libraries/LibDebug/Dwarf/DIE.cpp
+++ b/Libraries/LibDebug/Dwarf/DIE.cpp
@@ -180,7 +180,7 @@ DIE::AttributeValue DIE::get_attribute_value(AttributeDataForm form,
break;
}
default:
- dbg() << "Unimplemented AttributeDataForm: " << (u32)form;
+ dbgln("Unimplemented AttributeDataForm: {}", (u32)form);
ASSERT_NOT_REACHED();
}
return value;
diff --git a/Libraries/LibDebug/Dwarf/Expression.cpp b/Libraries/LibDebug/Dwarf/Expression.cpp
index b364beb6de..fe50d1aed3 100644
--- a/Libraries/LibDebug/Dwarf/Expression.cpp
+++ b/Libraries/LibDebug/Dwarf/Expression.cpp
@@ -53,8 +53,8 @@ Value evaluate(ReadonlyBytes bytes, const PtraceRegisters& regs)
}
default:
- dbg() << "DWARF expr addr: " << (const void*)bytes.data();
- dbg() << "unsupported opcode: " << (u8)opcode;
+ dbgln("DWARF expr addr: {}", (const void*)bytes.data());
+ dbgln("unsupported opcode: {}", (u8)opcode);
ASSERT_NOT_REACHED();
}
}
diff --git a/Libraries/LibDebug/Dwarf/LineProgram.cpp b/Libraries/LibDebug/Dwarf/LineProgram.cpp
index a6d165db86..2bc89a885f 100644
--- a/Libraries/LibDebug/Dwarf/LineProgram.cpp
+++ b/Libraries/LibDebug/Dwarf/LineProgram.cpp
@@ -50,7 +50,7 @@ void LineProgram::parse_unit_header()
ASSERT(m_unit_header.opcode_base == SPECIAL_OPCODES_BASE);
#ifdef DWARF_DEBUG
- dbg() << "unit length: " << m_unit_header.length;
+ dbgln("unit length: {}", m_unit_header.length);
#endif
}
@@ -62,7 +62,7 @@ void LineProgram::parse_source_directories()
String directory;
m_stream >> directory;
#ifdef DWARF_DEBUG
- dbg() << "directory: " << directory;
+ dbgln("directory: {}", directory);
#endif
m_source_directories.append(move(directory));
}
@@ -83,7 +83,7 @@ void LineProgram::parse_source_files()
m_stream.read_LEB128_unsigned(_unused); // skip modification time
m_stream.read_LEB128_unsigned(_unused); // skip file size
#ifdef DWARF_DEBUG
- dbg() << "file: " << file_name << ", directory index: " << directory_index;
+ dbgln("file: {}, directory index: {}", file_name, directory_index);
#endif
m_source_files.append({ file_name, directory_index });
}
@@ -94,7 +94,7 @@ void LineProgram::parse_source_files()
void LineProgram::append_to_line_info()
{
#ifdef DWARF_DEBUG
- dbg() << "appending line info: " << (void*)m_address << ", " << m_source_files[m_file_index].name << ":" << m_line;
+ dbgln("appending line info: {:p}, {}:{}", m_address, m_source_files[m_file_index].name, m_line);
#endif
if (!m_is_statement)
return;
@@ -135,20 +135,20 @@ void LineProgram::handle_extended_opcode()
ASSERT(length == sizeof(size_t) + 1);
m_stream >> m_address;
#ifdef DWARF_DEBUG
- dbg() << "SetAddress: " << (void*)m_address;
+ dbgln("SetAddress: {:p}", m_address);
#endif
break;
}
case ExtendedOpcodes::SetDiscriminator: {
#ifdef DWARF_DEBUG
- dbg() << "SetDiscriminator";
+ dbgln("SetDiscriminator");
#endif
m_stream.discard_or_error(1);
break;
}
default:
#ifdef DWARF_DEBUG
- dbg() << "offset: " << (void*)m_stream.offset();
+ dbgln("offset: {:p}", m_stream.offset());
#endif
ASSERT_NOT_REACHED();
}
@@ -165,7 +165,7 @@ void LineProgram::handle_standard_opcode(u8 opcode)
m_stream.read_LEB128_unsigned(operand);
size_t delta = operand * m_unit_header.min_instruction_length;
#ifdef DWARF_DEBUG
- dbg() << "AdvnacePC by: " << delta << " to: " << (void*)(m_address + delta);
+ dbgln("AdvancePC by: {} to: {:p}", delta, m_address + delta);
#endif
m_address += delta;
break;
@@ -174,7 +174,7 @@ void LineProgram::handle_standard_opcode(u8 opcode)
size_t new_file_index = 0;
m_stream.read_LEB128_unsigned(new_file_index);
#ifdef DWARF_DEBUG
- dbg() << "SetFile: new file index: " << new_file_index;
+ dbgln("SetFile: new file index: {}", new_file_index);
#endif
m_file_index = new_file_index;
break;
@@ -182,7 +182,7 @@ void LineProgram::handle_standard_opcode(u8 opcode)
case StandardOpcodes::SetColumn: {
// not implemented
#ifdef DWARF_DEBUG
- dbg() << "SetColumn";
+ dbgln("SetColumn");
#endif
size_t new_column;
m_stream.read_LEB128_unsigned(new_column);
@@ -192,17 +192,16 @@ void LineProgram::handle_standard_opcode(u8 opcode)
case StandardOpcodes::AdvanceLine: {
ssize_t line_delta;
m_stream.read_LEB128_signed(line_delta);
- // dbg() << "line_delta: " << line_delta;
ASSERT(line_delta >= 0 || m_line >= (size_t)(-line_delta));
m_line += line_delta;
#ifdef DWARF_DEBUG
- dbg() << "AdvanceLine: " << m_line;
+ dbgln("AdvanceLine: {}", m_line);
#endif
break;
}
case StandardOpcodes::NegateStatement: {
#ifdef DWARF_DEBUG
- dbg() << "NegateStatement";
+ dbgln("NegateStatement");
#endif
m_is_statement = !m_is_statement;
break;
@@ -212,7 +211,7 @@ void LineProgram::handle_standard_opcode(u8 opcode)
ssize_t address_increment = (adjusted_opcode / m_unit_header.line_range) * m_unit_header.min_instruction_length;
address_increment *= m_unit_header.min_instruction_length;
#ifdef DWARF_DEBUG
- dbg() << "ConstAddPc: advance pc by: " << address_increment << " to: " << (m_address + address_increment);
+ dbgln("ConstAddPc: advance pc by: {} to: {}", address_increment, (m_address + address_increment));
#endif
m_address += address_increment;
break;
@@ -238,7 +237,7 @@ void LineProgram::handle_sepcial_opcode(u8 opcode)
m_line += line_increment;
#ifdef DWARF_DEBUG
- dbg() << "Special adjusted_opcode: " << adjusted_opcode << ", delta_address: " << address_increment << ", delta_line: " << line_increment;
+ 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