1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 19:07:35 +00:00

Everywhere: Name debug macros more consistently.

Personally, I prefer the naming convention DEBUG_FOO over FOO_DEBUG, but
the majority of the debug macros are already named in the latter naming
convention, so I just enforce consistency here.

This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/DEBUG_PATH/PATH_DEBUG/' {} \;
This commit is contained in:
asynts 2021-01-23 23:52:21 +01:00 committed by Andreas Kling
parent acdcf59a33
commit bb483f7ef4
9 changed files with 44 additions and 44 deletions

View file

@ -51,14 +51,14 @@
#cmakedefine01 INTERRUPT_DEBUG #cmakedefine01 INTERRUPT_DEBUG
#cmakedefine01 E1000_DEBUG #cmakedefine01 E1000_DEBUG
#cmakedefine01 IPV4_SOCKET_DEBUG #cmakedefine01 IPV4_SOCKET_DEBUG
#cmakedefine01 DEBUG_LOCAL_SOCKET #cmakedefine01 LOCAL_SOCKET_DEBUG
#cmakedefine01 DEBUG_SOCKET #cmakedefine01 SOCKET_DEBUG
#cmakedefine01 TCP_SOCKET_DEBUG #cmakedefine01 TCP_SOCKET_DEBUG
#cmakedefine01 PCI_DEBUG #cmakedefine01 PCI_DEBUG
#cmakedefine01 PATA_DEBUG #cmakedefine01 PATA_DEBUG
#cmakedefine01 DEBUG_IO #cmakedefine01 IO_DEBUG
#cmakedefine01 FORK_DEBUG #cmakedefine01 FORK_DEBUG
#cmakedefine01 DEBUG_POLL_SELECT #cmakedefine01 POLL_SELECT_DEBUG
#cmakedefine01 HPET_DEBUG #cmakedefine01 HPET_DEBUG
#cmakedefine01 HPET_COMPARATOR_DEBUG #cmakedefine01 HPET_COMPARATOR_DEBUG
#cmakedefine01 MASTERPTY_DEBUG #cmakedefine01 MASTERPTY_DEBUG
@ -68,9 +68,9 @@
#cmakedefine01 CONTIGUOUS_VMOBJECT_DEBUG #cmakedefine01 CONTIGUOUS_VMOBJECT_DEBUG
#cmakedefine01 VRA_DEBUG #cmakedefine01 VRA_DEBUG
#cmakedefine01 COPY_DEBUG #cmakedefine01 COPY_DEBUG
#cmakedefine01 DEBUG_CURSOR_TOOL #cmakedefine01 CURSOR_TOOL_DEBUG
#cmakedefine01 DEBUG_FILE_CONTENT #cmakedefine01 FILE_CONTENT_DEBUG
#cmakedefine01 DEBUG_GZIP #cmakedefine01 GZIP_DEBUG
#cmakedefine01 CNETWORKJOB_DEBUG #cmakedefine01 CNETWORKJOB_DEBUG
#cmakedefine01 CSOCKET_DEBUG #cmakedefine01 CSOCKET_DEBUG
#cmakedefine01 SAFE_SYSCALL_DEBUG #cmakedefine01 SAFE_SYSCALL_DEBUG
@ -78,7 +78,7 @@
#cmakedefine01 NT_DEBUG #cmakedefine01 NT_DEBUG
#cmakedefine01 CRYPTO_DEBUG #cmakedefine01 CRYPTO_DEBUG
#cmakedefine01 DWARF_DEBUG #cmakedefine01 DWARF_DEBUG
#cmakedefine01 DEBUG_HUNKS #cmakedefine01 HUNKS_DEBUG
#cmakedefine01 JOB_DEBUG #cmakedefine01 JOB_DEBUG
#cmakedefine01 GIF_DEBUG #cmakedefine01 GIF_DEBUG
#cmakedefine01 JPG_DEBUG #cmakedefine01 JPG_DEBUG
@ -86,12 +86,12 @@
#cmakedefine01 FILL_PATH_DEBUG #cmakedefine01 FILL_PATH_DEBUG
#cmakedefine01 PNG_DEBUG #cmakedefine01 PNG_DEBUG
#cmakedefine01 PORTABLE_IMAGE_LOADER_DEBUG #cmakedefine01 PORTABLE_IMAGE_LOADER_DEBUG
#cmakedefine01 DEBUG_SYNTAX_HIGHLIGHTING #cmakedefine01 SYNTAX_HIGHLIGHTING_DEBUG
#cmakedefine01 KEYBOARD_SHORTCUTS_DEBUG #cmakedefine01 KEYBOARD_SHORTCUTS_DEBUG
#cmakedefine01 DEBUG_MARKDOWN #cmakedefine01 MARKDOWN_DEBUG
#cmakedefine01 REGEX_DEBUG #cmakedefine01 REGEX_DEBUG
#cmakedefine01 TLS_DEBUG #cmakedefine01 TLS_DEBUG
#cmakedefine01 DEBUG_SPAM #cmakedefine01 SPAM_DEBUG
#cmakedefine01 WRAPPER_GERNERATOR_DEBUG #cmakedefine01 WRAPPER_GERNERATOR_DEBUG
#cmakedefine01 PARSER_DEBUG #cmakedefine01 PARSER_DEBUG
#cmakedefine01 TOKENIZER_TRACE #cmakedefine01 TOKENIZER_TRACE
@ -107,14 +107,14 @@
#cmakedefine01 COMPOSE_DEBUG #cmakedefine01 COMPOSE_DEBUG
#cmakedefine01 MINIMIZE_ANIMATION_DEBUG #cmakedefine01 MINIMIZE_ANIMATION_DEBUG
#cmakedefine01 OCCLUSIONS_DEBUG #cmakedefine01 OCCLUSIONS_DEBUG
#cmakedefine01 DEBUG_MENUS #cmakedefine01 MENUS_DEBUG
#cmakedefine01 WSSCREEN_DEBUG #cmakedefine01 WSSCREEN_DEBUG
#cmakedefine01 WINDOWMANAGER_DEBUG #cmakedefine01 WINDOWMANAGER_DEBUG
#cmakedefine01 RESIZE_DEBUG #cmakedefine01 RESIZE_DEBUG
#cmakedefine01 MOVE_DEBUG #cmakedefine01 MOVE_DEBUG
#cmakedefine01 DOUBLECLICK_DEBUG #cmakedefine01 DOUBLECLICK_DEBUG
#cmakedefine01 DISASM_DUMP #cmakedefine01 DISASM_DUMP
#cmakedefine01 DEBUG_PATH #cmakedefine01 PATH_DEBUG
#cmakedefine01 LOCK_TRACE_DEBUG #cmakedefine01 LOCK_TRACE_DEBUG
#cmakedefine01 LOCK_RESTORE_DEBUG #cmakedefine01 LOCK_RESTORE_DEBUG
#cmakedefine01 FUTEXQUEUE_DEBUG #cmakedefine01 FUTEXQUEUE_DEBUG
@ -270,13 +270,13 @@ constexpr bool debug_ipv4_socket = true;
constexpr bool debug_ipv4_socket = false; constexpr bool debug_ipv4_socket = false;
#endif #endif
#if DEBUG_LOCAL_SOCKET #if LOCAL_SOCKET_DEBUG
constexpr bool debug_local_socket = true; constexpr bool debug_local_socket = true;
#else #else
constexpr bool debug_local_socket = false; constexpr bool debug_local_socket = false;
#endif #endif
#if DEBUG_SOCKET #if SOCKET_DEBUG
constexpr bool debug_socket = true; constexpr bool debug_socket = true;
#else #else
constexpr bool debug_socket = false; constexpr bool debug_socket = false;
@ -300,7 +300,7 @@ constexpr bool debug_pata = true;
constexpr bool debug_pata = false; constexpr bool debug_pata = false;
#endif #endif
#if DEBUG_IO #if IO_DEBUG
constexpr bool debug_io = true; constexpr bool debug_io = true;
#else #else
constexpr bool debug_io = false; constexpr bool debug_io = false;
@ -312,7 +312,7 @@ constexpr bool debug_fork = true;
constexpr bool debug_fork = false; constexpr bool debug_fork = false;
#endif #endif
#if DEBUG_POLL_SELECT #if POLL_SELECT_DEBUG
constexpr bool debug_poll_select = true; constexpr bool debug_poll_select = true;
#else #else
constexpr bool debug_poll_select = false; constexpr bool debug_poll_select = false;
@ -372,19 +372,19 @@ constexpr bool debug_copy = true;
constexpr bool debug_copy = false; constexpr bool debug_copy = false;
#endif #endif
#if DEBUG_CURSOR_TOOL #if CURSOR_TOOL_DEBUG
constexpr bool debug_cursor_tool = true; constexpr bool debug_cursor_tool = true;
#else #else
constexpr bool debug_cursor_tool = false; constexpr bool debug_cursor_tool = false;
#endif #endif
#if DEBUG_FILE_CONTENT #if FILE_CONTENT_DEBUG
constexpr bool debug_file_content = true; constexpr bool debug_file_content = true;
#else #else
constexpr bool debug_file_content = false; constexpr bool debug_file_content = false;
#endif #endif
#if DEBUG_GZIP #if GZIP_DEBUG
constexpr bool debug_gzip = true; constexpr bool debug_gzip = true;
#else #else
constexpr bool debug_gzip = false; constexpr bool debug_gzip = false;
@ -432,7 +432,7 @@ constexpr bool debug_dwarf = true;
constexpr bool debug_dwarf = false; constexpr bool debug_dwarf = false;
#endif #endif
#if DEBUG_HUNKS #if HUNKS_DEBUG
constexpr bool debug_hunks = true; constexpr bool debug_hunks = true;
#else #else
constexpr bool debug_hunks = false; constexpr bool debug_hunks = false;
@ -480,7 +480,7 @@ constexpr bool debug_portable_image_loader = true;
constexpr bool debug_portable_image_loader = false; constexpr bool debug_portable_image_loader = false;
#endif #endif
#if DEBUG_SYNTAX_HIGHLIGHTING #if SYNTAX_HIGHLIGHTING_DEBUG
constexpr bool debug_syntax_highlighting = true; constexpr bool debug_syntax_highlighting = true;
#else #else
constexpr bool debug_syntax_highlighting = false; constexpr bool debug_syntax_highlighting = false;
@ -492,7 +492,7 @@ constexpr bool debug_keyboard_shortcuts = true;
constexpr bool debug_keyboard_shortcuts = false; constexpr bool debug_keyboard_shortcuts = false;
#endif #endif
#if DEBUG_MARKDOWN #if MARKDOWN_DEBUG
constexpr bool debug_markdown = true; constexpr bool debug_markdown = true;
#else #else
constexpr bool debug_markdown = false; constexpr bool debug_markdown = false;
@ -510,7 +510,7 @@ constexpr bool debug_tls = true;
constexpr bool debug_tls = false; constexpr bool debug_tls = false;
#endif #endif
#if DEBUG_SPAM #if SPAM_DEBUG
constexpr bool debug_spam = true; constexpr bool debug_spam = true;
#else #else
constexpr bool debug_spam = false; constexpr bool debug_spam = false;
@ -606,7 +606,7 @@ constexpr bool debug_occlusions = true;
constexpr bool debug_occlusions = false; constexpr bool debug_occlusions = false;
#endif #endif
#if DEBUG_MENUS #if MENUS_DEBUG
constexpr bool debug_menus = true; constexpr bool debug_menus = true;
#else #else
constexpr bool debug_menus = false; constexpr bool debug_menus = false;
@ -648,7 +648,7 @@ constexpr bool debug_disasm_dump = true;
constexpr bool debug_disasm_dump = false; constexpr bool debug_disasm_dump = false;
#endif #endif
#if DEBUG_PATH #if PATH_DEBUG
constexpr bool debug_path = true; constexpr bool debug_path = true;
#else #else
constexpr bool debug_path = false; constexpr bool debug_path = false;

