1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-08-13 12:27:48 +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

@ -36,7 +36,7 @@ namespace HackStudio {
void CursorTool::on_mousedown(GUI::MouseEvent& event)
{
#if DEBUG_CURSOR_TOOL
#if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_mousedown");
#endif
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)
{
#if DEBUG_CURSOR_TOOL
#if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_mouseup");
#endif
if (event.button() == GUI::MouseButton::Left) {
@ -94,7 +94,7 @@ void CursorTool::on_mouseup(GUI::MouseEvent& event)
void CursorTool::on_mousemove(GUI::MouseEvent& event)
{
#if DEBUG_CURSOR_TOOL
#if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_mousemove");
#endif
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)
{
#if DEBUG_CURSOR_TOOL
#if CURSOR_TOOL_DEBUG
dbgln("CursorTool::on_keydown");
#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() };
document->insert_at(start_position, message.text(), &s_default_document_client);
#if DEBUG_FILE_CONTENT
#if FILE_CONTENT_DEBUG
dbgln("{}", document->text());
#endif
}
@ -129,7 +129,7 @@ void ClientConnection::handle(const Messages::LanguageServer::FileEditRemoveText
};
document->remove(range);
#if DEBUG_FILE_CONTENT
#if FILE_CONTENT_DEBUG
dbgln("{}", document->text());
#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() };
document->insert_at(start_position, message.text(), &s_default_document_client);
#if DEBUG_FILE_CONTENT
#if FILE_CONTENT_DEBUG
dbgln("{}", document->text());
#endif
}

View file

@ -343,7 +343,7 @@ void Emulator::dump_backtrace()
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);
#endif
switch (function) {

View file

@ -52,7 +52,7 @@ static Optional<ByteBuffer> get_gzip_payload(const ByteBuffer& data)
return data[current++];
};
#if DEBUG_GZIP
#if GZIP_DEBUG
dbgln("get_gzip_payload: Skipping over gzip header.");
#endif
@ -135,7 +135,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
source.data(), &source_len);
if (puff_ret == 0) {
#if DEBUG_GZIP
#if GZIP_DEBUG
dbgln("Gzip::decompress: Decompression success.");
#endif
destination.trim(destination_len);
@ -144,7 +144,7 @@ Optional<ByteBuffer> Gzip::decompress(const ByteBuffer& data)
if (puff_ret == 1) {
// 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.");
#endif
destination.grow(destination.size() * 2);

View file

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

View file

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

View file

@ -64,7 +64,7 @@ void WebContentClient::handle(const Messages::WebContentClient::DidInvalidateCon
void WebContentClient::handle(const Messages::WebContentClient::DidChangeSelection&)
{
#if DEBUG_SPAM
#if SPAM_DEBUG
dbgln("handle: WebContentClient::DidChangeSelection!");
#endif
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&)
{
#if DEBUG_SPAM
#if SPAM_DEBUG
dbgln("handle: WebContentClient::DidUnhoverLink!");
#endif
m_view.notify_server_did_unhover_link({});