serenity/AK/Debug.h.in
asynts 1a3a0836c0 Everywhere: Use CMake to generate AK/Debug.h.
This was done with the help of several scripts, I dump them here to
easily find them later:

    awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in

    for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in)
    do
        find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \;
    done

    # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list.
    awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-25 09:47:36 +01:00

680 lines
14 KiB
C

/*
* Copyright (c) 2020, the SerenityOS developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#cmakedefine01 PROCESS_DEBUG
#cmakedefine01 SCHEDULER_DEBUG
#cmakedefine01 SCHEDULER_RUNNABLE_DEBUG
#cmakedefine01 THREAD_DEBUG
#cmakedefine01 LOCK_DEBUG
#cmakedefine01 SIGNAL_DEBUG
#cmakedefine01 BMP_DEBUG
#cmakedefine01 WAITBLOCK_DEBUG
#cmakedefine01 WAITQUEUE_DEBUG
#cmakedefine01 MULTIPROCESSOR_DEBUG
#cmakedefine01 ACPI_DEBUG
#cmakedefine01 PAGE_FAULT_DEBUG
#cmakedefine01 CONTEXT_SWITCH_DEBUG
#cmakedefine01 SMP_DEBUG
#cmakedefine01 BXVGA_DEBUG
#cmakedefine01 PS2MOUSE_DEBUG
#cmakedefine01 VMWAREBACKDOOR_DEBUG
#cmakedefine01 FILEDESCRIPTION_DEBUG
#cmakedefine01 PROCFS_DEBUG
#cmakedefine01 VFS_DEBUG
#cmakedefine01 IOAPIC_DEBUG
#cmakedefine01 IRQ_DEBUG
#cmakedefine01 INTERRUPT_DEBUG
#cmakedefine01 E1000_DEBUG
#cmakedefine01 IPV4_SOCKET_DEBUG
#cmakedefine01 DEBUG_LOCAL_SOCKET
#cmakedefine01 DEBUG_SOCKET
#cmakedefine01 TCP_SOCKET_DEBUG
#cmakedefine01 PCI_DEBUG
#cmakedefine01 PATA_DEBUG
#cmakedefine01 DEBUG_IO
#cmakedefine01 FORK_DEBUG
#cmakedefine01 DEBUG_POLL_SELECT
#cmakedefine01 HPET_DEBUG
#cmakedefine01 HPET_COMPARATOR_DEBUG
#cmakedefine01 MASTERPTY_DEBUG
#cmakedefine01 SLAVEPTY_DEBUG
#cmakedefine01 PTMX_DEBUG
#cmakedefine01 TTY_DEBUG
#cmakedefine01 CONTIGUOUS_VMOBJECT_DEBUG
#cmakedefine01 VRA_DEBUG
#cmakedefine01 COPY_DEBUG
#cmakedefine01 DEBUG_CURSOR_TOOL
#cmakedefine01 DEBUG_FILE_CONTENT
#cmakedefine01 DEBUG_GZIP
#cmakedefine01 CNETWORKJOB_DEBUG
#cmakedefine01 CSOCKET_DEBUG
#cmakedefine01 SAFE_SYSCALL_DEBUG
#cmakedefine01 GHASH_PROCESS_DEBUG
#cmakedefine01 NT_DEBUG
#cmakedefine01 CRYPTO_DEBUG
#cmakedefine01 DWARF_DEBUG
#cmakedefine01 DEBUG_HUNKS
#cmakedefine01 JOB_DEBUG
#cmakedefine01 GIF_DEBUG
#cmakedefine01 JPG_DEBUG
#cmakedefine01 EMOJI_DEBUG
#cmakedefine01 FILL_PATH_DEBUG
#cmakedefine01 PNG_DEBUG
#cmakedefine01 PORTABLE_IMAGE_LOADER_DEBUG
#cmakedefine01 DEBUG_SYNTAX_HIGHLIGHTING
#cmakedefine01 KEYBOARD_SHORTCUTS_DEBUG
#cmakedefine01 DEBUG_MARKDOWN
#cmakedefine01 REGEX_DEBUG
#cmakedefine01 TLS_DEBUG
#cmakedefine01 DEBUG_SPAM
#cmakedefine01 WRAPPER_GERNERATOR_DEBUG
#cmakedefine01 PARSER_DEBUG
#cmakedefine01 TOKENIZER_TRACE
#cmakedefine01 IMAGE_LOADER_DEBUG
#cmakedefine01 RESOURCE_DEBUG
#cmakedefine01 CACHE_DEBUG
#cmakedefine01 DHCPV4_DEBUG
#cmakedefine01 DHCPV4CLIENT_DEBUG
#cmakedefine01 IMAGE_DECODER_DEBUG
#cmakedefine01 SYSTEM_MENU_DEBUG
#cmakedefine01 SYSTEMSERVER_DEBUG
#cmakedefine01 SERVICE_DEBUG
#cmakedefine01 COMPOSE_DEBUG
#cmakedefine01 MINIMIZE_ANIMATION_DEBUG
#cmakedefine01 OCCLUSIONS_DEBUG
#cmakedefine01 DEBUG_MENUS
#cmakedefine01 WSSCREEN_DEBUG
#cmakedefine01 WINDOWMANAGER_DEBUG
#cmakedefine01 RESIZE_DEBUG
#cmakedefine01 MOVE_DEBUG
#cmakedefine01 DOUBLECLICK_DEBUG
#cmakedefine01 DISASM_DUMP
#cmakedefine01 DEBUG_PATH
#cmakedefine01 LOCK_TRACE_DEBUG
#cmakedefine01 LOCK_RESTORE_DEBUG
#cmakedefine01 FUTEXQUEUE_DEBUG
#cmakedefine01 FUTEX_DEBUG
#if PROCESS_DEBUG
constexpr bool debug_process = true;
#else
constexpr bool debug_process = false;
#endif
#if SCHEDULER_DEBUG
constexpr bool debug_scheduler = true;
#else
constexpr bool debug_scheduler = false;
#endif
#if SCHEDULER_RUNNABLE_DEBUG
constexpr bool debug_scheduler_runnable = true;
#else
constexpr bool debug_scheduler_runnable = false;
#endif
#if THREAD_DEBUG
constexpr bool debug_thread = true;
#else
constexpr bool debug_thread = false;
#endif
#if LOCK_DEBUG
constexpr bool debug_lock = true;
#else
constexpr bool debug_lock = false;
#endif
#if SIGNAL_DEBUG
constexpr bool debug_signal = true;
#else
constexpr bool debug_signal = false;
#endif
#if BMP_DEBUG
constexpr bool debug_bmp = true;
#else
constexpr bool debug_bmp = false;
#endif
#if WAITBLOCK_DEBUG
constexpr bool debug_waitblock = true;
#else
constexpr bool debug_waitblock = false;
#endif
#if WAITQUEUE_DEBUG
constexpr bool debug_waitqueue = true;
#else
constexpr bool debug_waitqueue = false;
#endif
#if MULTIPROCESSOR_DEBUG
constexpr bool debug_multiprocessor = true;
#else
constexpr bool debug_multiprocessor = false;
#endif
#if ACPI_DEBUG
constexpr bool debug_acpi = true;
#else
constexpr bool debug_acpi = false;
#endif
#if PAGE_FAULT_DEBUG
constexpr bool debug_page_fault = true;
#else
constexpr bool debug_page_fault = false;
#endif
#if CONTEXT_SWITCH_DEBUG
constexpr bool debug_context_switch = true;
#else
constexpr bool debug_context_switch = false;
#endif
#if SMP_DEBUG
constexpr bool debug_smp = true;
#else
constexpr bool debug_smp = false;
#endif
#if BXVGA_DEBUG
constexpr bool debug_bxvga = true;
#else
constexpr bool debug_bxvga = false;
#endif
#if PS2MOUSE_DEBUG
constexpr bool debug_ps2mouse = true;
#else
constexpr bool debug_ps2mouse = false;
#endif
#if VMWAREBACKDOOR_DEBUG
constexpr bool debug_vmware_backdoor = true;
#else
constexpr bool debug_vmware_backdoor = false;
#endif
#if FILEDESCRIPTION_DEBUG
constexpr bool debug_file_description = true;
#else
constexpr bool debug_file_description = false;
#endif
#if PROCFS_DEBUG
constexpr bool debug_procfs = true;
#else
constexpr bool debug_procfs = false;
#endif
#if VFS_DEBUG
constexpr bool debug_vfs = true;
#else
constexpr bool debug_vfs = false;
#endif
#if IOAPIC_DEBUG
constexpr bool debug_ioapic = true;
#else
constexpr bool debug_ioapic = false;
#endif
#if IRQ_DEBUG
constexpr bool debug_irq = true;
#else
constexpr bool debug_irq = false;
#endif
#if INTERRUPT_DEBUG
constexpr bool debug_interrupt = true;
#else
constexpr bool debug_interrupt = false;
#endif
#if E1000_DEBUG
constexpr bool debug_e1000 = true;
#else
constexpr bool debug_e1000 = false;
#endif
#if IPV4_SOCKET_DEBUG
constexpr bool debug_ipv4_socket = true;
#else
constexpr bool debug_ipv4_socket = false;
#endif
#if DEBUG_LOCAL_SOCKET
constexpr bool debug_local_socket = true;
#else
constexpr bool debug_local_socket = false;
#endif
#if DEBUG_SOCKET
constexpr bool debug_socket = true;
#else
constexpr bool debug_socket = false;
#endif
#if TCP_SOCKET_DEBUG
constexpr bool debug_tcp_socket = true;
#else
constexpr bool debug_tcp_socket = false;
#endif
#if PCI_DEBUG
constexpr bool debug_pci = true;
#else
constexpr bool debug_pci = false;
#endif
#if PATA_DEBUG
constexpr bool debug_pata = true;
#else
constexpr bool debug_pata = false;
#endif
#if DEBUG_IO
constexpr bool debug_io = true;
#else
constexpr bool debug_io = false;
#endif
#if FORK_DEBUG
constexpr bool debug_fork = true;
#else
constexpr bool debug_fork = false;
#endif
#if DEBUG_POLL_SELECT
constexpr bool debug_poll_select = true;
#else
constexpr bool debug_poll_select = false;
#endif
#if HPET_DEBUG
constexpr bool debug_hpet = true;
#else
constexpr bool debug_hpet = false;
#endif
#if HPET_COMPARATOR_DEBUG
constexpr bool debug_hpet_comperator = true;
#else
constexpr bool debug_hpet_comperator = false;
#endif
#if MASTERPTY_DEBUG
constexpr bool debug_masterpty = true;
#else
constexpr bool debug_masterpty = false;
#endif
#if SLAVEPTY_DEBUG
constexpr bool debug_slavepty = true;
#else
constexpr bool debug_slavepty = false;
#endif
#if PTMX_DEBUG
constexpr bool debug_ptmx = true;
#else
constexpr bool debug_ptmx = false;
#endif
#if TTY_DEBUG
constexpr bool debug_tty = true;
#else
constexpr bool debug_tty = false;
#endif
#if CONTIGUOUS_VMOBJECT_DEBUG
constexpr bool debug_contiguous_vmobject = true;
#else
constexpr bool debug_contiguous_vmobject = false;
#endif
#if VRA_DEBUG
constexpr bool debug_vra = true;
#else
constexpr bool debug_vra = false;
#endif
#if COPY_DEBUG
constexpr bool debug_copy = true;
#else
constexpr bool debug_copy = false;
#endif
#if DEBUG_CURSOR_TOOL
constexpr bool debug_cursor_tool = true;
#else
constexpr bool debug_cursor_tool = false;
#endif
#if DEBUG_FILE_CONTENT
constexpr bool debug_file_content = true;
#else
constexpr bool debug_file_content = false;
#endif
#if DEBUG_GZIP
constexpr bool debug_gzip = true;
#else
constexpr bool debug_gzip = false;
#endif
#if CNETWORKJOB_DEBUG
constexpr bool debug_cnetworkjob = true;
#else
constexpr bool debug_cnetworkjob = false;
#endif
#if CSOCKET_DEBUG
constexpr bool debug_csocket = true;
#else
constexpr bool debug_csocket = false;
#endif
#if SAFE_SYSCALL_DEBUG
constexpr bool debug_safe_syscall = true;
#else
constexpr bool debug_safe_syscall = false;
#endif
#if GHASH_PROCESS_DEBUG
constexpr bool debug_ghash_process = true;
#else
constexpr bool debug_ghash_process = false;
#endif
#if NT_DEBUG
constexpr bool debug_nt = true;
#else
constexpr bool debug_nt = false;
#endif
#if CRYPTO_DEBUG
constexpr bool debug_crypto = true;
#else
constexpr bool debug_crypto = false;
#endif
#if DWARF_DEBUG
constexpr bool debug_dwarf = true;
#else
constexpr bool debug_dwarf = false;
#endif
#if DEBUG_HUNKS
constexpr bool debug_hunks = true;
#else
constexpr bool debug_hunks = false;
#endif
#if JOB_DEBUG
constexpr bool debug_job = true;
#else
constexpr bool debug_job = false;
#endif
#if GIF_DEBUG
constexpr bool debug_gif = true;
#else
constexpr bool debug_gif = false;
#endif
#if JPG_DEBUG
constexpr bool debug_jpg = true;
#else
constexpr bool debug_jpg = false;
#endif
#if EMOJI_DEBUG
constexpr bool debug_emoji = true;
#else
constexpr bool debug_emoji = false;
#endif
#if FILL_PATH_DEBUG
constexpr bool debug_fill_path = true;
#else
constexpr bool debug_fill_path = false;
#endif
#if PNG_DEBUG
constexpr bool debug_png = true;
#else
constexpr bool debug_png = false;
#endif
#if PORTABLE_IMAGE_LOADER_DEBUG
constexpr bool debug_portable_image_loader = true;
#else
constexpr bool debug_portable_image_loader = false;
#endif
#if DEBUG_SYNTAX_HIGHLIGHTING
constexpr bool debug_syntax_highlighting = true;
#else
constexpr bool debug_syntax_highlighting = false;
#endif
#if KEYBOARD_SHORTCUTS_DEBUG
constexpr bool debug_keyboard_shortcuts = true;
#else
constexpr bool debug_keyboard_shortcuts = false;
#endif
#if DEBUG_MARKDOWN
constexpr bool debug_markdown = true;
#else
constexpr bool debug_markdown = false;
#endif
#if REGEX_DEBUG
constexpr bool debug_regex = true;
#else
constexpr bool debug_regex = false;
#endif
#if TLS_DEBUG
constexpr bool debug_tls = true;
#else
constexpr bool debug_tls = false;
#endif
#if DEBUG_SPAM
constexpr bool debug_spam = true;
#else
constexpr bool debug_spam = false;
#endif
#if WRAPPER_GERNERATOR_DEBUG
constexpr bool debug_wrapper_generator = true;
#else
constexpr bool debug_wrapper_generator = false;
#endif
#if PARSER_DEBUG
constexpr bool debug_parser = true;
#else
constexpr bool debug_parser = false;
#endif
#if TOKENIZER_TRACE
constexpr bool debug_trace_tokenizer = true;
#else
constexpr bool debug_trace_tokenizer = false;
#endif
#if IMAGE_LOADER_DEBUG
constexpr bool debug_image_loader = true;
#else
constexpr bool debug_image_loader = false;
#endif
#if RESOURCE_DEBUG
constexpr bool debug_resource = true;
#else
constexpr bool debug_resource = false;
#endif
#if CACHE_DEBUG
constexpr bool debug_cache = true;
#else
constexpr bool debug_cache = false;
#endif
#if DHCPV4_DEBUG
constexpr bool debug_dhcpv4 = true;
#else
constexpr bool debug_dhcpv4 = false;
#endif
#if DHCPV4CLIENT_DEBUG
constexpr bool debug_dhcpv4_client = true;
#else
constexpr bool debug_dhcpv4_client = false;
#endif
#if IMAGE_DECODER_DEBUG
constexpr bool debug_image_decoder = true;
#else
constexpr bool debug_image_decoder = false;
#endif
#if SYSTEM_MENU_DEBUG
constexpr bool debug_system_menu = true;
#else
constexpr bool debug_system_menu = false;
#endif
#if SYSTEMSERVER_DEBUG
constexpr bool debug_system_server = true;
#else
constexpr bool debug_system_server = false;
#endif
#if SERVICE_DEBUG
constexpr bool debug_service = true;
#else
constexpr bool debug_service = false;
#endif
#if COMPOSE_DEBUG
constexpr bool debug_compose = true;
#else
constexpr bool debug_compose = false;
#endif
#if MINIMIZE_ANIMATION_DEBUG
constexpr bool debug_minimize_animation = true;
#else
constexpr bool debug_minimize_animation = false;
#endif
#if OCCLUSIONS_DEBUG
constexpr bool debug_occlusions = true;
#else
constexpr bool debug_occlusions = false;
#endif
#if DEBUG_MENUS
constexpr bool debug_menus = true;
#else
constexpr bool debug_menus = false;
#endif
#if WSSCREEN_DEBUG
constexpr bool debug_wsscreen = true;
#else
constexpr bool debug_wsscreen = false;
#endif
#if WINDOWMANAGER_DEBUG
constexpr bool debug_window_manager = true;
#else
constexpr bool debug_window_manager = false;
#endif
#if RESIZE_DEBUG
constexpr bool debug_resize = true;
#else
constexpr bool debug_resize = false;
#endif
#if MOVE_DEBUG
constexpr bool debug_move = true;
#else
constexpr bool debug_move = false;
#endif
#if DOUBLECLICK_DEBUG
constexpr bool debug_double_click = true;
#else
constexpr bool debug_double_click = false;
#endif
#if DISASM_DUMP
constexpr bool debug_disasm_dump = true;
#else
constexpr bool debug_disasm_dump = false;
#endif
#if DEBUG_PATH
constexpr bool debug_path = true;
#else
constexpr bool debug_path = false;
#endif
#if LOCK_TRACE_DEBUG
constexpr bool debug_lock_trace = true;
#else
constexpr bool debug_lock_trace = false;
#endif
#if LOCK_RESTORE_DEBUG
constexpr bool debug_lock_restore = true;
#else
constexpr bool debug_lock_restore = false;
#endif
#if FUTEXQUEUE_DEBUG
constexpr bool debug_futex_queue = true;
#else
constexpr bool debug_futex_queue = false;
#endif
#if FUTEX_DEBUG
constexpr bool debug_futex = true;
#else
constexpr bool debug_futex = false;
#endif