View file

@ -36,7 +36,7 @@ namespace HackStudio {
void CursorTool::on_mousedown(GUI::MouseEvent& event) void CursorTool::on_mousedown(GUI::MouseEvent& event)
{ {
#if DEBUG_CURSOR_TOOL #if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_mousedown"); dbgln("CursorTool::on_mousedown");
#endif #endif
auto& form_widget = m_editor.form_widget(); auto& form_widget = m_editor.form_widget();
@ -73,7 +73,7 @@ void CursorTool::on_mousedown(GUI::MouseEvent& event)
void CursorTool::on_mouseup(GUI::MouseEvent& event) void CursorTool::on_mouseup(GUI::MouseEvent& event)
{ {
#if DEBUG_CURSOR_TOOL #if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_mouseup"); dbgln("CursorTool::on_mouseup");
#endif #endif
if (event.button() == GUI::MouseButton::Left) { if (event.button() == GUI::MouseButton::Left) {
@ -94,7 +94,7 @@ void CursorTool::on_mouseup(GUI::MouseEvent& event)
void CursorTool::on_mousemove(GUI::MouseEvent& event) void CursorTool::on_mousemove(GUI::MouseEvent& event)
{ {
#if DEBUG_CURSOR_TOOL #if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_mousemove"); dbgln("CursorTool::on_mousemove");
#endif #endif
auto& form_widget = m_editor.form_widget(); auto& form_widget = m_editor.form_widget();
@ -133,7 +133,7 @@ void CursorTool::on_mousemove(GUI::MouseEvent& event)
void CursorTool::on_keydown(GUI::KeyEvent& event) void CursorTool::on_keydown(GUI::KeyEvent& event)
{ {
#if DEBUG_CURSOR_TOOL #if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_keydown"); dbgln("CursorTool::on_keydown");
#endif #endif

View file

@ -104,7 +104,7 @@ void ClientConnection::handle(const Messages::LanguageServer::FileEditInsertText
} }
GUI::TextPosition start_position { (size_t)message.start_line(), (size_t)message.start_column() }; GUI::TextPosition start_position { (size_t)message.start_line(), (size_t)message.start_column() };
document->insert_at(start_position, message.text(), &s_default_document_client); document->insert_at(start_position, message.text(), &s_default_document_client);
#if DEBUG_FILE_CONTENT #if FILE_CONTENT_DEBUG
dbgln("{}", document->text()); dbgln("{}", document->text());
#endif #endif
} }
@ -129,7 +129,7 @@ void ClientConnection::handle(const Messages::LanguageServer::FileEditRemoveText
}; };
document->remove(range); document->remove(range);
#if DEBUG_FILE_CONTENT #if FILE_CONTENT_DEBUG
dbgln("{}", document->text()); dbgln("{}", document->text());
#endif #endif
} }

View file

@ -104,7 +104,7 @@ void ClientConnection::handle(const Messages::LanguageServer::FileEditInsertText
} }
GUI::TextPosition start_position { (size_t)message.start_line(), (size_t)message.start_column() }; GUI::TextPosition start_position { (size_t)message.start_line(), (size_t)message.start_column() };
document->insert_at(start_position, message.text(), &s_default_document_client); document->insert_at(start_position, message.text(), &s_default_document_client);
#if DEBUG_FILE_CONTENT #if FILE_CONTENT_DEBUG
dbgln("{}", document->text()); dbgln("{}", document->text());
#endif #endif
} }

View file

@ -343,7 +343,7 @@ void Emulator::dump_backtrace()
u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3) u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
{ {
#if DEBUG_SPAM #if SPAM_DEBUG
reportln("Syscall: {} ({:x})", Syscall::to_string((Syscall::Function)function), function); reportln("Syscall: {} ({:x})", Syscall::to_string((Syscall::Function)function), function);
#endif #endif
switch (function) { switch (function) {

View file

@ -52,7 +52,7 @@ static Optional<ByteBuffer> get_gzip_payload(const ByteBuffer& data)
return data[current++]; return data[current++];
}; };
#if DEBUG_GZIP #if GZIP_DEBUG
dbgln("get_gzip_payload: Skipping over gzip header."); dbgln("get_gzip_payload: Skipping over gzip header.");
#endif #endif
@ -135,7 +135,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
source.data(), &source_len); source.data(), &source_len);
if (puff_ret == 0) { if (puff_ret == 0) {
#if DEBUG_GZIP #if GZIP_DEBUG
dbgln("Gzip::decompress: Decompression success."); dbgln("Gzip::decompress: Decompression success.");
#endif #endif
destination.trim(destination_len); destination.trim(destination_len);
@ -144,7 +144,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
if (puff_ret == 1) { if (puff_ret == 1) {
// FIXME: Find a better way of decompressing without needing to try over and over again. // FIXME: Find a better way of decompressing without needing to try over and over again.
#if DEBUG_GZIP #if GZIP_DEBUG
dbgln("Gzip::decompress: Output buffer exhausted. Growing."); dbgln("Gzip::decompress: Output buffer exhausted. Growing.");
#endif #endif
destination.grow(destination.size() * 2); destination.grow(destination.size() * 2);

View file

@ -62,13 +62,13 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
return; return;
if (child.get_attribute(Dwarf::Attribute::Inline).has_value()) { if (child.get_attribute(Dwarf::Attribute::Inline).has_value()) {
#if DEBUG_SPAM #if SPAM_DEBUG
dbgln("DWARF inlined functions are not supported"); dbgln("DWARF inlined functions are not supported");
#endif #endif
return; return;
} }
if (child.get_attribute(Dwarf::Attribute::Ranges).has_value()) { if (child.get_attribute(Dwarf::Attribute::Ranges).has_value()) {
#if DEBUG_SPAM #if SPAM_DEBUG
dbgln("DWARF ranges are not supported"); dbgln("DWARF ranges are not supported");
#endif #endif
return; return;
@ -81,7 +81,7 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
scope.name = name.value().data.as_string; scope.name = name.value().data.as_string;
if (!child.get_attribute(Dwarf::Attribute::LowPc).has_value()) { if (!child.get_attribute(Dwarf::Attribute::LowPc).has_value()) {
#if DEBUG_SPAM #if SPAM_DEBUG
dbgln("DWARF: Couldn't find attribute LowPc for scope"); dbgln("DWARF: Couldn't find attribute LowPc for scope");
#endif #endif
return; return;

View file

@ -242,7 +242,7 @@ Optional<Text> Text::parse(const StringView& str)
current_link_is_actually_img = true; current_link_is_actually_img = true;
break; break;
case '[': case '[':
#if DEBUG_MARKDOWN #if MARKDOWN_DEBUG
if (first_span_in_the_current_link != -1) if (first_span_in_the_current_link != -1)
dbgln("Dropping the outer link"); dbgln("Dropping the outer link");
#endif #endif
@ -250,7 +250,7 @@ Optional<Text> Text::parse(const StringView& str)
break; break;
case ']': { case ']': {
if (first_span_in_the_current_link == -1) { if (first_span_in_the_current_link == -1) {
#if DEBUG_MARKDOWN #if MARKDOWN_DEBUG
dbgln("Unmatched ]"); dbgln("Unmatched ]");
#endif #endif
continue; continue;

View file

@ -64,7 +64,7 @@ void WebContentClient::handle(const Messages::WebContentClient::DidInvalidateCon
void WebContentClient::handle(const Messages::WebContentClient::DidChangeSelection&) void WebContentClient::handle(const Messages::WebContentClient::DidChangeSelection&)
{ {
#if DEBUG_SPAM #if SPAM_DEBUG
dbgln("handle: WebContentClient::DidChangeSelection!"); dbgln("handle: WebContentClient::DidChangeSelection!");
#endif #endif
m_view.notify_server_did_change_selection({}); m_view.notify_server_did_change_selection({});
@ -96,7 +96,7 @@ void WebContentClient::handle(const Messages::WebContentClient::DidHoverLink& me
void WebContentClient::handle(const Messages::WebContentClient::DidUnhoverLink&) void WebContentClient::handle(const Messages::WebContentClient::DidUnhoverLink&)
{ {
#if DEBUG_SPAM #if SPAM_DEBUG
dbgln("handle: WebContentClient::DidUnhoverLink!"); dbgln("handle: WebContentClient::DidUnhoverLink!");
#endif #endif
m_view.notify_server_did_unhover_link({}); m_view.notify_server_did_unhover_link({});