diff --git a/Libraries/LibELF/DynamicLoader.cpp b/Libraries/LibELF/DynamicLoader.cpp index ffac3283bd..9c7fd88969 100644 --- a/Libraries/LibELF/DynamicLoader.cpp +++ b/Libraries/LibELF/DynamicLoader.cpp @@ -35,7 +35,9 @@ #include #include -#define DYNAMIC_LOAD_DEBUG +#ifndef DYNAMIC_LOAD_DEBUG +# define DYNAMIC_LOAD_DEBUG +#endif //#define DYNAMIC_LOAD_VERBOSE #ifdef DYNAMIC_LOAD_VERBOSE @@ -82,8 +84,7 @@ DynamicLoader::DynamicLoader(const char* filename, int fd, size_t size) auto* elf_header = (Elf32_Ehdr*)m_file_mapping; - if (!validate_elf_header(*elf_header, m_file_size) || - !validate_program_headers(*elf_header, m_file_size, (u8*)m_file_mapping, m_file_size, m_program_interpreter)) { + if (!validate_elf_header(*elf_header, m_file_size) || !validate_program_headers(*elf_header, m_file_size, (u8*)m_file_mapping, m_file_size, m_program_interpreter)) { m_valid = false; } } diff --git a/Libraries/LibELF/DynamicObject.cpp b/Libraries/LibELF/DynamicObject.cpp index d12d940ac6..9f104981cf 100644 --- a/Libraries/LibELF/DynamicObject.cpp +++ b/Libraries/LibELF/DynamicObject.cpp @@ -263,7 +263,7 @@ const DynamicObject::Symbol DynamicObject::HashSection::lookup_symbol(const char auto symbol = m_dynamic.symbol(i); if (strcmp(name, symbol.name()) == 0) { #ifdef DYNAMIC_LOAD_DEBUG - dbgprintf("Returning dynamic symbol with index %d for %s: %p\n", i, symbol.name(), symbol.address()); + dbgprintf("Returning dynamic symbol with index %u for %s: %p\n", i, symbol.name(), symbol.address().as_ptr()); #endif return symbol; } diff --git a/Libraries/LibELF/Image.cpp b/Libraries/LibELF/Image.cpp index 714ae98cee..9cb0583b4e 100644 --- a/Libraries/LibELF/Image.cpp +++ b/Libraries/LibELF/Image.cpp @@ -271,7 +271,7 @@ const Image::RelocationSection Image::Section::relocations() const return static_cast(m_image.section(0)); #ifdef Image_DEBUG - dbgprintf("Found relocations for %s in %s\n", name(), relocation_section.name()); + dbgprintf("Found relocations for %s in %s\n", name().to_string().characters(), relocation_section.name().to_string().characters()); #endif return static_cast(relocation_section); } diff --git a/Libraries/LibELF/Loader.cpp b/Libraries/LibELF/Loader.cpp index f851fd9157..42740f95e2 100644 --- a/Libraries/LibELF/Loader.cpp +++ b/Libraries/LibELF/Loader.cpp @@ -87,10 +87,10 @@ bool Loader::layout() } if (program_header.type() != PT_LOAD) return; -#ifdef Loader_DEBUG - kprintf("PH: V%p %u r:%u w:%u\n", program_header.vaddr().get(), program_header.size_in_memory(), program_header.is_readable(), program_header.is_writable()); -#endif #ifdef KERNEL +# ifdef Loader_DEBUG + kprintf("PH: V%p %u r:%u w:%u\n", program_header.vaddr().get(), program_header.size_in_memory(), program_header.is_readable(), program_header.is_writable()); +# endif if (program_header.is_writable()) { auto* allocated_section = alloc_section_hook( program_header.vaddr(), diff --git a/Libraries/LibGfx/Painter.cpp b/Libraries/LibGfx/Painter.cpp index b483ab30d2..38c972ec92 100644 --- a/Libraries/LibGfx/Painter.cpp +++ b/Libraries/LibGfx/Painter.cpp @@ -1349,7 +1349,7 @@ void Painter::draw_quadratic_bezier_curve(const IntPoint& control_point, const I void Painter::for_each_line_segment_on_elliptical_arc(const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& center, const FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, Function& callback) { - if (can_approximate_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta)) { + if (can_approximate_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta)) { callback(p1, p2); } else { split_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, callback); @@ -1568,8 +1568,9 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule) #ifdef FILL_PATH_DEBUG size_t i { 0 }; - for (auto& segment : segments) - draw_line(segment.from, segment.to, Color::from_hsv(++i / segments.size() * 360.0, 1.0, 1.0), 1); + for (auto& segment : segments) { + draw_line(Point(segment.from), Point(segment.to), Color::from_hsv(++i / segments.size() * 360.0, 1.0, 1.0), 1); + } #endif } diff --git a/Libraries/LibJS/Runtime/Object.cpp b/Libraries/LibJS/Runtime/Object.cpp index d5797deec4..b729c9bb78 100644 --- a/Libraries/LibJS/Runtime/Object.cpp +++ b/Libraries/LibJS/Runtime/Object.cpp @@ -387,7 +387,7 @@ bool Object::define_property(const StringOrSymbol& property_name, const Object& } #ifdef OBJECT_DEBUG - dbg() << "Defining new property " << property_name << " with accessor descriptor { attributes=" << attributes << ", " + dbg() << "Defining new property " << property_name.to_display_string() << " with accessor descriptor { attributes=" << attributes << ", " << "getter=" << getter.to_string_without_side_effects() << ", " << "setter=" << setter.to_string_without_side_effects() << "}"; #endif @@ -409,7 +409,7 @@ bool Object::define_property(const StringOrSymbol& property_name, const Object& return {}; #ifdef OBJECT_DEBUG - dbg() << "Defining new property " << property_name << " with data descriptor { attributes=" << attributes + dbg() << "Defining new property " << property_name.to_display_string() << " with data descriptor { attributes=" << attributes << ", value=" << (value.is_empty() ? "" : value.to_string_without_side_effects()) << " }"; #endif @@ -512,7 +512,7 @@ bool Object::put_own_property(Object& this_object, const StringOrSymbol& propert metadata = shape().lookup(property_name); #ifdef OBJECT_DEBUG - dbg() << "Reconfigured property " << property_name << ", new shape says offset is " << metadata.value().offset << " and my storage capacity is " << m_storage.size(); + dbg() << "Reconfigured property " << property_name.to_display_string() << ", new shape says offset is " << metadata.value().offset << " and my storage capacity is " << m_storage.size(); #endif } diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp index 9ec0e61e2b..bc49f82562 100644 --- a/Libraries/LibVT/Terminal.cpp +++ b/Libraries/LibVT/Terminal.cpp @@ -706,8 +706,12 @@ void Terminal::execute_escape_sequence(u8 final) dbgprintf("\n"); for (auto& line : m_lines) { dbgprintf("Terminal: Line: "); - for (int i = 0; i < line.m_length; i++) { - dbgprintf("%c", line.characters[i]); + for (int i = 0; i < line.length(); i++) { + u32 codepoint = line.code_point(i); + if (codepoint < 128) + dbgprintf("%c", (char)codepoint); + else + dbgprintf("", codepoint); } dbgprintf("\n"); } diff --git a/Libraries/LibWeb/OutOfProcessWebView.cpp b/Libraries/LibWeb/OutOfProcessWebView.cpp index 203dd1605a..fdd4ac38f1 100644 --- a/Libraries/LibWeb/OutOfProcessWebView.cpp +++ b/Libraries/LibWeb/OutOfProcessWebView.cpp @@ -109,7 +109,7 @@ void OutOfProcessWebView::notify_server_did_paint(Badge, i32 s void OutOfProcessWebView::notify_server_did_invalidate_content_rect(Badge, [[maybe_unused]] const Gfx::IntRect& content_rect) { #ifdef DEBUG_SPAM - dbg() << "server did invalidate content_rect: " << content_rect << ", current shbuf_id=" << m_bitmap->shbuf_id(); + dbg() << "server did invalidate content_rect: " << content_rect << ", current front_shbuf_id=" << m_front_bitmap->shbuf_id() << ", current back_shbuf_id=" << m_back_bitmap->shbuf_id(); #endif request_repaint(); }