mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:08:12 +00:00
Libraries: Unbreak building with extra debug macros
This commit is contained in:
parent
081bb29626
commit
d8e22fedc3
8 changed files with 23 additions and 17 deletions
|
@ -35,7 +35,9 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
#define DYNAMIC_LOAD_DEBUG
|
#ifndef DYNAMIC_LOAD_DEBUG
|
||||||
|
# define DYNAMIC_LOAD_DEBUG
|
||||||
|
#endif
|
||||||
//#define DYNAMIC_LOAD_VERBOSE
|
//#define DYNAMIC_LOAD_VERBOSE
|
||||||
|
|
||||||
#ifdef 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;
|
auto* elf_header = (Elf32_Ehdr*)m_file_mapping;
|
||||||
|
|
||||||
if (!validate_elf_header(*elf_header, m_file_size) ||
|
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)) {
|
||||||
!validate_program_headers(*elf_header, m_file_size, (u8*)m_file_mapping, m_file_size, m_program_interpreter)) {
|
|
||||||
m_valid = false;
|
m_valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,7 +263,7 @@ const DynamicObject::Symbol DynamicObject::HashSection::lookup_symbol(const char
|
||||||
auto symbol = m_dynamic.symbol(i);
|
auto symbol = m_dynamic.symbol(i);
|
||||||
if (strcmp(name, symbol.name()) == 0) {
|
if (strcmp(name, symbol.name()) == 0) {
|
||||||
#ifdef DYNAMIC_LOAD_DEBUG
|
#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
|
#endif
|
||||||
return symbol;
|
return symbol;
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ const Image::RelocationSection Image::Section::relocations() const
|
||||||
return static_cast<const RelocationSection>(m_image.section(0));
|
return static_cast<const RelocationSection>(m_image.section(0));
|
||||||
|
|
||||||
#ifdef Image_DEBUG
|
#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
|
#endif
|
||||||
return static_cast<const RelocationSection>(relocation_section);
|
return static_cast<const RelocationSection>(relocation_section);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,10 +87,10 @@ bool Loader::layout()
|
||||||
}
|
}
|
||||||
if (program_header.type() != PT_LOAD)
|
if (program_header.type() != PT_LOAD)
|
||||||
return;
|
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 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()) {
|
if (program_header.is_writable()) {
|
||||||
auto* allocated_section = alloc_section_hook(
|
auto* allocated_section = alloc_section_hook(
|
||||||
program_header.vaddr(),
|
program_header.vaddr(),
|
||||||
|
|
|
@ -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<void(const FloatPoint&, const FloatPoint&)>& callback)
|
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<void(const FloatPoint&, const FloatPoint&)>& 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);
|
callback(p1, p2);
|
||||||
} else {
|
} else {
|
||||||
split_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, callback);
|
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
|
#ifdef FILL_PATH_DEBUG
|
||||||
size_t i { 0 };
|
size_t i { 0 };
|
||||||
for (auto& segment : segments)
|
for (auto& segment : segments) {
|
||||||
draw_line(segment.from, segment.to, Color::from_hsv(++i / segments.size() * 360.0, 1.0, 1.0), 1);
|
draw_line(Point<int>(segment.from), Point<int>(segment.to), Color::from_hsv(++i / segments.size() * 360.0, 1.0, 1.0), 1);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ bool Object::define_property(const StringOrSymbol& property_name, const Object&
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OBJECT_DEBUG
|
#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() << ", "
|
<< "getter=" << getter.to_string_without_side_effects() << ", "
|
||||||
<< "setter=" << setter.to_string_without_side_effects() << "}";
|
<< "setter=" << setter.to_string_without_side_effects() << "}";
|
||||||
#endif
|
#endif
|
||||||
|
@ -409,7 +409,7 @@ bool Object::define_property(const StringOrSymbol& property_name, const Object&
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
#ifdef OBJECT_DEBUG
|
#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() ? "<empty>" : value.to_string_without_side_effects()) << " }";
|
<< ", value=" << (value.is_empty() ? "<empty>" : value.to_string_without_side_effects()) << " }";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ bool Object::put_own_property(Object& this_object, const StringOrSymbol& propert
|
||||||
metadata = shape().lookup(property_name);
|
metadata = shape().lookup(property_name);
|
||||||
|
|
||||||
#ifdef OBJECT_DEBUG
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -706,8 +706,12 @@ void Terminal::execute_escape_sequence(u8 final)
|
||||||
dbgprintf("\n");
|
dbgprintf("\n");
|
||||||
for (auto& line : m_lines) {
|
for (auto& line : m_lines) {
|
||||||
dbgprintf("Terminal: Line: ");
|
dbgprintf("Terminal: Line: ");
|
||||||
for (int i = 0; i < line.m_length; i++) {
|
for (int i = 0; i < line.length(); i++) {
|
||||||
dbgprintf("%c", line.characters[i]);
|
u32 codepoint = line.code_point(i);
|
||||||
|
if (codepoint < 128)
|
||||||
|
dbgprintf("%c", (char)codepoint);
|
||||||
|
else
|
||||||
|
dbgprintf("<U+%04x>", codepoint);
|
||||||
}
|
}
|
||||||
dbgprintf("\n");
|
dbgprintf("\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ void OutOfProcessWebView::notify_server_did_paint(Badge<WebContentClient>, i32 s
|
||||||
void OutOfProcessWebView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, [[maybe_unused]] const Gfx::IntRect& content_rect)
|
void OutOfProcessWebView::notify_server_did_invalidate_content_rect(Badge<WebContentClient>, [[maybe_unused]] const Gfx::IntRect& content_rect)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPAM
|
#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
|
#endif
|
||||||
request_repaint();
|
request_repaint();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue