mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:32:43 +00:00 
			
		
		
		
	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
			
			
This commit is contained in:
		
							parent
							
								
									76f2918416
								
							
						
					
					
						commit
						1a3a0836c0
					
				
					 59 changed files with 475 additions and 459 deletions
				
			
		|  | @ -26,561 +26,653 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| // FIXME: We could generate this file with CMake and configure.
 | #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 | ||||||
| 
 | 
 | ||||||
| #ifdef PROCESS_DEBUG | #if PROCESS_DEBUG | ||||||
| constexpr bool debug_process = true; | constexpr bool debug_process = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_process = false; | constexpr bool debug_process = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SCHEDULER_DEBUG | #if SCHEDULER_DEBUG | ||||||
| constexpr bool debug_scheduler = true; | constexpr bool debug_scheduler = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_scheduler = false; | constexpr bool debug_scheduler = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SCHEDULER_RUNNABLE_DEBUG | #if SCHEDULER_RUNNABLE_DEBUG | ||||||
| constexpr bool debug_scheduler_runnable = true; | constexpr bool debug_scheduler_runnable = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_scheduler_runnable = false; | constexpr bool debug_scheduler_runnable = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef THREAD_DEBUG | #if THREAD_DEBUG | ||||||
| constexpr bool debug_thread = true; | constexpr bool debug_thread = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_thread = false; | constexpr bool debug_thread = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
| constexpr bool debug_lock = true; | constexpr bool debug_lock = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_lock = false; | constexpr bool debug_lock = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SIGNAL_DEBUG | #if SIGNAL_DEBUG | ||||||
| constexpr bool debug_signal = true; | constexpr bool debug_signal = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_signal = false; | constexpr bool debug_signal = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef BMP_DEBUG | #if BMP_DEBUG | ||||||
| constexpr bool debug_bmp = true; | constexpr bool debug_bmp = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_bmp = false; | constexpr bool debug_bmp = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef WAITBLOCK_DEBUG | #if WAITBLOCK_DEBUG | ||||||
| constexpr bool debug_waitblock = true; | constexpr bool debug_waitblock = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_waitblock = false; | constexpr bool debug_waitblock = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef WAITQUEUE_DEBUG | #if WAITQUEUE_DEBUG | ||||||
| constexpr bool debug_waitqueue = true; | constexpr bool debug_waitqueue = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_waitqueue = false; | constexpr bool debug_waitqueue = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef MULTIPROCESSOR_DEBUG | #if MULTIPROCESSOR_DEBUG | ||||||
| constexpr bool debug_multiprocessor = true; | constexpr bool debug_multiprocessor = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_multiprocessor = false; | constexpr bool debug_multiprocessor = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef ACPI_DEBUG | #if ACPI_DEBUG | ||||||
| constexpr bool debug_acpi = true; | constexpr bool debug_acpi = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_acpi = false; | constexpr bool debug_acpi = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
| constexpr bool debug_page_fault = true; | constexpr bool debug_page_fault = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_page_fault = false; | constexpr bool debug_page_fault = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CONTEXT_SWITCH_DEBUG | #if CONTEXT_SWITCH_DEBUG | ||||||
| constexpr bool debug_context_switch = true; | constexpr bool debug_context_switch = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_context_switch = false; | constexpr bool debug_context_switch = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SMP_DEBUG | #if SMP_DEBUG | ||||||
| constexpr bool debug_smp = true; | constexpr bool debug_smp = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_smp = false; | constexpr bool debug_smp = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef BXVGA_DEBUG | #if BXVGA_DEBUG | ||||||
| constexpr bool debug_bxvga = true; | constexpr bool debug_bxvga = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_bxvga = false; | constexpr bool debug_bxvga = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PS2MOUSE_DEBUG | #if PS2MOUSE_DEBUG | ||||||
| constexpr bool debug_ps2mouse = true; | constexpr bool debug_ps2mouse = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_ps2mouse = false; | constexpr bool debug_ps2mouse = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef VMWAREBACKDOOR_DEBUG | #if VMWAREBACKDOOR_DEBUG | ||||||
| constexpr bool debug_vmware_backdoor = true; | constexpr bool debug_vmware_backdoor = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_vmware_backdoor = false; | constexpr bool debug_vmware_backdoor = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef FILEDESCRIPTION_DEBUG | #if FILEDESCRIPTION_DEBUG | ||||||
| constexpr bool debug_file_description = true; | constexpr bool debug_file_description = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_file_description = false; | constexpr bool debug_file_description = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PROCFS_DEBUG | #if PROCFS_DEBUG | ||||||
| constexpr bool debug_procfs = true; | constexpr bool debug_procfs = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_procfs = false; | constexpr bool debug_procfs = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef VFS_DEBUG | #if VFS_DEBUG | ||||||
| constexpr bool debug_vfs = true; | constexpr bool debug_vfs = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_vfs = false; | constexpr bool debug_vfs = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef IOAPIC_DEBUG | #if IOAPIC_DEBUG | ||||||
| constexpr bool debug_ioapic = true; | constexpr bool debug_ioapic = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_ioapic = false; | constexpr bool debug_ioapic = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef IRQ_DEBUG | #if IRQ_DEBUG | ||||||
| constexpr bool debug_irq = true; | constexpr bool debug_irq = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_irq = false; | constexpr bool debug_irq = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef INTERRUPT_DEBUG | #if INTERRUPT_DEBUG | ||||||
| constexpr bool debug_interrupt = true; | constexpr bool debug_interrupt = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_interrupt = false; | constexpr bool debug_interrupt = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef E1000_DEBUG | #if E1000_DEBUG | ||||||
| constexpr bool debug_e1000 = true; | constexpr bool debug_e1000 = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_e1000 = false; | constexpr bool debug_e1000 = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef IPV4_SOCKET_DEBUG | #if IPV4_SOCKET_DEBUG | ||||||
| constexpr bool debug_ipv4_socket = true; | constexpr bool debug_ipv4_socket = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_ipv4_socket = false; | constexpr bool debug_ipv4_socket = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_LOCAL_SOCKET | #if DEBUG_LOCAL_SOCKET | ||||||
| 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 | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_SOCKET | #if DEBUG_SOCKET | ||||||
| constexpr bool debug_socket = true; | constexpr bool debug_socket = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_socket = false; | constexpr bool debug_socket = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef TCP_SOCKET_DEBUG | #if TCP_SOCKET_DEBUG | ||||||
| constexpr bool debug_tcp_socket = true; | constexpr bool debug_tcp_socket = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_tcp_socket = false; | constexpr bool debug_tcp_socket = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PCI_DEBUG | #if PCI_DEBUG | ||||||
| constexpr bool debug_pci = true; | constexpr bool debug_pci = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_pci = false; | constexpr bool debug_pci = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
| constexpr bool debug_pata = true; | constexpr bool debug_pata = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_pata = false; | constexpr bool debug_pata = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_IO | #if DEBUG_IO | ||||||
| constexpr bool debug_io = true; | constexpr bool debug_io = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_io = false; | constexpr bool debug_io = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef FORK_DEBUG | #if FORK_DEBUG | ||||||
| constexpr bool debug_fork = true; | constexpr bool debug_fork = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_fork = false; | constexpr bool debug_fork = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_POLL_SELECT | #if DEBUG_POLL_SELECT | ||||||
| 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; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef HPET_DEBUG | #if HPET_DEBUG | ||||||
| constexpr bool debug_hpet = true; | constexpr bool debug_hpet = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_hpet = false; | constexpr bool debug_hpet = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef HPET_COMPARATOR_DEBUG | #if HPET_COMPARATOR_DEBUG | ||||||
| constexpr bool debug_hpet_comperator = true; | constexpr bool debug_hpet_comperator = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_hpet_comperator = false; | constexpr bool debug_hpet_comperator = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef MASTERPTY_DEBUG | #if MASTERPTY_DEBUG | ||||||
| constexpr bool debug_masterpty = true; | constexpr bool debug_masterpty = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_masterpty = false; | constexpr bool debug_masterpty = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SLAVEPTY_DEBUG | #if SLAVEPTY_DEBUG | ||||||
| constexpr bool debug_slavepty = true; | constexpr bool debug_slavepty = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_slavepty = false; | constexpr bool debug_slavepty = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PTMX_DEBUG | #if PTMX_DEBUG | ||||||
| constexpr bool debug_ptmx = true; | constexpr bool debug_ptmx = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_ptmx = false; | constexpr bool debug_ptmx = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef TTY_DEBUG | #if TTY_DEBUG | ||||||
| constexpr bool debug_tty = true; | constexpr bool debug_tty = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_tty = false; | constexpr bool debug_tty = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CONTIGUOUS_VMOBJECT_DEBUG | #if CONTIGUOUS_VMOBJECT_DEBUG | ||||||
| constexpr bool debug_contiguous_vmobject = true; | constexpr bool debug_contiguous_vmobject = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_contiguous_vmobject = false; | constexpr bool debug_contiguous_vmobject = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef VRA_DEBUG | #if VRA_DEBUG | ||||||
| constexpr bool debug_vra = true; | constexpr bool debug_vra = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_vra = false; | constexpr bool debug_vra = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef COPY_DEBUG | #if COPY_DEBUG | ||||||
| constexpr bool debug_copy = true; | constexpr bool debug_copy = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_copy = false; | constexpr bool debug_copy = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_CURSOR_TOOL | #if DEBUG_CURSOR_TOOL | ||||||
| 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 | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_FILE_CONTENT | #if DEBUG_FILE_CONTENT | ||||||
| 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 | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_GZIP | #if DEBUG_GZIP | ||||||
| constexpr bool debug_gzip = true; | constexpr bool debug_gzip = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_gzip = false; | constexpr bool debug_gzip = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CNETWORKJOB_DEBUG | #if CNETWORKJOB_DEBUG | ||||||
| constexpr bool debug_cnetworkjob = true; | constexpr bool debug_cnetworkjob = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_cnetworkjob = false; | constexpr bool debug_cnetworkjob = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CSOCKET_DEBUG | #if CSOCKET_DEBUG | ||||||
| constexpr bool debug_csocket = true; | constexpr bool debug_csocket = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_csocket = false; | constexpr bool debug_csocket = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SAFE_SYSCALL_DEBUG | #if SAFE_SYSCALL_DEBUG | ||||||
| constexpr bool debug_safe_syscall = true; | constexpr bool debug_safe_syscall = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_safe_syscall = false; | constexpr bool debug_safe_syscall = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef GHASH_PROCESS_DEBUG | #if GHASH_PROCESS_DEBUG | ||||||
| constexpr bool debug_ghash_process = true; | constexpr bool debug_ghash_process = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_ghash_process = false; | constexpr bool debug_ghash_process = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef NT_DEBUG | #if NT_DEBUG | ||||||
| constexpr bool debug_nt = true; | constexpr bool debug_nt = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_nt = false; | constexpr bool debug_nt = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CRYPTO_DEBUG | #if CRYPTO_DEBUG | ||||||
| constexpr bool debug_crypto = true; | constexpr bool debug_crypto = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_crypto = false; | constexpr bool debug_crypto = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
| constexpr bool debug_dwarf = true; | constexpr bool debug_dwarf = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_dwarf = false; | constexpr bool debug_dwarf = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_HUNKS | #if DEBUG_HUNKS | ||||||
| constexpr bool debug_hunks = true; | constexpr bool debug_hunks = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_hunks = false; | constexpr bool debug_hunks = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef JOB_DEBUG | #if JOB_DEBUG | ||||||
| constexpr bool debug_job = true; | constexpr bool debug_job = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_job = false; | constexpr bool debug_job = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef GIF_DEBUG | #if GIF_DEBUG | ||||||
| constexpr bool debug_gif = true; | constexpr bool debug_gif = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_gif = false; | constexpr bool debug_gif = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef JPG_DEBUG | #if JPG_DEBUG | ||||||
| constexpr bool debug_jpg = true; | constexpr bool debug_jpg = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_jpg = false; | constexpr bool debug_jpg = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef EMOJI_DEBUG | #if EMOJI_DEBUG | ||||||
| constexpr bool debug_emoji = true; | constexpr bool debug_emoji = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_emoji = false; | constexpr bool debug_emoji = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef FILL_PATH_DEBUG | #if FILL_PATH_DEBUG | ||||||
| constexpr bool debug_fill_path = true; | constexpr bool debug_fill_path = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_fill_path = false; | constexpr bool debug_fill_path = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
| constexpr bool debug_png = true; | constexpr bool debug_png = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_png = false; | constexpr bool debug_png = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PORTABLE_IMAGE_LOADER_DEBUG | #if PORTABLE_IMAGE_LOADER_DEBUG | ||||||
| constexpr bool debug_portable_image_loader = true; | constexpr bool debug_portable_image_loader = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_portable_image_loader = false; | constexpr bool debug_portable_image_loader = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_SYNTAX_HIGHLIGHTING | #if DEBUG_SYNTAX_HIGHLIGHTING | ||||||
| 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; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef KEYBOARD_SHORTCUTS_DEBUG | #if KEYBOARD_SHORTCUTS_DEBUG | ||||||
| constexpr bool debug_keyboard_shortcuts = true; | constexpr bool debug_keyboard_shortcuts = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_keyboard_shortcuts = false; | constexpr bool debug_keyboard_shortcuts = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_MARKDOWN | #if DEBUG_MARKDOWN | ||||||
| constexpr bool debug_markdown = true; | constexpr bool debug_markdown = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_markdown = false; | constexpr bool debug_markdown = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
| constexpr bool debug_regex = true; | constexpr bool debug_regex = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_regex = false; | constexpr bool debug_regex = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
| constexpr bool debug_tls = true; | constexpr bool debug_tls = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_tls = false; | constexpr bool debug_tls = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
| constexpr bool debug_spam = true; | constexpr bool debug_spam = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_spam = false; | constexpr bool debug_spam = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef WRAPPER_GERNERATOR_DEBUG | #if WRAPPER_GERNERATOR_DEBUG | ||||||
| constexpr bool debug_wrapper_generator = true; | constexpr bool debug_wrapper_generator = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_wrapper_generator = false; | constexpr bool debug_wrapper_generator = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef PARSER_DEBUG | #if PARSER_DEBUG | ||||||
| constexpr bool debug_parser = true; | constexpr bool debug_parser = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_parser = false; | constexpr bool debug_parser = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef TOKENIZER_TRACE | #if TOKENIZER_TRACE | ||||||
| constexpr bool debug_trace_tokenizer = true; | constexpr bool debug_trace_tokenizer = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_trace_tokenizer = false; | constexpr bool debug_trace_tokenizer = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef IMAGE_LOADER_DEBUG | #if IMAGE_LOADER_DEBUG | ||||||
| constexpr bool debug_image_loader = true; | constexpr bool debug_image_loader = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_image_loader = false; | constexpr bool debug_image_loader = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef RESOURCE_DEBUG | #if RESOURCE_DEBUG | ||||||
| constexpr bool debug_resource = true; | constexpr bool debug_resource = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_resource = false; | constexpr bool debug_resource = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CACHE_DEBUG | #if CACHE_DEBUG | ||||||
| constexpr bool debug_cache = true; | constexpr bool debug_cache = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_cache = false; | constexpr bool debug_cache = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DHCPV4_DEBUG | #if DHCPV4_DEBUG | ||||||
| constexpr bool debug_dhcpv4 = true; | constexpr bool debug_dhcpv4 = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_dhcpv4 = false; | constexpr bool debug_dhcpv4 = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DHCPV4CLIENT_DEBUG | #if DHCPV4CLIENT_DEBUG | ||||||
| constexpr bool debug_dhcpv4_client = true; | constexpr bool debug_dhcpv4_client = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_dhcpv4_client = false; | constexpr bool debug_dhcpv4_client = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef IMAGE_DECODER_DEBUG | #if IMAGE_DECODER_DEBUG | ||||||
| constexpr bool debug_image_decoder = true; | constexpr bool debug_image_decoder = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_image_decoder = false; | constexpr bool debug_image_decoder = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SYSTEM_MENU_DEBUG | #if SYSTEM_MENU_DEBUG | ||||||
| constexpr bool debug_system_menu = true; | constexpr bool debug_system_menu = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_system_menu = false; | constexpr bool debug_system_menu = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SYSTEMSERVER_DEBUG | #if SYSTEMSERVER_DEBUG | ||||||
| constexpr bool debug_system_server = true; | constexpr bool debug_system_server = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_system_server = false; | constexpr bool debug_system_server = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef SERVICE_DEBUG | #if SERVICE_DEBUG | ||||||
| constexpr bool debug_service = true; | constexpr bool debug_service = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_service = false; | constexpr bool debug_service = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef COMPOSE_DEBUG | #if COMPOSE_DEBUG | ||||||
| constexpr bool debug_compose = true; | constexpr bool debug_compose = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_compose = false; | constexpr bool debug_compose = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef MINIMIZE_ANIMATION_DEBUG | #if MINIMIZE_ANIMATION_DEBUG | ||||||
| constexpr bool debug_minimize_animation = true; | constexpr bool debug_minimize_animation = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_minimize_animation = false; | constexpr bool debug_minimize_animation = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef OCCLUSIONS_DEBUG | #if OCCLUSIONS_DEBUG | ||||||
| constexpr bool debug_occlusions = true; | constexpr bool debug_occlusions = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_occlusions = false; | constexpr bool debug_occlusions = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_MENUS | #if DEBUG_MENUS | ||||||
| constexpr bool debug_menus = true; | constexpr bool debug_menus = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_menus = false; | constexpr bool debug_menus = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef WSSCREEN_DEBUG | #if WSSCREEN_DEBUG | ||||||
| constexpr bool debug_wsscreen = true; | constexpr bool debug_wsscreen = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_wsscreen = false; | constexpr bool debug_wsscreen = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef WINDOWMANAGER_DEBUG | #if WINDOWMANAGER_DEBUG | ||||||
| constexpr bool debug_window_manager = true; | constexpr bool debug_window_manager = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_window_manager = false; | constexpr bool debug_window_manager = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef RESIZE_DEBUG | #if RESIZE_DEBUG | ||||||
| constexpr bool debug_resize = true; | constexpr bool debug_resize = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_resize = false; | constexpr bool debug_resize = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef MOVE_DEBUG | #if MOVE_DEBUG | ||||||
| constexpr bool debug_move = true; | constexpr bool debug_move = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_move = false; | constexpr bool debug_move = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DOUBLECLICK_DEBUG | #if DOUBLECLICK_DEBUG | ||||||
| constexpr bool debug_double_click = true; | constexpr bool debug_double_click = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_double_click = false; | constexpr bool debug_double_click = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DISASM_DUMP | #if DISASM_DUMP | ||||||
| constexpr bool debug_disasm_dump = true; | constexpr bool debug_disasm_dump = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_disasm_dump = false; | constexpr bool debug_disasm_dump = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_PATH | #if DEBUG_PATH | ||||||
| constexpr bool debug_path = true; | constexpr bool debug_path = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_path = false; | constexpr bool debug_path = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_TRACE_DEBUG | #if LOCK_TRACE_DEBUG | ||||||
| constexpr bool debug_lock_trace = true; | constexpr bool debug_lock_trace = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_lock_trace = false; | constexpr bool debug_lock_trace = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_RESTORE_DEBUG | #if LOCK_RESTORE_DEBUG | ||||||
| constexpr bool debug_lock_restore = true; | constexpr bool debug_lock_restore = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_lock_restore = false; | constexpr bool debug_lock_restore = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef FUTEXQUEUE_DEBUG | #if FUTEXQUEUE_DEBUG | ||||||
| constexpr bool debug_futex_queue = true; | constexpr bool debug_futex_queue = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_futex_queue = false; | constexpr bool debug_futex_queue = false; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef FUTEX_DEBUG | #if FUTEX_DEBUG | ||||||
| constexpr bool debug_futex = true; | constexpr bool debug_futex = true; | ||||||
| #else | #else | ||||||
| constexpr bool debug_futex = false; | constexpr bool debug_futex = false; | ||||||
|  | @ -68,8 +68,11 @@ if (ENABLE_ALL_THE_DEBUG_MACROS) | ||||||
|     include(${CMAKE_SOURCE_DIR}/Meta/CMake/all_the_debug_macros.cmake) |     include(${CMAKE_SOURCE_DIR}/Meta/CMake/all_the_debug_macros.cmake) | ||||||
| endif(ENABLE_ALL_THE_DEBUG_MACROS) | endif(ENABLE_ALL_THE_DEBUG_MACROS) | ||||||
| 
 | 
 | ||||||
|  | configure_file(AK/Debug.h.in AK/Debug.h @ONLY) | ||||||
|  | 
 | ||||||
| include_directories(Userland/Libraries) | include_directories(Userland/Libraries) | ||||||
| include_directories(.) | include_directories(.) | ||||||
|  | include_directories(${CMAKE_BINARY_DIR}) | ||||||
| 
 | 
 | ||||||
| add_subdirectory(Meta/Lagom) | add_subdirectory(Meta/Lagom) | ||||||
| add_subdirectory(Userland/DevTools/IPCCompiler) | add_subdirectory(Userland/DevTools/IPCCompiler) | ||||||
|  |  | ||||||
|  | @ -235,7 +235,7 @@ void Parser::try_acpi_shutdown() | ||||||
| size_t Parser::get_table_size(PhysicalAddress table_header) | size_t Parser::get_table_size(PhysicalAddress table_header) | ||||||
| { | { | ||||||
|     InterruptDisabler disabler; |     InterruptDisabler disabler; | ||||||
| #ifdef ACPI_DEBUG | #if ACPI_DEBUG | ||||||
|     dbgln("ACPI: Checking SDT Length"); |     dbgln("ACPI: Checking SDT Length"); | ||||||
| #endif | #endif | ||||||
|     return map_typed<Structures::SDTHeader>(table_header)->length; |     return map_typed<Structures::SDTHeader>(table_header)->length; | ||||||
|  | @ -244,7 +244,7 @@ size_t Parser::get_table_size(PhysicalAddress table_header) | ||||||
| u8 Parser::get_table_revision(PhysicalAddress table_header) | u8 Parser::get_table_revision(PhysicalAddress table_header) | ||||||
| { | { | ||||||
|     InterruptDisabler disabler; |     InterruptDisabler disabler; | ||||||
| #ifdef ACPI_DEBUG | #if ACPI_DEBUG | ||||||
|     dbgln("ACPI: Checking SDT Revision"); |     dbgln("ACPI: Checking SDT Revision"); | ||||||
| #endif | #endif | ||||||
|     return map_typed<Structures::SDTHeader>(table_header)->revision; |     return map_typed<Structures::SDTHeader>(table_header)->revision; | ||||||
|  | @ -252,7 +252,7 @@ u8 Parser::get_table_revision(PhysicalAddress table_header) | ||||||
| 
 | 
 | ||||||
| void Parser::initialize_main_system_description_table() | void Parser::initialize_main_system_description_table() | ||||||
| { | { | ||||||
| #ifdef ACPI_DEBUG | #if ACPI_DEBUG | ||||||
|     dbgln("ACPI: Checking Main SDT Length to choose the correct mapping size"); |     dbgln("ACPI: Checking Main SDT Length to choose the correct mapping size"); | ||||||
| #endif | #endif | ||||||
|     ASSERT(!m_main_system_description_table.is_null()); |     ASSERT(!m_main_system_description_table.is_null()); | ||||||
|  |  | ||||||
|  | @ -318,7 +318,7 @@ void page_fault_handler(TrapFrame* trap) | ||||||
| 
 | 
 | ||||||
|         handle_crash(regs, "Page Fault", SIGSEGV, response == PageFaultResponse::OutOfMemory); |         handle_crash(regs, "Page Fault", SIGSEGV, response == PageFaultResponse::OutOfMemory); | ||||||
|     } else if (response == PageFaultResponse::Continue) { |     } else if (response == PageFaultResponse::Continue) { | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
|         dbgln("Continuing after resolved page fault"); |         dbgln("Continuing after resolved page fault"); | ||||||
| #endif | #endif | ||||||
|     } else { |     } else { | ||||||
|  |  | ||||||
|  | @ -184,7 +184,7 @@ MousePacket PS2MouseDevice::parse_data_packet(const RawPacket& raw_packet) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     packet.is_relative = true; |     packet.is_relative = true; | ||||||
| #ifdef PS2MOUSE_DEBUG | #if PS2MOUSE_DEBUG | ||||||
|     dbgln("PS2 Relative Mouse: Buttons {:x}", packet.buttons); |     dbgln("PS2 Relative Mouse: Buttons {:x}", packet.buttons); | ||||||
|     dbgln("Mouse: X {}, Y {}, Z {}", packet.x, packet.y, packet.z); |     dbgln("Mouse: X {}, Y {}, Z {}", packet.x, packet.y, packet.z); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -215,7 +215,7 @@ Optional<MousePacket> VMWareBackdoor::receive_mouse_packet() | ||||||
|     command.command = VMMOUSE_STATUS; |     command.command = VMMOUSE_STATUS; | ||||||
|     send(command); |     send(command); | ||||||
|     if (command.ax == 0xFFFF0000) { |     if (command.ax == 0xFFFF0000) { | ||||||
| #ifdef PS2MOUSE_DEBUG | #if PS2MOUSE_DEBUG | ||||||
|         klog() << "PS2MouseDevice: Resetting VMWare mouse"; |         klog() << "PS2MouseDevice: Resetting VMWare mouse"; | ||||||
| #endif | #endif | ||||||
|         disable_absolute_vmmouse(); |         disable_absolute_vmmouse(); | ||||||
|  |  | ||||||
|  | @ -58,7 +58,7 @@ VFS& VFS::the() | ||||||
| 
 | 
 | ||||||
| VFS::VFS() | VFS::VFS() | ||||||
| { | { | ||||||
| #ifdef VFS_DEBUG | #if VFS_DEBUG | ||||||
|     klog() << "VFS: Constructing VFS"; |     klog() << "VFS: Constructing VFS"; | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ void SharedIRQHandler::initialize(u8 interrupt_number) | ||||||
| 
 | 
 | ||||||
| void SharedIRQHandler::register_handler(GenericInterruptHandler& handler) | void SharedIRQHandler::register_handler(GenericInterruptHandler& handler) | ||||||
| { | { | ||||||
| #ifdef INTERRUPT_DEBUG | #if INTERRUPT_DEBUG | ||||||
|     klog() << "Interrupt Handler registered @ Shared Interrupt Handler " << interrupt_number(); |     klog() << "Interrupt Handler registered @ Shared Interrupt Handler " << interrupt_number(); | ||||||
| #endif | #endif | ||||||
|     m_handlers.set(&handler); |     m_handlers.set(&handler); | ||||||
|  | @ -50,7 +50,7 @@ void SharedIRQHandler::register_handler(GenericInterruptHandler& handler) | ||||||
| } | } | ||||||
| void SharedIRQHandler::unregister_handler(GenericInterruptHandler& handler) | void SharedIRQHandler::unregister_handler(GenericInterruptHandler& handler) | ||||||
| { | { | ||||||
| #ifdef INTERRUPT_DEBUG | #if INTERRUPT_DEBUG | ||||||
|     klog() << "Interrupt Handler unregistered @ Shared Interrupt Handler " << interrupt_number(); |     klog() << "Interrupt Handler unregistered @ Shared Interrupt Handler " << interrupt_number(); | ||||||
| #endif | #endif | ||||||
|     m_handlers.remove(&handler); |     m_handlers.remove(&handler); | ||||||
|  | @ -69,7 +69,7 @@ SharedIRQHandler::SharedIRQHandler(u8 irq) | ||||||
|     : GenericInterruptHandler(irq) |     : GenericInterruptHandler(irq) | ||||||
|     , m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq)) |     , m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq)) | ||||||
| { | { | ||||||
| #ifdef INTERRUPT_DEBUG | #if INTERRUPT_DEBUG | ||||||
|     klog() << "Shared Interrupt Handler registered @ " << interrupt_number(); |     klog() << "Shared Interrupt Handler registered @ " << interrupt_number(); | ||||||
| #endif | #endif | ||||||
|     disable_interrupt_vector(); |     disable_interrupt_vector(); | ||||||
|  | @ -77,7 +77,7 @@ SharedIRQHandler::SharedIRQHandler(u8 irq) | ||||||
| 
 | 
 | ||||||
| SharedIRQHandler::~SharedIRQHandler() | SharedIRQHandler::~SharedIRQHandler() | ||||||
| { | { | ||||||
| #ifdef INTERRUPT_DEBUG | #if INTERRUPT_DEBUG | ||||||
|     klog() << "Shared Interrupt Handler unregistered @ " << interrupt_number(); |     klog() << "Shared Interrupt Handler unregistered @ " << interrupt_number(); | ||||||
| #endif | #endif | ||||||
|     disable_interrupt_vector(); |     disable_interrupt_vector(); | ||||||
|  |  | ||||||
|  | @ -32,7 +32,7 @@ | ||||||
| 
 | 
 | ||||||
| namespace Kernel { | namespace Kernel { | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
| void Lock::lock(Mode mode) | void Lock::lock(Mode mode) | ||||||
| { | { | ||||||
|     lock("unknown", 0, mode); |     lock("unknown", 0, mode); | ||||||
|  | @ -68,7 +68,7 @@ void Lock::lock(Mode mode) | ||||||
|                     } |                     } | ||||||
|                     ASSERT(m_times_locked == 0); |                     ASSERT(m_times_locked == 0); | ||||||
|                     m_times_locked++; |                     m_times_locked++; | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                     current_thread->holding_lock(*this, 1, file, line); |                     current_thread->holding_lock(*this, 1, file, line); | ||||||
| #endif | #endif | ||||||
|                     m_lock.store(false, AK::memory_order_release); |                     m_lock.store(false, AK::memory_order_release); | ||||||
|  | @ -90,7 +90,7 @@ void Lock::lock(Mode mode) | ||||||
|                     ASSERT(mode == Mode::Exclusive || mode == Mode::Shared); |                     ASSERT(mode == Mode::Exclusive || mode == Mode::Shared); | ||||||
|                     ASSERT(m_times_locked > 0); |                     ASSERT(m_times_locked > 0); | ||||||
|                     m_times_locked++; |                     m_times_locked++; | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                     current_thread->holding_lock(*this, 1, file, line); |                     current_thread->holding_lock(*this, 1, file, line); | ||||||
| #endif | #endif | ||||||
|                     m_lock.store(false, AK::memory_order_release); |                     m_lock.store(false, AK::memory_order_release); | ||||||
|  | @ -111,7 +111,7 @@ void Lock::lock(Mode mode) | ||||||
|                         it->value++; |                         it->value++; | ||||||
|                     else |                     else | ||||||
|                         m_shared_holders.set(current_thread, 1); |                         m_shared_holders.set(current_thread, 1); | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                     current_thread->holding_lock(*this, 1, file, line); |                     current_thread->holding_lock(*this, 1, file, line); | ||||||
| #endif | #endif | ||||||
|                     m_lock.store(false, AK::memory_order_release); |                     m_lock.store(false, AK::memory_order_release); | ||||||
|  | @ -179,7 +179,7 @@ void Lock::unlock() | ||||||
|                 m_mode = Mode::Unlocked; |                 m_mode = Mode::Unlocked; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|             current_thread->holding_lock(*this, -1); |             current_thread->holding_lock(*this, -1); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -219,7 +219,7 @@ auto Lock::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode | ||||||
|                 m_times_locked = 0; |                 m_times_locked = 0; | ||||||
|                 m_mode = Mode::Unlocked; |                 m_mode = Mode::Unlocked; | ||||||
|                 m_lock.store(false, AK::memory_order_release); |                 m_lock.store(false, AK::memory_order_release); | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                 m_holder->holding_lock(*this, -(int)lock_count_to_restore); |                 m_holder->holding_lock(*this, -(int)lock_count_to_restore); | ||||||
| #endif | #endif | ||||||
|                 previous_mode = Mode::Exclusive; |                 previous_mode = Mode::Exclusive; | ||||||
|  | @ -240,7 +240,7 @@ auto Lock::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode | ||||||
|                 ASSERT(it->value > 0); |                 ASSERT(it->value > 0); | ||||||
|                 lock_count_to_restore = it->value; |                 lock_count_to_restore = it->value; | ||||||
|                 ASSERT(lock_count_to_restore > 0); |                 ASSERT(lock_count_to_restore > 0); | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                 m_holder->holding_lock(*this, -(int)lock_count_to_restore); |                 m_holder->holding_lock(*this, -(int)lock_count_to_restore); | ||||||
| #endif | #endif | ||||||
|                 m_shared_holders.remove(it); |                 m_shared_holders.remove(it); | ||||||
|  | @ -269,7 +269,7 @@ auto Lock::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
| void Lock::restore_lock(Mode mode, u32 lock_count) | void Lock::restore_lock(Mode mode, u32 lock_count) | ||||||
| { | { | ||||||
|     return restore_lock("unknown", 0, mode, lock_count); |     return restore_lock("unknown", 0, mode, lock_count); | ||||||
|  | @ -301,7 +301,7 @@ void Lock::restore_lock(Mode mode, u32 lock_count) | ||||||
|                 ASSERT(m_shared_holders.is_empty()); |                 ASSERT(m_shared_holders.is_empty()); | ||||||
|                 m_holder = current_thread; |                 m_holder = current_thread; | ||||||
|                 m_lock.store(false, AK::memory_order_release); |                 m_lock.store(false, AK::memory_order_release); | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                 m_holder->holding_lock(*this, (int)lock_count, file, line); |                 m_holder->holding_lock(*this, (int)lock_count, file, line); | ||||||
| #endif | #endif | ||||||
|                 return; |                 return; | ||||||
|  | @ -322,7 +322,7 @@ void Lock::restore_lock(Mode mode, u32 lock_count) | ||||||
|                 // There may be other shared lock holders already, but we should not have an entry yet
 |                 // There may be other shared lock holders already, but we should not have an entry yet
 | ||||||
|                 ASSERT(set_result == AK::HashSetResult::InsertedNewEntry); |                 ASSERT(set_result == AK::HashSetResult::InsertedNewEntry); | ||||||
|                 m_lock.store(false, AK::memory_order_release); |                 m_lock.store(false, AK::memory_order_release); | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|                 m_holder->holding_lock(*this, (int)lock_count, file, line); |                 m_holder->holding_lock(*this, (int)lock_count, file, line); | ||||||
| #endif | #endif | ||||||
|                 return; |                 return; | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ public: | ||||||
|     ~Lock() { } |     ~Lock() { } | ||||||
| 
 | 
 | ||||||
|     void lock(Mode = Mode::Exclusive); |     void lock(Mode = Mode::Exclusive); | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|     void lock(const char* file, int line, Mode mode = Mode::Exclusive); |     void lock(const char* file, int line, Mode mode = Mode::Exclusive); | ||||||
|     void restore_lock(const char* file, int line, Mode, u32); |     void restore_lock(const char* file, int line, Mode, u32); | ||||||
| #endif | #endif | ||||||
|  | @ -98,7 +98,7 @@ private: | ||||||
| 
 | 
 | ||||||
| class Locker { | class Locker { | ||||||
| public: | public: | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|     ALWAYS_INLINE explicit Locker(const char* file, int line, Lock& l, Lock::Mode mode = Lock::Mode::Exclusive) |     ALWAYS_INLINE explicit Locker(const char* file, int line, Lock& l, Lock::Mode mode = Lock::Mode::Exclusive) | ||||||
|         : m_lock(l) |         : m_lock(l) | ||||||
|     { |     { | ||||||
|  | @ -133,7 +133,7 @@ private: | ||||||
|     bool m_locked { true }; |     bool m_locked { true }; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
| #    define LOCKER(...) Locker locker(__FILE__, __LINE__, __VA_ARGS__) | #    define LOCKER(...) Locker locker(__FILE__, __LINE__, __VA_ARGS__) | ||||||
| #    define RESTORE_LOCK(lock, ...) (lock).restore_lock(__FILE__, __LINE__, __VA_ARGS__) | #    define RESTORE_LOCK(lock, ...) (lock).restore_lock(__FILE__, __LINE__, __VA_ARGS__) | ||||||
| #else | #else | ||||||
|  |  | ||||||
|  | @ -423,7 +423,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload) | ||||||
| { | { | ||||||
|     disable_irq(); |     disable_irq(); | ||||||
|     size_t tx_current = in32(REG_TXDESCTAIL) % number_of_tx_descriptors; |     size_t tx_current = in32(REG_TXDESCTAIL) % number_of_tx_descriptors; | ||||||
| #ifdef E1000_DEBUG | #if E1000_DEBUG | ||||||
|     klog() << "E1000: Sending packet (" << payload.size() << " bytes)"; |     klog() << "E1000: Sending packet (" << payload.size() << " bytes)"; | ||||||
| #endif | #endif | ||||||
|     auto* tx_descriptors = (e1000_tx_desc*)m_tx_descriptors_region->vaddr().as_ptr(); |     auto* tx_descriptors = (e1000_tx_desc*)m_tx_descriptors_region->vaddr().as_ptr(); | ||||||
|  | @ -434,7 +434,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload) | ||||||
|     descriptor.length = payload.size(); |     descriptor.length = payload.size(); | ||||||
|     descriptor.status = 0; |     descriptor.status = 0; | ||||||
|     descriptor.cmd = CMD_EOP | CMD_IFCS | CMD_RS; |     descriptor.cmd = CMD_EOP | CMD_IFCS | CMD_RS; | ||||||
| #ifdef E1000_DEBUG | #if E1000_DEBUG | ||||||
|     klog() << "E1000: Using tx descriptor " << tx_current << " (head is at " << in32(REG_TXDESCHEAD) << ")"; |     klog() << "E1000: Using tx descriptor " << tx_current << " (head is at " << in32(REG_TXDESCHEAD) << ")"; | ||||||
| #endif | #endif | ||||||
|     tx_current = (tx_current + 1) % number_of_tx_descriptors; |     tx_current = (tx_current + 1) % number_of_tx_descriptors; | ||||||
|  | @ -448,7 +448,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload) | ||||||
|         } |         } | ||||||
|         m_wait_queue.wait_on({}, "E1000NetworkAdapter"); |         m_wait_queue.wait_on({}, "E1000NetworkAdapter"); | ||||||
|     } |     } | ||||||
| #ifdef E1000_DEBUG | #if E1000_DEBUG | ||||||
|     dbgln("E1000: Sent packet, status is now {:#02x}!", (u8)descriptor.status); |     dbgln("E1000: Sent packet, status is now {:#02x}!", (u8)descriptor.status); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  | @ -467,7 +467,7 @@ void E1000NetworkAdapter::receive() | ||||||
|         auto* buffer = m_rx_buffers_regions[rx_current].vaddr().as_ptr(); |         auto* buffer = m_rx_buffers_regions[rx_current].vaddr().as_ptr(); | ||||||
|         u16 length = rx_descriptors[rx_current].length; |         u16 length = rx_descriptors[rx_current].length; | ||||||
|         ASSERT(length <= 8192); |         ASSERT(length <= 8192); | ||||||
| #ifdef E1000_DEBUG | #if E1000_DEBUG | ||||||
|         klog() << "E1000: Received 1 packet @ " << buffer << " (" << length << ") bytes!"; |         klog() << "E1000: Received 1 packet @ " << buffer << " (" << length << ") bytes!"; | ||||||
| #endif | #endif | ||||||
|         did_receive({ buffer, length }); |         did_receive({ buffer, length }); | ||||||
|  |  | ||||||
|  | @ -222,7 +222,7 @@ KResultOr<size_t> IPv4Socket::sendto(FileDescription&, const UserOrKernelBuffer& | ||||||
|     if (rc < 0) |     if (rc < 0) | ||||||
|         return rc; |         return rc; | ||||||
| 
 | 
 | ||||||
| #ifdef IPV4_SOCKET_DEBUG | #if IPV4_SOCKET_DEBUG | ||||||
|     klog() << "sendto: destination=" << m_peer_address.to_string().characters() << ":" << m_peer_port; |     klog() << "sendto: destination=" << m_peer_address.to_string().characters() << ":" << m_peer_port; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -364,7 +364,7 @@ KResultOr<size_t> IPv4Socket::recvfrom(FileDescription& description, UserOrKerne | ||||||
|             return EINVAL; |             return EINVAL; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| #ifdef IPV4_SOCKET_DEBUG | #if IPV4_SOCKET_DEBUG | ||||||
|     klog() << "recvfrom: type=" << type() << ", local_port=" << local_port(); |     klog() << "recvfrom: type=" << type() << ", local_port=" << local_port(); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -169,7 +169,7 @@ KResultOr<size_t> TCPSocket::protocol_receive(ReadonlyBytes raw_ipv4_packet, Use | ||||||
|     auto& ipv4_packet = *reinterpret_cast<const IPv4Packet*>(raw_ipv4_packet.data()); |     auto& ipv4_packet = *reinterpret_cast<const IPv4Packet*>(raw_ipv4_packet.data()); | ||||||
|     auto& tcp_packet = *static_cast<const TCPPacket*>(ipv4_packet.payload()); |     auto& tcp_packet = *static_cast<const TCPPacket*>(ipv4_packet.payload()); | ||||||
|     size_t payload_size = raw_ipv4_packet.size() - sizeof(IPv4Packet) - tcp_packet.header_size(); |     size_t payload_size = raw_ipv4_packet.size() - sizeof(IPv4Packet) - tcp_packet.header_size(); | ||||||
| #ifdef TCP_SOCKET_DEBUG | #if TCP_SOCKET_DEBUG | ||||||
|     klog() << "payload_size " << payload_size << ", will it fit in " << buffer_size << "?"; |     klog() << "payload_size " << payload_size << ", will it fit in " << buffer_size << "?"; | ||||||
| #endif | #endif | ||||||
|     ASSERT(buffer_size >= payload_size); |     ASSERT(buffer_size >= payload_size); | ||||||
|  | @ -252,7 +252,7 @@ void TCPSocket::send_outgoing_packets() | ||||||
|         packet.tx_time = now; |         packet.tx_time = now; | ||||||
|         packet.tx_counter++; |         packet.tx_counter++; | ||||||
| 
 | 
 | ||||||
| #ifdef TCP_SOCKET_DEBUG | #if TCP_SOCKET_DEBUG | ||||||
|         auto& tcp_packet = *(TCPPacket*)(packet.buffer.data()); |         auto& tcp_packet = *(TCPPacket*)(packet.buffer.data()); | ||||||
|         klog() << "sending tcp packet from " << local_address().to_string().characters() << ":" << local_port() << " to " << peer_address().to_string().characters() << ":" << peer_port() << " with (" << (tcp_packet.has_syn() ? "SYN " : "") << (tcp_packet.has_ack() ? "ACK " : "") << (tcp_packet.has_fin() ? "FIN " : "") << (tcp_packet.has_rst() ? "RST " : "") << ") seq_no=" << tcp_packet.sequence_number() << ", ack_no=" << tcp_packet.ack_number() << ", tx_counter=" << packet.tx_counter; |         klog() << "sending tcp packet from " << local_address().to_string().characters() << ":" << local_port() << " to " << peer_address().to_string().characters() << ":" << peer_port() << " with (" << (tcp_packet.has_syn() ? "SYN " : "") << (tcp_packet.has_ack() ? "ACK " : "") << (tcp_packet.has_fin() ? "FIN " : "") << (tcp_packet.has_rst() ? "RST " : "") << ") seq_no=" << tcp_packet.sequence_number() << ", ack_no=" << tcp_packet.ack_number() << ", tx_counter=" << packet.tx_counter; | ||||||
| #endif | #endif | ||||||
|  | @ -450,7 +450,7 @@ bool TCPSocket::protocol_is_disconnected() const | ||||||
| void TCPSocket::shut_down_for_writing() | void TCPSocket::shut_down_for_writing() | ||||||
| { | { | ||||||
|     if (state() == State::Established) { |     if (state() == State::Established) { | ||||||
| #ifdef TCP_SOCKET_DEBUG | #if TCP_SOCKET_DEBUG | ||||||
|         dbgln(" Sending FIN/ACK from Established and moving into FinWait1"); |         dbgln(" Sending FIN/ACK from Established and moving into FinWait1"); | ||||||
| #endif | #endif | ||||||
|         [[maybe_unused]] auto rc = send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK); |         [[maybe_unused]] auto rc = send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK); | ||||||
|  | @ -465,7 +465,7 @@ KResult TCPSocket::close() | ||||||
|     Locker socket_locker(lock()); |     Locker socket_locker(lock()); | ||||||
|     auto result = IPv4Socket::close(); |     auto result = IPv4Socket::close(); | ||||||
|     if (state() == State::CloseWait) { |     if (state() == State::CloseWait) { | ||||||
| #ifdef TCP_SOCKET_DEBUG | #if TCP_SOCKET_DEBUG | ||||||
|         dbgln(" Sending FIN from CloseWait and moving into LastAck"); |         dbgln(" Sending FIN from CloseWait and moving into LastAck"); | ||||||
| #endif | #endif | ||||||
|         [[maybe_unused]] auto rc = send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK); |         [[maybe_unused]] auto rc = send_tcp_packet(TCPFlags::FIN | TCPFlags::ACK); | ||||||
|  |  | ||||||
|  | @ -109,7 +109,7 @@ void Access::enumerate_functions(int type, u8 bus, u8 slot, u8 function, Functio | ||||||
|         callback(address, { early_read16_field(address, PCI_VENDOR_ID), early_read16_field(address, PCI_DEVICE_ID) }); |         callback(address, { early_read16_field(address, PCI_VENDOR_ID), early_read16_field(address, PCI_DEVICE_ID) }); | ||||||
|     if (early_read_type(address) == PCI_TYPE_BRIDGE) { |     if (early_read_type(address) == PCI_TYPE_BRIDGE) { | ||||||
|         u8 secondary_bus = early_read8_field(address, PCI_SECONDARY_BUS); |         u8 secondary_bus = early_read8_field(address, PCI_SECONDARY_BUS); | ||||||
| #ifdef PCI_DEBUG | #if PCI_DEBUG | ||||||
|         klog() << "PCI: Found secondary bus: " << secondary_bus; |         klog() << "PCI: Found secondary bus: " << secondary_bus; | ||||||
| #endif | #endif | ||||||
|         ASSERT(secondary_bus != bus); |         ASSERT(secondary_bus != bus); | ||||||
|  |  | ||||||
|  | @ -86,7 +86,7 @@ void IOAccess::write32_field(Address address, u32 field, u32 value) | ||||||
| 
 | 
 | ||||||
| void IOAccess::enumerate_hardware(Function<void(Address, ID)> callback) | void IOAccess::enumerate_hardware(Function<void(Address, ID)> callback) | ||||||
| { | { | ||||||
| #ifdef PCI_DEBUG | #if PCI_DEBUG | ||||||
|     dbgln("PCI: IO enumerating hardware"); |     dbgln("PCI: IO enumerating hardware"); | ||||||
| #endif | #endif | ||||||
|     // Single PCI host controller.
 |     // Single PCI host controller.
 | ||||||
|  |  | ||||||
|  | @ -85,7 +85,7 @@ void MMIOAccess::initialize(PhysicalAddress mcfg) | ||||||
| { | { | ||||||
|     if (!Access::is_initialized()) { |     if (!Access::is_initialized()) { | ||||||
|         new MMIOAccess(mcfg); |         new MMIOAccess(mcfg); | ||||||
| #ifdef PCI_DEBUG | #if PCI_DEBUG | ||||||
|         dbgln("PCI: MMIO access initialised."); |         dbgln("PCI: MMIO access initialised."); | ||||||
| #endif | #endif | ||||||
|     } |     } | ||||||
|  | @ -97,7 +97,7 @@ MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg) | ||||||
|     klog() << "PCI: Using MMIO for PCI configuration space access"; |     klog() << "PCI: Using MMIO for PCI configuration space access"; | ||||||
| 
 | 
 | ||||||
|     auto checkup_region = MM.allocate_kernel_region(p_mcfg.page_base(), (PAGE_SIZE * 2), "PCI MCFG Checkup", Region::Access::Read | Region::Access::Write); |     auto checkup_region = MM.allocate_kernel_region(p_mcfg.page_base(), (PAGE_SIZE * 2), "PCI MCFG Checkup", Region::Access::Read | Region::Access::Write); | ||||||
| #ifdef PCI_DEBUG | #if PCI_DEBUG | ||||||
|     dbgln("PCI: Checking MCFG Table length to choose the correct mapping size"); |     dbgln("PCI: Checking MCFG Table length to choose the correct mapping size"); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -146,7 +146,7 @@ IDEChannel::~IDEChannel() | ||||||
| void IDEChannel::start_request(AsyncBlockDeviceRequest& request, bool use_dma, bool is_slave) | void IDEChannel::start_request(AsyncBlockDeviceRequest& request, bool use_dma, bool is_slave) | ||||||
| { | { | ||||||
|     ScopedSpinLock lock(m_request_lock); |     ScopedSpinLock lock(m_request_lock); | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|     dbgln("IDEChannel::start_request"); |     dbgln("IDEChannel::start_request"); | ||||||
| #endif | #endif | ||||||
|     m_current_request = &request; |     m_current_request = &request; | ||||||
|  | @ -231,19 +231,19 @@ void IDEChannel::handle_irq(const RegisterState&) | ||||||
|     u8 bstatus = m_io_group.bus_master_base().offset(2).in<u8>(); |     u8 bstatus = m_io_group.bus_master_base().offset(2).in<u8>(); | ||||||
|     if (!(bstatus & 0x4)) { |     if (!(bstatus & 0x4)) { | ||||||
|         // interrupt not from this device, ignore
 |         // interrupt not from this device, ignore
 | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|         klog() << "IDEChannel: ignore interrupt"; |         klog() << "IDEChannel: ignore interrupt"; | ||||||
| #endif | #endif | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     ScopedSpinLock lock(m_request_lock); |     ScopedSpinLock lock(m_request_lock); | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|     klog() << "IDEChannel: interrupt: DRQ=" << ((status & ATA_SR_DRQ) != 0) << " BSY=" << ((status & ATA_SR_BSY) != 0) << " DRDY=" << ((status & ATA_SR_DRDY) != 0); |     klog() << "IDEChannel: interrupt: DRQ=" << ((status & ATA_SR_DRQ) != 0) << " BSY=" << ((status & ATA_SR_BSY) != 0) << " DRDY=" << ((status & ATA_SR_DRDY) != 0); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     if (!m_current_request) { |     if (!m_current_request) { | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|         dbgln("IDEChannel: IRQ but no pending request!"); |         dbgln("IDEChannel: IRQ but no pending request!"); | ||||||
| #endif | #endif | ||||||
|         return; |         return; | ||||||
|  | @ -324,7 +324,7 @@ void IDEChannel::detect_disks() | ||||||
|             ; |             ; | ||||||
| 
 | 
 | ||||||
|         if (m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>() == 0x00) { |         if (m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>() == 0x00) { | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|             klog() << "IDEChannel: No " << (i == 0 ? "master" : "slave") << " disk detected!"; |             klog() << "IDEChannel: No " << (i == 0 ? "master" : "slave") << " disk detected!"; | ||||||
| #endif | #endif | ||||||
|             continue; |             continue; | ||||||
|  | @ -439,7 +439,7 @@ void IDEChannel::ata_read_sectors(bool slave_request) | ||||||
| { | { | ||||||
|     auto& request = *m_current_request; |     auto& request = *m_current_request; | ||||||
|     ASSERT(request.block_count() <= 256); |     ASSERT(request.block_count() <= 256); | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|     dbgln("IDEChannel::ata_read_sectors"); |     dbgln("IDEChannel::ata_read_sectors"); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -447,7 +447,7 @@ void IDEChannel::ata_read_sectors(bool slave_request) | ||||||
|         ; |         ; | ||||||
| 
 | 
 | ||||||
|     auto lba = request.block_index(); |     auto lba = request.block_index(); | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|     klog() << "IDEChannel: Reading " << request.block_count() << " sector(s) @ LBA " << lba; |     klog() << "IDEChannel: Reading " << request.block_count() << " sector(s) @ LBA " << lba; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -570,14 +570,14 @@ void IDEChannel::ata_write_sectors(bool slave_request) | ||||||
|     ASSERT(request.block_count() <= 256); |     ASSERT(request.block_count() <= 256); | ||||||
|     u32 start_sector = request.block_index(); |     u32 start_sector = request.block_index(); | ||||||
|     u32 count = request.block_count(); |     u32 count = request.block_count(); | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|     klog() << "IDEChannel::ata_write_sectors request (" << count << " sector(s) @ " << start_sector << ")"; |     klog() << "IDEChannel::ata_write_sectors request (" << count << " sector(s) @ " << start_sector << ")"; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     while (m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>() & ATA_SR_BSY) |     while (m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>() & ATA_SR_BSY) | ||||||
|         ; |         ; | ||||||
| 
 | 
 | ||||||
| #ifdef PATA_DEBUG | #if PATA_DEBUG | ||||||
|     klog() << "IDEChannel: Writing " << count << " sector(s) @ LBA " << start_sector; |     klog() << "IDEChannel: Writing " << count << " sector(s) @ LBA " << start_sector; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -72,7 +72,7 @@ pid_t Process::sys$fork(RegisterState& regs) | ||||||
|     child_tss.gs = regs.gs; |     child_tss.gs = regs.gs; | ||||||
|     child_tss.ss = regs.userspace_ss; |     child_tss.ss = regs.userspace_ss; | ||||||
| 
 | 
 | ||||||
| #ifdef FORK_DEBUG | #if FORK_DEBUG | ||||||
|     dbgln("fork: child will begin executing at {:04x}:{:08x} with stack {:04x}:{:08x}, kstack {:04x}:{:08x}", child_tss.cs, child_tss.eip, child_tss.ss, child_tss.esp, child_tss.ss0, child_tss.esp0); |     dbgln("fork: child will begin executing at {:04x}:{:08x} with stack {:04x}:{:08x}, kstack {:04x}:{:08x}", child_tss.cs, child_tss.eip, child_tss.ss, child_tss.esp, child_tss.ss0, child_tss.esp0); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -357,7 +357,7 @@ void Thread::finalize() | ||||||
|     ASSERT(Thread::current() == g_finalizer); |     ASSERT(Thread::current() == g_finalizer); | ||||||
|     ASSERT(Thread::current() != this); |     ASSERT(Thread::current() != this); | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|     ASSERT(!m_lock.own_lock()); |     ASSERT(!m_lock.own_lock()); | ||||||
|     if (lock_count() > 0) { |     if (lock_count() > 0) { | ||||||
|         dbgln("Thread {} leaking {} Locks!", *this, lock_count()); |         dbgln("Thread {} leaking {} Locks!", *this, lock_count()); | ||||||
|  | @ -687,7 +687,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal) | ||||||
|     ASSERT(process().is_user_process()); |     ASSERT(process().is_user_process()); | ||||||
|     ASSERT(this == Thread::current()); |     ASSERT(this == Thread::current()); | ||||||
| 
 | 
 | ||||||
| #ifdef SIGNAL_DEBUG | #if SIGNAL_DEBUG | ||||||
|     klog() << "signal: dispatch signal " << signal << " to " << *this << " state: " << state_string(); |     klog() << "signal: dispatch signal " << signal << " to " << *this << " state: " << state_string(); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -756,7 +756,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (handler_vaddr.as_ptr() == SIG_IGN) { |     if (handler_vaddr.as_ptr() == SIG_IGN) { | ||||||
| #ifdef SIGNAL_DEBUG | #if SIGNAL_DEBUG | ||||||
|         klog() << "signal: " << *this << " ignored signal " << signal; |         klog() << "signal: " << *this << " ignored signal " << signal; | ||||||
| #endif | #endif | ||||||
|         return DispatchSignalResult::Continue; |         return DispatchSignalResult::Continue; | ||||||
|  | @ -780,7 +780,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal) | ||||||
|         u32 ret_eip = state.eip; |         u32 ret_eip = state.eip; | ||||||
|         u32 ret_eflags = state.eflags; |         u32 ret_eflags = state.eflags; | ||||||
| 
 | 
 | ||||||
| #ifdef SIGNAL_DEBUG | #if SIGNAL_DEBUG | ||||||
|         klog() << "signal: setting up user stack to return to eip: " << String::format("%p", (void*)ret_eip) << " esp: " << String::format("%p", (void*)old_esp); |         klog() << "signal: setting up user stack to return to eip: " << String::format("%p", (void*)ret_eip) << " esp: " << String::format("%p", (void*)old_esp); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -820,7 +820,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal) | ||||||
|     setup_stack(regs); |     setup_stack(regs); | ||||||
|     regs.eip = g_return_to_ring3_from_signal_trampoline.get(); |     regs.eip = g_return_to_ring3_from_signal_trampoline.get(); | ||||||
| 
 | 
 | ||||||
| #ifdef SIGNAL_DEBUG | #if SIGNAL_DEBUG | ||||||
|     dbgln("signal: Thread in state '{}' has been primed with signal handler {:04x}:{:08x} to deliver {}", state_string(), m_tss.cs, m_tss.eip, signal); |     dbgln("signal: Thread in state '{}' has been primed with signal handler {:04x}:{:08x} to deliver {}", state_string(), m_tss.cs, m_tss.eip, signal); | ||||||
| #endif | #endif | ||||||
|     return DispatchSignalResult::Continue; |     return DispatchSignalResult::Continue; | ||||||
|  |  | ||||||
|  | @ -26,6 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Debug.h> | ||||||
| #include <AK/Function.h> | #include <AK/Function.h> | ||||||
| #include <AK/IntrusiveList.h> | #include <AK/IntrusiveList.h> | ||||||
| #include <AK/Optional.h> | #include <AK/Optional.h> | ||||||
|  | @ -47,8 +48,6 @@ | ||||||
| #include <LibC/fd_set.h> | #include <LibC/fd_set.h> | ||||||
| #include <LibELF/AuxiliaryVector.h> | #include <LibELF/AuxiliaryVector.h> | ||||||
| 
 | 
 | ||||||
| //#define LOCK_DEBUG
 |  | ||||||
| 
 |  | ||||||
| namespace Kernel { | namespace Kernel { | ||||||
| 
 | 
 | ||||||
| enum class DispatchSignalResult { | enum class DispatchSignalResult { | ||||||
|  | @ -1109,7 +1108,7 @@ public: | ||||||
| 
 | 
 | ||||||
|     RecursiveSpinLock& get_lock() const { return m_lock; } |     RecursiveSpinLock& get_lock() const { return m_lock; } | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|     void holding_lock(Lock& lock, int refs_delta, const char* file = nullptr, int line = 0) |     void holding_lock(Lock& lock, int refs_delta, const char* file = nullptr, int line = 0) | ||||||
|     { |     { | ||||||
|         ASSERT(refs_delta != 0); |         ASSERT(refs_delta != 0); | ||||||
|  | @ -1246,7 +1245,7 @@ private: | ||||||
|     SignalActionData m_signal_action_data[32]; |     SignalActionData m_signal_action_data[32]; | ||||||
|     Blocker* m_blocker { nullptr }; |     Blocker* m_blocker { nullptr }; | ||||||
| 
 | 
 | ||||||
| #ifdef LOCK_DEBUG | #if LOCK_DEBUG | ||||||
|     struct HoldingLockInfo { |     struct HoldingLockInfo { | ||||||
|         Lock* lock; |         Lock* lock; | ||||||
|         const char* file; |         const char* file; | ||||||
|  |  | ||||||
|  | @ -275,7 +275,7 @@ u64 HPET::update_time(u64& seconds_since_boot, u32& ticks_this_second, bool quer | ||||||
| 
 | 
 | ||||||
| void HPET::enable_periodic_interrupt(const HPETComparator& comparator) | void HPET::enable_periodic_interrupt(const HPETComparator& comparator) | ||||||
| { | { | ||||||
| #ifdef HPET_DEBUG | #if HPET_DEBUG | ||||||
|     klog() << "HPET: Set comparator " << comparator.comparator_number() << " to be periodic."; |     klog() << "HPET: Set comparator " << comparator.comparator_number() << " to be periodic."; | ||||||
| #endif | #endif | ||||||
|     disable(comparator); |     disable(comparator); | ||||||
|  | @ -289,7 +289,7 @@ void HPET::enable_periodic_interrupt(const HPETComparator& comparator) | ||||||
| } | } | ||||||
| void HPET::disable_periodic_interrupt(const HPETComparator& comparator) | void HPET::disable_periodic_interrupt(const HPETComparator& comparator) | ||||||
| { | { | ||||||
| #ifdef HPET_DEBUG | #if HPET_DEBUG | ||||||
|     klog() << "HPET: Disable periodic interrupt in comparator " << comparator.comparator_number() << "."; |     klog() << "HPET: Disable periodic interrupt in comparator " << comparator.comparator_number() << "."; | ||||||
| #endif | #endif | ||||||
|     disable(comparator); |     disable(comparator); | ||||||
|  | @ -304,7 +304,7 @@ void HPET::disable_periodic_interrupt(const HPETComparator& comparator) | ||||||
| 
 | 
 | ||||||
| void HPET::disable(const HPETComparator& comparator) | void HPET::disable(const HPETComparator& comparator) | ||||||
| { | { | ||||||
| #ifdef HPET_DEBUG | #if HPET_DEBUG | ||||||
|     klog() << "HPET: Disable comparator " << comparator.comparator_number() << "."; |     klog() << "HPET: Disable comparator " << comparator.comparator_number() << "."; | ||||||
| #endif | #endif | ||||||
|     ASSERT(comparator.comparator_number() <= m_comparators.size()); |     ASSERT(comparator.comparator_number() <= m_comparators.size()); | ||||||
|  | @ -313,7 +313,7 @@ void HPET::disable(const HPETComparator& comparator) | ||||||
| } | } | ||||||
| void HPET::enable(const HPETComparator& comparator) | void HPET::enable(const HPETComparator& comparator) | ||||||
| { | { | ||||||
| #ifdef HPET_DEBUG | #if HPET_DEBUG | ||||||
|     klog() << "HPET: Enable comparator " << comparator.comparator_number() << "."; |     klog() << "HPET: Enable comparator " << comparator.comparator_number() << "."; | ||||||
| #endif | #endif | ||||||
|     ASSERT(comparator.comparator_number() <= m_comparators.size()); |     ASSERT(comparator.comparator_number() <= m_comparators.size()); | ||||||
|  |  | ||||||
|  | @ -443,7 +443,7 @@ PageFaultResponse AnonymousVMObject::handle_cow_fault(size_t page_index, Virtual | ||||||
|     auto& page_slot = physical_pages()[page_index]; |     auto& page_slot = physical_pages()[page_index]; | ||||||
|     bool have_committed = m_shared_committed_cow_pages && is_nonvolatile(page_index); |     bool have_committed = m_shared_committed_cow_pages && is_nonvolatile(page_index); | ||||||
|     if (page_slot->ref_count() == 1) { |     if (page_slot->ref_count() == 1) { | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
|         dbgln("    >> It's a COW page but nobody is sharing it anymore. Remap r/w"); |         dbgln("    >> It's a COW page but nobody is sharing it anymore. Remap r/w"); | ||||||
| #endif | #endif | ||||||
|         set_should_cow(page_index, false); |         set_should_cow(page_index, false); | ||||||
|  | @ -456,12 +456,12 @@ PageFaultResponse AnonymousVMObject::handle_cow_fault(size_t page_index, Virtual | ||||||
| 
 | 
 | ||||||
|     RefPtr<PhysicalPage> page; |     RefPtr<PhysicalPage> page; | ||||||
|     if (have_committed) { |     if (have_committed) { | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
|         dbgln("    >> It's a committed COW page and it's time to COW!"); |         dbgln("    >> It's a committed COW page and it's time to COW!"); | ||||||
| #endif | #endif | ||||||
|         page = m_shared_committed_cow_pages->allocate_one(); |         page = m_shared_committed_cow_pages->allocate_one(); | ||||||
|     } else { |     } else { | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
|         dbgln("    >> It's a COW page and it's time to COW!"); |         dbgln("    >> It's a COW page and it's time to COW!"); | ||||||
| #endif | #endif | ||||||
|         page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::No); |         page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::No); | ||||||
|  |  | ||||||
|  | @ -384,7 +384,7 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault) | ||||||
|         dump_kernel_regions(); |         dump_kernel_regions(); | ||||||
|         return PageFaultResponse::ShouldCrash; |         return PageFaultResponse::ShouldCrash; | ||||||
|     } |     } | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
|     dbgln("MM: CPU[{}] handle_page_fault({:#04x}) at {}", Processor::current().id(), fault.code(), fault.vaddr()); |     dbgln("MM: CPU[{}] handle_page_fault({:#04x}) at {}", Processor::current().id(), fault.code(), fault.vaddr()); | ||||||
| #endif | #endif | ||||||
|     auto* region = find_region_from_vaddr(fault.vaddr()); |     auto* region = find_region_from_vaddr(fault.vaddr()); | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ void RangeAllocator::initialize_with_range(VirtualAddress base, size_t size) | ||||||
| { | { | ||||||
|     m_total_range = { base, size }; |     m_total_range = { base, size }; | ||||||
|     m_available_ranges.append({ base, size }); |     m_available_ranges.append({ base, size }); | ||||||
| #ifdef VRA_DEBUG | #if VRA_DEBUG | ||||||
|     ScopedSpinLock lock(m_lock); |     ScopedSpinLock lock(m_lock); | ||||||
|     dump(); |     dump(); | ||||||
| #endif | #endif | ||||||
|  | @ -215,7 +215,7 @@ void RangeAllocator::deallocate(Range range) | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| #ifdef VRA_DEBUG | #if VRA_DEBUG | ||||||
|     dbgln("VRA: After deallocate"); |     dbgln("VRA: After deallocate"); | ||||||
|     dump(); |     dump(); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -458,7 +458,7 @@ PageFaultResponse Region::handle_zero_fault(size_t page_index_in_region) | ||||||
|     auto page_index_in_vmobject = translate_to_vmobject_page(page_index_in_region); |     auto page_index_in_vmobject = translate_to_vmobject_page(page_index_in_region); | ||||||
| 
 | 
 | ||||||
|     if (!page_slot.is_null() && !page_slot->is_shared_zero_page() && !page_slot->is_lazy_committed_page()) { |     if (!page_slot.is_null() && !page_slot->is_shared_zero_page() && !page_slot->is_lazy_committed_page()) { | ||||||
| #ifdef PAGE_FAULT_DEBUG | #if PAGE_FAULT_DEBUG | ||||||
|         dbgln("MM: zero_page() but page already present. Fine with me!"); |         dbgln("MM: zero_page() but page already present. Fine with me!"); | ||||||
| #endif | #endif | ||||||
|         if (!remap_vmobject_page(page_index_in_vmobject)) |         if (!remap_vmobject_page(page_index_in_vmobject)) | ||||||
|  |  | ||||||
|  | @ -1,178 +1,96 @@ | ||||||
| add_compile_definitions("ACPI_DEBUG") | set(PROCESS_DEBUG ON) | ||||||
| add_compile_definitions("APIC_DEBUG") | set(SCHEDULER_DEBUG ON) | ||||||
| add_compile_definitions("APIC_SMP_DEBUG") | set(SCHEDULER_RUNNABLE_DEBUG ON) | ||||||
| add_compile_definitions("ARP_DEBUG") | set(THREAD_DEBUG ON) | ||||||
| add_compile_definitions("AWAVLOADER_DEBUG") | set(LOCK_DEBUG ON) | ||||||
| add_compile_definitions("BBFS_DEBUG") | set(SIGNAL_DEBUG ON) | ||||||
| add_compile_definitions("BMP_DEBUG") | set(BMP_DEBUG ON) | ||||||
| add_compile_definitions("BXVGA_DEBUG") | set(WAITBLOCK_DEBUG ON) | ||||||
| add_compile_definitions("CACHE_DEBUG") | set(WAITQUEUE_DEBUG ON) | ||||||
| add_compile_definitions("CALLBACK_MACHINE_DEBUG") | set(MULTIPROCESSOR_DEBUG ON) | ||||||
| add_compile_definitions("CHTTPJOB_DEBUG") | set(ACPI_DEBUG ON) | ||||||
| add_compile_definitions("CNETWORKJOB_DEBUG") | set(PAGE_FAULT_DEBUG ON) | ||||||
| add_compile_definitions("COMMIT_DEBUG") | set(CONTEXT_SWITCH_DEBUG ON) | ||||||
| add_compile_definitions("COMPOSE_DEBUG") | set(SMP_DEBUG ON) | ||||||
| add_compile_definitions("CONTEXT_SWITCH_DEBUG") | set(BXVGA_DEBUG ON) | ||||||
| add_compile_definitions("CONTIGUOUS_VMOBJECT_DEBUG") | set(PS2MOUSE_DEBUG ON) | ||||||
| add_compile_definitions("COPY_DEBUG") | set(VMWARE_BACKDOOR_DEBUG ON) | ||||||
| add_compile_definitions("CRYPTO_DEBUG") | set(FILEDESCRIPTION_DEBUG ON) | ||||||
| add_compile_definitions("CSOCKET_DEBUG") | set(PROCFS_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_AUTOCOMPLETE") | set(VFS_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_CPP_LANGUAGE_SERVER") | set(IOAPIC_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_CURSOR_TOOL") | set(IRQ_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_DIFF") | set(INTERRUPT_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_FILE_CONTENT") | set(E1000_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_GZIP") | set(IPV4_SOCKET_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_HIGHLIGHT_FOCUSED_FRAME") | set(LOCAL_SOCKET_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_HUNKS") | set(SOCKET_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_IO") | set(TCP_SOCKET_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_ITEM_RECTS") | set(PCI_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_LOCAL_SOCKET") | set(PATA_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_MAPPED_FILE") | set(IO_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_MARKDOWN") | set(FORK_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_MENUS") | set(POLL_SELECT_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_POLL_SELECT") | set(HPET_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_SH_LANGUAGE_SERVER") | set(HPET_COMPARATOR_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_SPAM") | set(MASTERPTY_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_STRINGIMPL") | set(SLAVEPTY_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_SYNTAX_HIGHLIGHTING") | set(PTMX_DEBUG ON) | ||||||
| add_compile_definitions("DEBUG_TEXTEDITOR") | set(TTY_DEBUG ON) | ||||||
| add_compile_definitions("DEFERRED_INVOKE_DEBUG") | set(CONTIGUOUS_VMOBJECT_DEBUG ON) | ||||||
| add_compile_definitions("DHCPV4CLIENT_DEBUG") | set(VRA_DEBUG ON) | ||||||
| add_compile_definitions("DHCPV4_DEBUG") | set(COPY_DEBUG ON) | ||||||
| add_compile_definitions("DOUBLECLICK_DEBUG") | set(CURSOR_TOOL_DEBUG ON) | ||||||
| add_compile_definitions("DRAGDROP_DEBUG") | set(FILE_CONTENT_DEBUG ON) | ||||||
| add_compile_definitions("DWARF_DEBUG") | set(GZIP_DEBUG ON) | ||||||
| add_compile_definitions("DYNAMIC_LOAD_DEBUG") | set(CNETWORKJOB_DEBUG ON) | ||||||
| add_compile_definitions("E1000_DEBUG") | set(CSOCKET_DEBUG ON) | ||||||
| add_compile_definitions("EBR_DEBUG") | set(SAFE_SYSCALL_DEBUG ON) | ||||||
| add_compile_definitions("EDITOR_DEBUG") | set(GHASH_PROCESS_DEBUG ON) | ||||||
| add_compile_definitions("ELF_IMAGE_DEBUG") | set(NT_DEBUG ON) | ||||||
| add_compile_definitions("EMOJI_DEBUG") | set(CRYPTO_DEBUG ON) | ||||||
| add_compile_definitions("ETHERNET_DEBUG") | set(DWARF_DEBUG ON) | ||||||
| add_compile_definitions("ETHERNET_VERY_DEBUG") | set(HUNKS_DEBUG ON) | ||||||
| add_compile_definitions("EVENTLOOP_DEBUG") | set(JOB_DEBUG ON) | ||||||
| add_compile_definitions("EVENT_DEBUG") | set(GIF_DEBUG ON) | ||||||
| add_compile_definitions("EXEC_DEBUG") | set(JPG_DEBUG ON) | ||||||
| add_compile_definitions("EXT2_DEBUG") | set(EMOJI_DEBUG ON) | ||||||
| add_compile_definitions("EXT2_VERY_DEBUG") | set(FILL_PATH_DEBUG ON) | ||||||
| add_compile_definitions("FIFO_DEBUG") | set(PNG_DEBUG ON) | ||||||
| add_compile_definitions("FILEDESCRIPTION_DEBUG") | set(PORTABLE_IMAGE_LOADER_DEBUG ON) | ||||||
| add_compile_definitions("FILL_PATH_DEBUG") | set(SYNTAX_HIGHLIGHTING_DEBUG ON) | ||||||
| add_compile_definitions("FORK_DEBUG") | set(KEYBOARD_SHORTCUTS_DEBUG ON) | ||||||
| add_compile_definitions("FUTEXQUEUE_DEBUG") | set(MARKDOWN_DEBUG ON) | ||||||
| add_compile_definitions("FUTEX_DEBUG") | set(REGEX_DEBUG ON) | ||||||
| add_compile_definitions("GBOXLAYOUT_DEBUG") | set(TLS_DEBUG ON) | ||||||
| add_compile_definitions("GEMINIJOB_DEBUG") | set(SPAM_DEBUG ON) | ||||||
| add_compile_definitions("GEMINI_DEBUG") | set(PARSER_DEBUG ON) | ||||||
| add_compile_definitions("GENERATE_DEBUG_CODE") | set(TOKENIZER_TRACE_DEBUG ON) | ||||||
| add_compile_definitions("GHASH_PROCESS_DEBUG") | set(IMAGE_LOADER_DEBUG ON) | ||||||
| add_compile_definitions("GIF_DEBUG") | set(RESOURCE_DEBUG ON) | ||||||
| add_compile_definitions("GLOBAL_DTORS_DEBUG") | set(CACHE_DEBUG ON) | ||||||
| add_compile_definitions("GMENU_DEBUG") | set(DHCPV4_DEBUG ON) | ||||||
| add_compile_definitions("GPT_DEBUG") | set(DHCPV4CLIENT_DEBUG ON) | ||||||
| add_compile_definitions("HEAP_DEBUG") | set(IMAGE_DECODER_DEBUG ON) | ||||||
| add_compile_definitions("HEX_DEBUG") | set(SYSTEM_MENU_DEBUG ON) | ||||||
| add_compile_definitions("HPET_COMPARATOR_DEBUG") | set(SYSTEMSERVER_DEBUG ON) | ||||||
| add_compile_definitions("HPET_DEBUG") | set(SERVICE_DEBUG ON) | ||||||
| add_compile_definitions("HTTPSJOB_DEBUG") | set(COMPOSE_DEBUG ON) | ||||||
| add_compile_definitions("ICMP_DEBUG") | set(MINIMIZE_ANIMATION_DEBUG ON) | ||||||
| add_compile_definitions("ICO_DEBUG") | set(OCCLUSIONS_DEBUG ON) | ||||||
| add_compile_definitions("IMAGE_DECODER_CLIENT_DEBUG") | set(MENUS_DEBUG ON) | ||||||
| add_compile_definitions("IMAGE_DECODER_DEBUG") | set(WSSCREEN_DEBUG ON) | ||||||
| add_compile_definitions("IMAGE_LOADER_DEBUG") | set(WINDOWMANAGER_DEBUG ON) | ||||||
| add_compile_definitions("INTERRUPT_DEBUG") | set(RESIZE_DEBUG ON) | ||||||
| add_compile_definitions("IOAPIC_DEBUG") | set(MOVE_DEBUG ON) | ||||||
| add_compile_definitions("IPC_DEBUG") | set(DOUBLECLICK_DEBUG ON) | ||||||
| add_compile_definitions("IPV4_DEBUG") | set(DISASM_DUMP_DEBUG ON) | ||||||
| add_compile_definitions("IPV4_SOCKET_DEBUG") | set(PATH_DEBUG ON) | ||||||
| add_compile_definitions("IRC_DEBUG") | set(LOCK_TRACE_DEBUG ON) | ||||||
| add_compile_definitions("IRQ_DEBUG") | set(LOCK_RESTORE_DEBUG ON) | ||||||
| add_compile_definitions("JOB_DEBUG") | set(FUTEXQUEUE_DEBUG ON) | ||||||
| add_compile_definitions("JPG_DEBUG") | set(FUTEX_DEBUG ON) | ||||||
| add_compile_definitions("KEYBOARD_DEBUG") |  | ||||||
| add_compile_definitions("KEYBOARD_SHORTCUTS_DEBUG") |  | ||||||
| add_compile_definitions("KMALLOC_DEBUG_LARGE_ALLOCATIONS") |  | ||||||
| add_compile_definitions("LEXER_DEBUG") |  | ||||||
| add_compile_definitions("LOCK_DEBUG") |  | ||||||
| add_compile_definitions("LOCK_RESTORE_DEBUG") |  | ||||||
| add_compile_definitions("LOCK_TRACE_DEBUG") |  | ||||||
| add_compile_definitions("LOOKUPSERVER_DEBUG") |  | ||||||
| add_compile_definitions("Loader_DEBUG") |  | ||||||
| add_compile_definitions("MALLOC_DEBUG") |  | ||||||
| add_compile_definitions("MASTERPTY_DEBUG") |  | ||||||
| add_compile_definitions("MBR_DEBUG") |  | ||||||
| add_compile_definitions("MEMORY_DEBUG") |  | ||||||
| add_compile_definitions("MENU_DEBUG") |  | ||||||
| add_compile_definitions("MINIMIZE_ANIMATION_DEBUG") |  | ||||||
| add_compile_definitions("MOVE_DEBUG") |  | ||||||
| add_compile_definitions("MULTIPROCESSOR_DEBUG") |  | ||||||
| add_compile_definitions("NETWORK_TASK_DEBUG") |  | ||||||
| add_compile_definitions("NT_DEBUG") |  | ||||||
| add_compile_definitions("OBJECT_DEBUG") |  | ||||||
| add_compile_definitions("OCCLUSIONS_DEBUG") |  | ||||||
| add_compile_definitions("OFFD_DEBUG") |  | ||||||
| add_compile_definitions("PAGE_FAULT_DEBUG") |  | ||||||
| add_compile_definitions("PARSER_DEBUG") |  | ||||||
| add_compile_definitions("PATA_DEBUG") |  | ||||||
| add_compile_definitions("PATA_DEVICE_DEBUG") |  | ||||||
| add_compile_definitions("PATH_DEBUG") |  | ||||||
| add_compile_definitions("PCI_DEBUG") |  | ||||||
| add_compile_definitions("PNG_DEBUG") |  | ||||||
| add_compile_definitions("PORTABLE_IMAGE_LOADER_DEBUG") |  | ||||||
| add_compile_definitions("PROCESS_DEBUG") |  | ||||||
| add_compile_definitions("PROCFS_DEBUG") |  | ||||||
| add_compile_definitions("PS2MOUSE_DEBUG") |  | ||||||
| add_compile_definitions("PTHREAD_DEBUG") |  | ||||||
| add_compile_definitions("PTMX_DEBUG") |  | ||||||
| add_compile_definitions("REACHABLE_DEBUG") |  | ||||||
| add_compile_definitions("REGEX_DEBUG") |  | ||||||
| add_compile_definitions("RESIZE_DEBUG") |  | ||||||
| add_compile_definitions("RESOURCE_DEBUG") |  | ||||||
| add_compile_definitions("ROUTING_DEBUG") |  | ||||||
| add_compile_definitions("RTL8139_DEBUG") |  | ||||||
| add_compile_definitions("SAFE_SYSCALL_DEBUG") |  | ||||||
| add_compile_definitions("SB16_DEBUG") |  | ||||||
| add_compile_definitions("SCHEDULER_DEBUG") |  | ||||||
| add_compile_definitions("SCHEDULER_RUNNABLE_DEBUG") |  | ||||||
| add_compile_definitions("SELECTION_DEBUG") |  | ||||||
| add_compile_definitions("SERVICE_DEBUG") |  | ||||||
| add_compile_definitions("SH_DEBUG") |  | ||||||
| add_compile_definitions("SIGNAL_DEBUG") |  | ||||||
| add_compile_definitions("SLAVEPTY_DEBUG") |  | ||||||
| add_compile_definitions("SMP_DEBUG") |  | ||||||
| add_compile_definitions("SOCKET_DEBUG") |  | ||||||
| add_compile_definitions("STORAGE_DEVICE_DEBUG") |  | ||||||
| add_compile_definitions("SYSTEMSERVER_DEBUG") |  | ||||||
| add_compile_definitions("SYSTEM_MENU_DEBUG") |  | ||||||
| add_compile_definitions("TCP_DEBUG") |  | ||||||
| add_compile_definitions("TCP_SOCKET_DEBUG") |  | ||||||
| add_compile_definitions("TERMCAP_DEBUG") |  | ||||||
| add_compile_definitions("TERMINAL_DEBUG") |  | ||||||
| add_compile_definitions("THREAD_DEBUG") |  | ||||||
| add_compile_definitions("TLS_DEBUG") |  | ||||||
| add_compile_definitions("TTY_DEBUG") |  | ||||||
| add_compile_definitions("UCI_DEBUG") |  | ||||||
| add_compile_definitions("UHCI_DEBUG") |  | ||||||
| add_compile_definitions("UHCI_VERBOSE_DEBUG") |  | ||||||
| add_compile_definitions("UDP_DEBUG") |  | ||||||
| add_compile_definitions("UPDATE_COALESCING_DEBUG") |  | ||||||
| add_compile_definitions("VERY_DEBUG") |  | ||||||
| add_compile_definitions("VFS_DEBUG") |  | ||||||
| add_compile_definitions("VMWAREBACKDOOR_DEBUG") |  | ||||||
| add_compile_definitions("VOLATILE_PAGE_RANGES_DEBUG") |  | ||||||
| add_compile_definitions("VRA_DEBUG") |  | ||||||
| add_compile_definitions("WAITBLOCK_DEBUG") |  | ||||||
| add_compile_definitions("WAITQUEUE_DEBUG") |  | ||||||
| add_compile_definitions("WEAKABLE_DEBUG") |  | ||||||
| add_compile_definitions("WINDOWMANAGER_DEBUG") |  | ||||||
| add_compile_definitions("WSMESSAGELOOP_DEBUG") |  | ||||||
| add_compile_definitions("DEBUG_SOCKET") |  | ||||||
| add_compile_definitions("WSSCREEN_DEBUG") |  | ||||||
| add_compile_definitions("DEBUG_PATH") |  | ||||||
| # False positive: IF_BMP_DEBUG is not actually a flag. |  | ||||||
| # add_compile_definitions("IF_BMP_DEBUG") |  | ||||||
| # False positive: LOG_DEBUG is a flag, but for a bitset, not a feature. | # False positive: LOG_DEBUG is a flag, but for a bitset, not a feature. | ||||||
| # add_compile_definitions("LOG_DEBUG") | # add_compile_definitions("LOG_DEBUG=ON") | ||||||
| # Clogs up build: The WrapperGenerator stuff is run at compile time. | # Clogs up build: The WrapperGenerator stuff is run at compile time. | ||||||
| # add_compile_definitions("WRAPPER_GERNERATOR_DEBUG") | # add_compile_definitions("WRAPPER_GERNERATOR_DEBUG=ON") | ||||||
|  |  | ||||||
|  | @ -77,9 +77,15 @@ set(LAGOM_REGEX_SOURCES ${LIBREGEX_LIBC_SOURCES} ${LIBREGEX_SOURCES}) | ||||||
| set(LAGOM_CORE_SOURCES ${AK_SOURCES} ${LIBCORE_SOURCES}) | set(LAGOM_CORE_SOURCES ${AK_SOURCES} ${LIBCORE_SOURCES}) | ||||||
| set(LAGOM_MORE_SOURCES ${LIBELF_SOURCES} ${LIBIPC_SOURCES} ${LIBLINE_SOURCES} ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBX86_SOURCES} ${LIBCRYPTO_SOURCES} ${LIBCOMPRESS_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBTLS_SOURCES} ${LIBTTF_SOURCES} ${LIBMARKDOWN_SOURCES} ${LIBGEMINI_SOURCES} ${LIBGFX_SOURCES} ${LIBGUI_GML_SOURCES} ${LIBHTTP_SOURCES} ${LAGOM_REGEX_SOURCES} ${SHELL_SOURCES}) | set(LAGOM_MORE_SOURCES ${LIBELF_SOURCES} ${LIBIPC_SOURCES} ${LIBLINE_SOURCES} ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBX86_SOURCES} ${LIBCRYPTO_SOURCES} ${LIBCOMPRESS_SOURCES} ${LIBCRYPTO_SUBDIR_SOURCES} ${LIBTLS_SOURCES} ${LIBTTF_SOURCES} ${LIBMARKDOWN_SOURCES} ${LIBGEMINI_SOURCES} ${LIBGFX_SOURCES} ${LIBGUI_GML_SOURCES} ${LIBHTTP_SOURCES} ${LAGOM_REGEX_SOURCES} ${SHELL_SOURCES}) | ||||||
| 
 | 
 | ||||||
| include_directories (../../) | # FIXME: This is a hack, because the lagom stuff can be build individually or | ||||||
| include_directories (../../Userland/) | #        in combination with the system, we generate two Debug.h files. One in | ||||||
| include_directories (../../Userland/Libraries/) | #        Build/AK/Debug.h and the other in Build/Meta/Lagom/AK/Debug.h. | ||||||
|  | configure_file(../../AK/Debug.h.in AK/Debug.h @ONLY) | ||||||
|  | 
 | ||||||
|  | include_directories(../../) | ||||||
|  | include_directories(../../Userland/) | ||||||
|  | include_directories(../../Userland/Libraries/) | ||||||
|  | include_directories(${CMAKE_BINARY_DIR}) | ||||||
| add_library(LagomCore ${LAGOM_CORE_SOURCES}) | add_library(LagomCore ${LAGOM_CORE_SOURCES}) | ||||||
| 
 | 
 | ||||||
| if (BUILD_LAGOM) | if (BUILD_LAGOM) | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ namespace HackStudio { | ||||||
| 
 | 
 | ||||||
| void CursorTool::on_mousedown(GUI::MouseEvent& event) | void CursorTool::on_mousedown(GUI::MouseEvent& event) | ||||||
| { | { | ||||||
| #ifdef DEBUG_CURSOR_TOOL | #if DEBUG_CURSOR_TOOL | ||||||
|     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) | ||||||
| { | { | ||||||
| #ifdef DEBUG_CURSOR_TOOL | #if DEBUG_CURSOR_TOOL | ||||||
|     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) | ||||||
| { | { | ||||||
| #ifdef DEBUG_CURSOR_TOOL | #if DEBUG_CURSOR_TOOL | ||||||
|     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) | ||||||
| { | { | ||||||
| #ifdef DEBUG_CURSOR_TOOL | #if DEBUG_CURSOR_TOOL | ||||||
|     dbgln("CursorTool::on_keydown"); |     dbgln("CursorTool::on_keydown"); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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); | ||||||
| #ifdef DEBUG_FILE_CONTENT | #if DEBUG_FILE_CONTENT | ||||||
|     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); | ||||||
| #ifdef DEBUG_FILE_CONTENT | #if DEBUG_FILE_CONTENT | ||||||
|     dbgln("{}", document->text()); |     dbgln("{}", document->text()); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -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); | ||||||
| #ifdef DEBUG_FILE_CONTENT | #if DEBUG_FILE_CONTENT | ||||||
|     dbgln("{}", document->text()); |     dbgln("{}", document->text()); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -28,6 +28,7 @@ | ||||||
| #include "MmapRegion.h" | #include "MmapRegion.h" | ||||||
| #include "SimpleRegion.h" | #include "SimpleRegion.h" | ||||||
| #include "SoftCPU.h" | #include "SoftCPU.h" | ||||||
|  | #include <AK/Debug.h> | ||||||
| #include <AK/Format.h> | #include <AK/Format.h> | ||||||
| #include <AK/LexicalPath.h> | #include <AK/LexicalPath.h> | ||||||
| #include <AK/MappedFile.h> | #include <AK/MappedFile.h> | ||||||
|  | @ -59,8 +60,6 @@ | ||||||
| #    pragma GCC optimize("O3") | #    pragma GCC optimize("O3") | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| // #define DEBUG_SPAM
 |  | ||||||
| 
 |  | ||||||
| namespace UserspaceEmulator { | namespace UserspaceEmulator { | ||||||
| 
 | 
 | ||||||
| static constexpr u32 stack_location = 0x10000000; | static constexpr u32 stack_location = 0x10000000; | ||||||
|  | @ -344,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) | ||||||
| { | { | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
|     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) { | ||||||
|  |  | ||||||
|  | @ -52,7 +52,7 @@ static Optional<ByteBuffer> get_gzip_payload(const ByteBuffer& data) | ||||||
|         return data[current++]; |         return data[current++]; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG_GZIP | #if DEBUG_GZIP | ||||||
|     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) { | ||||||
| #ifdef DEBUG_GZIP | #if DEBUG_GZIP | ||||||
|             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.
 | ||||||
| #ifdef DEBUG_GZIP | #if DEBUG_GZIP | ||||||
|             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); | ||||||
|  |  | ||||||
|  | @ -68,7 +68,7 @@ void NetworkJob::did_fail(Error error) | ||||||
|     NonnullRefPtr<NetworkJob> protector(*this); |     NonnullRefPtr<NetworkJob> protector(*this); | ||||||
| 
 | 
 | ||||||
|     m_error = error; |     m_error = error; | ||||||
| #ifdef CNETWORKJOB_DEBUG | #if CNETWORKJOB_DEBUG | ||||||
|     dbgprintf("%s{%p} job did_fail! error: %u (%s)\n", class_name(), this, (unsigned)error, to_string(error)); |     dbgprintf("%s{%p} job did_fail! error: %u (%s)\n", class_name(), this, (unsigned)error, to_string(error)); | ||||||
| #endif | #endif | ||||||
|     ASSERT(on_finish); |     ASSERT(on_finish); | ||||||
|  |  | ||||||
|  | @ -221,7 +221,7 @@ UnsignedBigInteger LCM(const UnsignedBigInteger& a, const UnsignedBigInteger& b) | ||||||
| 
 | 
 | ||||||
|     GCD_without_allocation(a, b, temp_a, temp_b, temp_1, temp_2, temp_3, temp_4, temp_quotient, temp_remainder, gcd_output); |     GCD_without_allocation(a, b, temp_a, temp_b, temp_1, temp_2, temp_3, temp_4, temp_quotient, temp_remainder, gcd_output); | ||||||
|     if (gcd_output == 0) { |     if (gcd_output == 0) { | ||||||
| #ifdef NT_DEBUG | #if NT_DEBUG | ||||||
|         dbgln("GCD is zero"); |         dbgln("GCD is zero"); | ||||||
| #endif | #endif | ||||||
|         return output; |         return output; | ||||||
|  |  | ||||||
|  | @ -25,6 +25,7 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "DebugInfo.h" | #include "DebugInfo.h" | ||||||
|  | #include <AK/Debug.h> | ||||||
| #include <AK/LexicalPath.h> | #include <AK/LexicalPath.h> | ||||||
| #include <AK/MemoryStream.h> | #include <AK/MemoryStream.h> | ||||||
| #include <AK/QuickSort.h> | #include <AK/QuickSort.h> | ||||||
|  | @ -32,8 +33,6 @@ | ||||||
| #include <LibDebug/Dwarf/DwarfInfo.h> | #include <LibDebug/Dwarf/DwarfInfo.h> | ||||||
| #include <LibDebug/Dwarf/Expression.h> | #include <LibDebug/Dwarf/Expression.h> | ||||||
| 
 | 
 | ||||||
| //#define DEBUG_SPAM
 |  | ||||||
| 
 |  | ||||||
| namespace Debug { | namespace Debug { | ||||||
| 
 | 
 | ||||||
| DebugInfo::DebugInfo(NonnullOwnPtr<const ELF::Image> elf, String source_root, FlatPtr base_address) | DebugInfo::DebugInfo(NonnullOwnPtr<const ELF::Image> elf, String source_root, FlatPtr base_address) | ||||||
|  | @ -63,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()) { | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
|             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()) { | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
|             dbgln("DWARF ranges are not supported"); |             dbgln("DWARF ranges are not supported"); | ||||||
| #endif | #endif | ||||||
|             return; |             return; | ||||||
|  | @ -82,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()) { | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
|             dbgln("DWARF: Couldn't find attribute LowPc for scope"); |             dbgln("DWARF: Couldn't find attribute LowPc for scope"); | ||||||
| #endif | #endif | ||||||
|             return; |             return; | ||||||
|  |  | ||||||
|  | @ -48,7 +48,7 @@ void LineProgram::parse_unit_header() | ||||||
|     ASSERT(m_unit_header.version == DWARF_VERSION); |     ASSERT(m_unit_header.version == DWARF_VERSION); | ||||||
|     ASSERT(m_unit_header.opcode_base == SPECIAL_OPCODES_BASE); |     ASSERT(m_unit_header.opcode_base == SPECIAL_OPCODES_BASE); | ||||||
| 
 | 
 | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|     dbgln("unit length: {}", m_unit_header.length); |     dbgln("unit length: {}", m_unit_header.length); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  | @ -60,7 +60,7 @@ void LineProgram::parse_source_directories() | ||||||
|     while (m_stream.peek_or_error()) { |     while (m_stream.peek_or_error()) { | ||||||
|         String directory; |         String directory; | ||||||
|         m_stream >> directory; |         m_stream >> directory; | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("directory: {}", directory); |         dbgln("directory: {}", directory); | ||||||
| #endif | #endif | ||||||
|         m_source_directories.append(move(directory)); |         m_source_directories.append(move(directory)); | ||||||
|  | @ -81,7 +81,7 @@ void LineProgram::parse_source_files() | ||||||
|         size_t _unused = 0; |         size_t _unused = 0; | ||||||
|         m_stream.read_LEB128_unsigned(_unused); // skip modification time
 |         m_stream.read_LEB128_unsigned(_unused); // skip modification time
 | ||||||
|         m_stream.read_LEB128_unsigned(_unused); // skip file size
 |         m_stream.read_LEB128_unsigned(_unused); // skip file size
 | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("file: {}, directory index: {}", file_name, directory_index); |         dbgln("file: {}, directory index: {}", file_name, directory_index); | ||||||
| #endif | #endif | ||||||
|         m_source_files.append({ file_name, directory_index }); |         m_source_files.append({ file_name, directory_index }); | ||||||
|  | @ -92,7 +92,7 @@ void LineProgram::parse_source_files() | ||||||
| 
 | 
 | ||||||
| void LineProgram::append_to_line_info() | void LineProgram::append_to_line_info() | ||||||
| { | { | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|     dbgln("appending line info: {:p}, {}:{}", m_address, m_source_files[m_file_index].name, m_line); |     dbgln("appending line info: {:p}, {}:{}", m_address, m_source_files[m_file_index].name, m_line); | ||||||
| #endif | #endif | ||||||
|     if (!m_is_statement) |     if (!m_is_statement) | ||||||
|  | @ -133,20 +133,20 @@ void LineProgram::handle_extended_opcode() | ||||||
|     case ExtendedOpcodes::SetAddress: { |     case ExtendedOpcodes::SetAddress: { | ||||||
|         ASSERT(length == sizeof(size_t) + 1); |         ASSERT(length == sizeof(size_t) + 1); | ||||||
|         m_stream >> m_address; |         m_stream >> m_address; | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("SetAddress: {:p}", m_address); |         dbgln("SetAddress: {:p}", m_address); | ||||||
| #endif | #endif | ||||||
|         break; |         break; | ||||||
|     } |     } | ||||||
|     case ExtendedOpcodes::SetDiscriminator: { |     case ExtendedOpcodes::SetDiscriminator: { | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("SetDiscriminator"); |         dbgln("SetDiscriminator"); | ||||||
| #endif | #endif | ||||||
|         m_stream.discard_or_error(1); |         m_stream.discard_or_error(1); | ||||||
|         break; |         break; | ||||||
|     } |     } | ||||||
|     default: |     default: | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("offset: {:p}", m_stream.offset()); |         dbgln("offset: {:p}", m_stream.offset()); | ||||||
| #endif | #endif | ||||||
|         ASSERT_NOT_REACHED(); |         ASSERT_NOT_REACHED(); | ||||||
|  | @ -163,7 +163,7 @@ void LineProgram::handle_standard_opcode(u8 opcode) | ||||||
|         size_t operand = 0; |         size_t operand = 0; | ||||||
|         m_stream.read_LEB128_unsigned(operand); |         m_stream.read_LEB128_unsigned(operand); | ||||||
|         size_t delta = operand * m_unit_header.min_instruction_length; |         size_t delta = operand * m_unit_header.min_instruction_length; | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("AdvancePC by: {} to: {:p}", delta, m_address + delta); |         dbgln("AdvancePC by: {} to: {:p}", delta, m_address + delta); | ||||||
| #endif | #endif | ||||||
|         m_address += delta; |         m_address += delta; | ||||||
|  | @ -172,7 +172,7 @@ void LineProgram::handle_standard_opcode(u8 opcode) | ||||||
|     case StandardOpcodes::SetFile: { |     case StandardOpcodes::SetFile: { | ||||||
|         size_t new_file_index = 0; |         size_t new_file_index = 0; | ||||||
|         m_stream.read_LEB128_unsigned(new_file_index); |         m_stream.read_LEB128_unsigned(new_file_index); | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("SetFile: new file index: {}", new_file_index); |         dbgln("SetFile: new file index: {}", new_file_index); | ||||||
| #endif | #endif | ||||||
|         m_file_index = new_file_index; |         m_file_index = new_file_index; | ||||||
|  | @ -180,7 +180,7 @@ void LineProgram::handle_standard_opcode(u8 opcode) | ||||||
|     } |     } | ||||||
|     case StandardOpcodes::SetColumn: { |     case StandardOpcodes::SetColumn: { | ||||||
|         // not implemented
 |         // not implemented
 | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("SetColumn"); |         dbgln("SetColumn"); | ||||||
| #endif | #endif | ||||||
|         size_t new_column; |         size_t new_column; | ||||||
|  | @ -193,13 +193,13 @@ void LineProgram::handle_standard_opcode(u8 opcode) | ||||||
|         m_stream.read_LEB128_signed(line_delta); |         m_stream.read_LEB128_signed(line_delta); | ||||||
|         ASSERT(line_delta >= 0 || m_line >= (size_t)(-line_delta)); |         ASSERT(line_delta >= 0 || m_line >= (size_t)(-line_delta)); | ||||||
|         m_line += line_delta; |         m_line += line_delta; | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("AdvanceLine: {}", m_line); |         dbgln("AdvanceLine: {}", m_line); | ||||||
| #endif | #endif | ||||||
|         break; |         break; | ||||||
|     } |     } | ||||||
|     case StandardOpcodes::NegateStatement: { |     case StandardOpcodes::NegateStatement: { | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("NegateStatement"); |         dbgln("NegateStatement"); | ||||||
| #endif | #endif | ||||||
|         m_is_statement = !m_is_statement; |         m_is_statement = !m_is_statement; | ||||||
|  | @ -209,7 +209,7 @@ void LineProgram::handle_standard_opcode(u8 opcode) | ||||||
|         u8 adjusted_opcode = 255 - SPECIAL_OPCODES_BASE; |         u8 adjusted_opcode = 255 - SPECIAL_OPCODES_BASE; | ||||||
|         ssize_t address_increment = (adjusted_opcode / m_unit_header.line_range) * m_unit_header.min_instruction_length; |         ssize_t address_increment = (adjusted_opcode / m_unit_header.line_range) * m_unit_header.min_instruction_length; | ||||||
|         address_increment *= m_unit_header.min_instruction_length; |         address_increment *= m_unit_header.min_instruction_length; | ||||||
| #ifdef DWARF_DEBUG | #if DWARF_DEBUG | ||||||
|         dbgln("ConstAddPc: advance pc by: {} to: {}", address_increment, (m_address + address_increment)); |         dbgln("ConstAddPc: advance pc by: {} to: {}", address_increment, (m_address + address_increment)); | ||||||
| #endif | #endif | ||||||
|         m_address += address_increment; |         m_address += address_increment; | ||||||
|  |  | ||||||
|  | @ -152,7 +152,7 @@ void Job::on_socket_connected() | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|         if (!is_established()) { |         if (!is_established()) { | ||||||
| #ifdef JOB_DEBUG | #if JOB_DEBUG | ||||||
|             dbgln("Connection appears to have closed, finishing up"); |             dbgln("Connection appears to have closed, finishing up"); | ||||||
| #endif | #endif | ||||||
|             finish_up(); |             finish_up(); | ||||||
|  |  | ||||||
|  | @ -355,7 +355,7 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index) | ||||||
|         while (true) { |         while (true) { | ||||||
|             Optional<u16> code = decoder.next_code(); |             Optional<u16> code = decoder.next_code(); | ||||||
|             if (!code.has_value()) { |             if (!code.has_value()) { | ||||||
| #ifdef GIF_DEBUG | #if GIF_DEBUG | ||||||
|                 dbgln("Unexpectedly reached end of gif frame data"); |                 dbgln("Unexpectedly reached end of gif frame data"); | ||||||
| #endif | #endif | ||||||
|                 return false; |                 return false; | ||||||
|  | @ -504,7 +504,7 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context) | ||||||
| 
 | 
 | ||||||
|             if (extension_type == 0xF9) { |             if (extension_type == 0xF9) { | ||||||
|                 if (sub_block.size() != 4) { |                 if (sub_block.size() != 4) { | ||||||
| #ifdef GIF_DEBUG | #if GIF_DEBUG | ||||||
|                     dbgln("Unexpected graphic control size"); |                     dbgln("Unexpected graphic control size"); | ||||||
| #endif | #endif | ||||||
|                     continue; |                     continue; | ||||||
|  |  | ||||||
|  | @ -267,7 +267,7 @@ static Optional<u8> get_next_symbol(HuffmanStreamState& hstream, const HuffmanTa | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| #ifdef JPG_DEBUG | #if JPG_DEBUG | ||||||
|     dbgln("If you're seeing this...the jpeg decoder needs to support more kinds of JPEGs!"); |     dbgln("If you're seeing this...the jpeg decoder needs to support more kinds of JPEGs!"); | ||||||
| #endif | #endif | ||||||
|     return {}; |     return {}; | ||||||
|  |  | ||||||
|  | @ -526,7 +526,7 @@ static bool decode_png_header(PNGLoadingContext& context) | ||||||
|         return true; |         return true; | ||||||
| 
 | 
 | ||||||
|     if (!context.data || context.data_size < sizeof(png_header)) { |     if (!context.data || context.data_size < sizeof(png_header)) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         dbgln("Missing PNG header"); |         dbgln("Missing PNG header"); | ||||||
| #endif | #endif | ||||||
|         context.state = PNGLoadingContext::State::Error; |         context.state = PNGLoadingContext::State::Error; | ||||||
|  | @ -534,7 +534,7 @@ static bool decode_png_header(PNGLoadingContext& context) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (memcmp(context.data, png_header, sizeof(png_header)) != 0) { |     if (memcmp(context.data, png_header, sizeof(png_header)) != 0) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         dbgln("Invalid PNG header"); |         dbgln("Invalid PNG header"); | ||||||
| #endif | #endif | ||||||
|         context.state = PNGLoadingContext::State::Error; |         context.state = PNGLoadingContext::State::Error; | ||||||
|  | @ -874,7 +874,7 @@ static bool process_IHDR(ReadonlyBytes data, PNGLoadingContext& context) | ||||||
|     context.filter_method = ihdr.filter_method; |     context.filter_method = ihdr.filter_method; | ||||||
|     context.interlace_method = ihdr.interlace_method; |     context.interlace_method = ihdr.interlace_method; | ||||||
| 
 | 
 | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|     printf("PNG: %dx%d (%d bpp)\n", context.width, context.height, context.bit_depth); |     printf("PNG: %dx%d (%d bpp)\n", context.width, context.height, context.bit_depth); | ||||||
|     printf("     Color type: %d\n", context.color_type); |     printf("     Color type: %d\n", context.color_type); | ||||||
|     printf("Compress Method: %d\n", context.compression_method); |     printf("Compress Method: %d\n", context.compression_method); | ||||||
|  | @ -883,7 +883,7 @@ static bool process_IHDR(ReadonlyBytes data, PNGLoadingContext& context) | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     if (context.interlace_method != PngInterlaceMethod::Null && context.interlace_method != PngInterlaceMethod::Adam7) { |     if (context.interlace_method != PngInterlaceMethod::Null && context.interlace_method != PngInterlaceMethod::Adam7) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         dbgln("PNGLoader::process_IHDR: unknown interlace method: {}", context.interlace_method); |         dbgln("PNGLoader::process_IHDR: unknown interlace method: {}", context.interlace_method); | ||||||
| #endif | #endif | ||||||
|         return false; |         return false; | ||||||
|  | @ -947,7 +947,7 @@ static bool process_chunk(Streamer& streamer, PNGLoadingContext& context) | ||||||
| { | { | ||||||
|     u32 chunk_size; |     u32 chunk_size; | ||||||
|     if (!streamer.read(chunk_size)) { |     if (!streamer.read(chunk_size)) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         printf("Bail at chunk_size\n"); |         printf("Bail at chunk_size\n"); | ||||||
| #endif | #endif | ||||||
|         return false; |         return false; | ||||||
|  | @ -955,26 +955,26 @@ static bool process_chunk(Streamer& streamer, PNGLoadingContext& context) | ||||||
|     u8 chunk_type[5]; |     u8 chunk_type[5]; | ||||||
|     chunk_type[4] = '\0'; |     chunk_type[4] = '\0'; | ||||||
|     if (!streamer.read_bytes(chunk_type, 4)) { |     if (!streamer.read_bytes(chunk_type, 4)) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         printf("Bail at chunk_type\n"); |         printf("Bail at chunk_type\n"); | ||||||
| #endif | #endif | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|     ReadonlyBytes chunk_data; |     ReadonlyBytes chunk_data; | ||||||
|     if (!streamer.wrap_bytes(chunk_data, chunk_size)) { |     if (!streamer.wrap_bytes(chunk_data, chunk_size)) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         printf("Bail at chunk_data\n"); |         printf("Bail at chunk_data\n"); | ||||||
| #endif | #endif | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|     u32 chunk_crc; |     u32 chunk_crc; | ||||||
|     if (!streamer.read(chunk_crc)) { |     if (!streamer.read(chunk_crc)) { | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|         printf("Bail at chunk_crc\n"); |         printf("Bail at chunk_crc\n"); | ||||||
| #endif | #endif | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
| #ifdef PNG_DEBUG | #if PNG_DEBUG | ||||||
|     printf("Chunk type: '%s', size: %u, crc: %x\n", chunk_type, chunk_size, chunk_crc); |     printf("Chunk type: '%s', size: %u, crc: %x\n", chunk_type, chunk_size, chunk_crc); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1620,7 +1620,7 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule) | ||||||
|             quick_sort(active_list, [](const auto& line0, const auto& line1) { |             quick_sort(active_list, [](const auto& line0, const auto& line1) { | ||||||
|                 return line1.x < line0.x; |                 return line1.x < line0.x; | ||||||
|             }); |             }); | ||||||
| #ifdef FILL_PATH_DEBUG | #if FILL_PATH_DEBUG | ||||||
|             if ((int)scanline % 10 == 0) { |             if ((int)scanline % 10 == 0) { | ||||||
|                 draw_text(IntRect(active_list.last().x - 20, scanline, 20, 10), String::number((int)scanline)); |                 draw_text(IntRect(active_list.last().x - 20, scanline, 20, 10), String::number((int)scanline)); | ||||||
|             } |             } | ||||||
|  | @ -1692,7 +1692,7 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| #ifdef FILL_PATH_DEBUG | #if FILL_PATH_DEBUG | ||||||
|     size_t i { 0 }; |     size_t i { 0 }; | ||||||
|     for (auto& segment : segments) { |     for (auto& segment : segments) { | ||||||
|         draw_line(Point<int>(segment.from), Point<int>(segment.to), Color::from_hsv(i++ * 360.0 / segments.size(), 1.0, 1.0), 1); |         draw_line(Point<int>(segment.from), Point<int>(segment.to), Color::from_hsv(i++ * 360.0 / segments.size(), 1.0, 1.0), 1); | ||||||
|  |  | ||||||
|  | @ -331,7 +331,7 @@ void Job::on_socket_connected() | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|         if (!is_established()) { |         if (!is_established()) { | ||||||
| #ifdef JOB_DEBUG | #if JOB_DEBUG | ||||||
|             dbgln("Connection appears to have closed, finishing up"); |             dbgln("Connection appears to have closed, finishing up"); | ||||||
| #endif | #endif | ||||||
|             finish_up(); |             finish_up(); | ||||||
|  |  | ||||||
|  | @ -24,13 +24,12 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Debug.h> | ||||||
| #include <AK/ScopeGuard.h> | #include <AK/ScopeGuard.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibMarkdown/Text.h> | #include <LibMarkdown/Text.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
| 
 | 
 | ||||||
| //#define DEBUG_MARKDOWN
 |  | ||||||
| 
 |  | ||||||
| namespace Markdown { | namespace Markdown { | ||||||
| 
 | 
 | ||||||
| static String unescape(const StringView& text) | static String unescape(const StringView& text) | ||||||
|  | @ -243,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 '[': | ||||||
| #ifdef DEBUG_MARKDOWN | #if DEBUG_MARKDOWN | ||||||
|             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 | ||||||
|  | @ -251,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) { | ||||||
| #ifdef DEBUG_MARKDOWN | #if DEBUG_MARKDOWN | ||||||
|                 dbgln("Unmatched ]"); |                 dbgln("Unmatched ]"); | ||||||
| #endif | #endif | ||||||
|                 continue; |                 continue; | ||||||
|  |  | ||||||
|  | @ -28,10 +28,9 @@ | ||||||
| 
 | 
 | ||||||
| #include "AK/StringBuilder.h" | #include "AK/StringBuilder.h" | ||||||
| #include "LibRegex/RegexMatcher.h" | #include "LibRegex/RegexMatcher.h" | ||||||
|  | #include <AK/Debug.h> | ||||||
| 
 | 
 | ||||||
| //#define REGEX_DEBUG
 | #if REGEX_DEBUG | ||||||
| 
 |  | ||||||
| #ifdef REGEX_DEBUG |  | ||||||
| 
 | 
 | ||||||
| namespace regex { | namespace regex { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -26,6 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #include "RegexLexer.h" | #include "RegexLexer.h" | ||||||
| #include <AK/Assertions.h> | #include <AK/Assertions.h> | ||||||
|  | #include <AK/Debug.h> | ||||||
| #include <AK/LogStream.h> | #include <AK/LogStream.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
|  | @ -150,7 +151,7 @@ Token Lexer::next() | ||||||
|         case '\\': |         case '\\': | ||||||
|             return 2; |             return 2; | ||||||
|         default: |         default: | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|             fprintf(stderr, "[LEXER] Found invalid escape sequence: \\%c (the parser will have to deal with this!)\n", peek(1)); |             fprintf(stderr, "[LEXER] Found invalid escape sequence: \\%c (the parser will have to deal with this!)\n", peek(1)); | ||||||
| #endif | #endif | ||||||
|             return 0; |             return 0; | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ | ||||||
| 
 | 
 | ||||||
| namespace regex { | namespace regex { | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
| static RegexDebug s_regex_dbg(stderr); | static RegexDebug s_regex_dbg(stderr); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -138,7 +138,7 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional | ||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|     s_regex_dbg.print_header(); |     s_regex_dbg.print_header(); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -314,7 +314,7 @@ Optional<bool> Matcher<Parser>::execute(const MatchInput& input, MatchState& sta | ||||||
|             return {}; |             return {}; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|         s_regex_dbg.print_opcode("VM", *opcode, state, recursion_level, false); |         s_regex_dbg.print_opcode("VM", *opcode, state, recursion_level, false); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -326,7 +326,7 @@ Optional<bool> Matcher<Parser>::execute(const MatchInput& input, MatchState& sta | ||||||
|             result = opcode->execute(input, state, output); |             result = opcode->execute(input, state, output); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|         s_regex_dbg.print_result(*opcode, bytecode, input, state, result); |         s_regex_dbg.print_result(*opcode, bytecode, input, state, result); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | @ -369,14 +369,14 @@ ALWAYS_INLINE Optional<bool> Matcher<Parser>::execute_low_prio_forks(const Match | ||||||
|     for (auto& state : states) { |     for (auto& state : states) { | ||||||
| 
 | 
 | ||||||
|         state.instruction_position = state.fork_at_position; |         state.instruction_position = state.fork_at_position; | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|         fprintf(stderr, "Forkstay... ip = %lu, sp = %lu\n", state.instruction_position, state.string_position); |         fprintf(stderr, "Forkstay... ip = %lu, sp = %lu\n", state.instruction_position, state.string_position); | ||||||
| #endif | #endif | ||||||
|         auto success = execute(input, state, output, recursion_level); |         auto success = execute(input, state, output, recursion_level); | ||||||
|         if (!success.has_value()) |         if (!success.has_value()) | ||||||
|             return {}; |             return {}; | ||||||
|         if (success.value()) { |         if (success.value()) { | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|             fprintf(stderr, "Forkstay succeeded... ip = %lu, sp = %lu\n", state.instruction_position, state.string_position); |             fprintf(stderr, "Forkstay succeeded... ip = %lu, sp = %lu\n", state.instruction_position, state.string_position); | ||||||
| #endif | #endif | ||||||
|             original_state = state; |             original_state = state; | ||||||
|  |  | ||||||
|  | @ -141,7 +141,7 @@ Parser::Result Parser::parse(Optional<AllOptions> regex_options) | ||||||
|     else |     else | ||||||
|         set_error(Error::InvalidPattern); |         set_error(Error::InvalidPattern); | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|     fprintf(stderr, "[PARSER] Produced bytecode with %lu entries (opcodes + arguments)\n", m_parser_state.bytecode.size()); |     fprintf(stderr, "[PARSER] Produced bytecode with %lu entries (opcodes + arguments)\n", m_parser_state.bytecode.size()); | ||||||
| #endif | #endif | ||||||
|     return { |     return { | ||||||
|  | @ -454,7 +454,7 @@ ALWAYS_INLINE bool PosixExtendedParser::parse_sub_expression(ByteCode& stack, si | ||||||
|         if (match(TokenType::EscapeSequence)) { |         if (match(TokenType::EscapeSequence)) { | ||||||
|             length = 1; |             length = 1; | ||||||
|             Token t = consume(); |             Token t = consume(); | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|             printf("[PARSER] EscapeSequence with substring %s\n", String(t.value()).characters()); |             printf("[PARSER] EscapeSequence with substring %s\n", String(t.value()).characters()); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -376,7 +376,7 @@ TEST_CASE(ini_file_entries) | ||||||
|     Regex<PosixExtended> re("[[:alpha:]]*=([[:digit:]]*)|\\[(.*)\\]"); |     Regex<PosixExtended> re("[[:alpha:]]*=([[:digit:]]*)|\\[(.*)\\]"); | ||||||
|     RegexResult result; |     RegexResult result; | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|     RegexDebug regex_dbg(stderr); |     RegexDebug regex_dbg(stderr); | ||||||
|     regex_dbg.print_raw_bytecode(re); |     regex_dbg.print_raw_bytecode(re); | ||||||
|     regex_dbg.print_header(); |     regex_dbg.print_header(); | ||||||
|  | @ -387,7 +387,7 @@ TEST_CASE(ini_file_entries) | ||||||
|     EXPECT_EQ(re.search(haystack.view(), result, PosixFlags::Multiline), true); |     EXPECT_EQ(re.search(haystack.view(), result, PosixFlags::Multiline), true); | ||||||
|     EXPECT_EQ(result.count, 3u); |     EXPECT_EQ(result.count, 3u); | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|     for (auto& v : result.matches) |     for (auto& v : result.matches) | ||||||
|         fprintf(stderr, "%s\n", v.view.to_string().characters()); |         fprintf(stderr, "%s\n", v.view.to_string().characters()); | ||||||
| #endif | #endif | ||||||
|  | @ -425,7 +425,7 @@ TEST_CASE(named_capture_group) | ||||||
|     Regex<PosixExtended> re("[[:alpha:]]*=(?<Test>[[:digit:]]*)"); |     Regex<PosixExtended> re("[[:alpha:]]*=(?<Test>[[:digit:]]*)"); | ||||||
|     RegexResult result; |     RegexResult result; | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|     RegexDebug regex_dbg(stderr); |     RegexDebug regex_dbg(stderr); | ||||||
|     regex_dbg.print_raw_bytecode(re); |     regex_dbg.print_raw_bytecode(re); | ||||||
|     regex_dbg.print_header(); |     regex_dbg.print_header(); | ||||||
|  | @ -446,7 +446,7 @@ TEST_CASE(a_star) | ||||||
|     Regex<PosixExtended> re("a*"); |     Regex<PosixExtended> re("a*"); | ||||||
|     RegexResult result; |     RegexResult result; | ||||||
| 
 | 
 | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|     RegexDebug regex_dbg(stderr); |     RegexDebug regex_dbg(stderr); | ||||||
|     regex_dbg.print_raw_bytecode(re); |     regex_dbg.print_raw_bytecode(re); | ||||||
|     regex_dbg.print_header(); |     regex_dbg.print_header(); | ||||||
|  | @ -506,7 +506,7 @@ TEST_CASE(ECMA262_parse) | ||||||
|     for (auto& test : tests) { |     for (auto& test : tests) { | ||||||
|         Regex<ECMA262> re(test.pattern); |         Regex<ECMA262> re(test.pattern); | ||||||
|         EXPECT_EQ(re.parser_result.error, test.expected_error); |         EXPECT_EQ(re.parser_result.error, test.expected_error); | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|         dbgln("\n"); |         dbgln("\n"); | ||||||
|         RegexDebug regex_dbg(stderr); |         RegexDebug regex_dbg(stderr); | ||||||
|         regex_dbg.print_raw_bytecode(re); |         regex_dbg.print_raw_bytecode(re); | ||||||
|  | @ -551,7 +551,7 @@ TEST_CASE(ECMA262_match) | ||||||
| 
 | 
 | ||||||
|     for (auto& test : tests) { |     for (auto& test : tests) { | ||||||
|         Regex<ECMA262> re(test.pattern, test.options); |         Regex<ECMA262> re(test.pattern, test.options); | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|         dbgln("\n"); |         dbgln("\n"); | ||||||
|         RegexDebug regex_dbg(stderr); |         RegexDebug regex_dbg(stderr); | ||||||
|         regex_dbg.print_raw_bytecode(re); |         regex_dbg.print_raw_bytecode(re); | ||||||
|  | @ -584,7 +584,7 @@ TEST_CASE(replace) | ||||||
| 
 | 
 | ||||||
|     for (auto& test : tests) { |     for (auto& test : tests) { | ||||||
|         Regex<ECMA262> re(test.pattern, test.options); |         Regex<ECMA262> re(test.pattern, test.options); | ||||||
| #ifdef REGEX_DEBUG | #if REGEX_DEBUG | ||||||
|         dbgln("\n"); |         dbgln("\n"); | ||||||
|         RegexDebug regex_dbg(stderr); |         RegexDebug regex_dbg(stderr); | ||||||
|         regex_dbg.print_raw_bytecode(re); |         regex_dbg.print_raw_bytecode(re); | ||||||
|  |  | ||||||
|  | @ -91,7 +91,7 @@ ssize_t TLSv12::handle_hello(ReadonlyBytes buffer, WritePacketStage& write_packe | ||||||
|     if (session_length && session_length <= 32) { |     if (session_length && session_length <= 32) { | ||||||
|         memcpy(m_context.session_id, buffer.offset_pointer(res), session_length); |         memcpy(m_context.session_id, buffer.offset_pointer(res), session_length); | ||||||
|         m_context.session_id_size = session_length; |         m_context.session_id_size = session_length; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("Remote session ID:"); |         dbgln("Remote session ID:"); | ||||||
|         print_buffer(ReadonlyBytes { m_context.session_id, session_length }); |         print_buffer(ReadonlyBytes { m_context.session_id, session_length }); | ||||||
| #endif | #endif | ||||||
|  | @ -228,7 +228,7 @@ ssize_t TLSv12::handle_finished(ReadonlyBytes buffer, WritePacketStage& write_pa | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| // TODO: Compare Hashes
 | // TODO: Compare Hashes
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("FIXME: handle_finished :: Check message validity"); |     dbgln("FIXME: handle_finished :: Check message validity"); | ||||||
| #endif | #endif | ||||||
|     m_context.connection_status = ConnectionStatus::Established; |     m_context.connection_status = ConnectionStatus::Established; | ||||||
|  | @ -276,7 +276,7 @@ void TLSv12::build_random(PacketBuilder& builder) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto& certificate = m_context.certificates[certificate_option.value()]; |     auto& certificate = m_context.certificates[certificate_option.value()]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("PreMaster secret"); |     dbgln("PreMaster secret"); | ||||||
|     print_buffer(m_context.premaster_key); |     print_buffer(m_context.premaster_key); | ||||||
| #endif | #endif | ||||||
|  | @ -287,7 +287,7 @@ void TLSv12::build_random(PacketBuilder& builder) | ||||||
|     auto outbuf = Bytes { out, rsa.output_size() }; |     auto outbuf = Bytes { out, rsa.output_size() }; | ||||||
|     rsa.encrypt(m_context.premaster_key, outbuf); |     rsa.encrypt(m_context.premaster_key, outbuf); | ||||||
| 
 | 
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("Encrypted: "); |     dbgln("Encrypted: "); | ||||||
|     print_buffer(outbuf); |     print_buffer(outbuf); | ||||||
| #endif | #endif | ||||||
|  | @ -305,7 +305,7 @@ void TLSv12::build_random(PacketBuilder& builder) | ||||||
| ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
| { | { | ||||||
|     if (m_context.connection_status == ConnectionStatus::Established) { |     if (m_context.connection_status == ConnectionStatus::Established) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("Renegotiation attempt ignored"); |         dbgln("Renegotiation attempt ignored"); | ||||||
| #endif | #endif | ||||||
|         // FIXME: We should properly say "NoRenegotiation", but that causes a handshake failure
 |         // FIXME: We should properly say "NoRenegotiation", but that causes a handshake failure
 | ||||||
|  | @ -359,7 +359,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[2]; |             ++m_context.handshake_messages[2]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("server hello"); |             dbgln("server hello"); | ||||||
| #endif | #endif | ||||||
|             if (m_context.is_server) { |             if (m_context.is_server) { | ||||||
|  | @ -380,7 +380,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[4]; |             ++m_context.handshake_messages[4]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("certificate"); |             dbgln("certificate"); | ||||||
| #endif | #endif | ||||||
|             if (m_context.connection_status == ConnectionStatus::Negotiating) { |             if (m_context.connection_status == ConnectionStatus::Negotiating) { | ||||||
|  | @ -415,7 +415,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[5]; |             ++m_context.handshake_messages[5]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("server key exchange"); |             dbgln("server key exchange"); | ||||||
| #endif | #endif | ||||||
|             if (m_context.is_server) { |             if (m_context.is_server) { | ||||||
|  | @ -451,7 +451,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[7]; |             ++m_context.handshake_messages[7]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("server hello done"); |             dbgln("server hello done"); | ||||||
| #endif | #endif | ||||||
|             if (m_context.is_server) { |             if (m_context.is_server) { | ||||||
|  | @ -470,7 +470,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[8]; |             ++m_context.handshake_messages[8]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("certificate verify"); |             dbgln("certificate verify"); | ||||||
| #endif | #endif | ||||||
|             if (m_context.connection_status == ConnectionStatus::KeyExchange) { |             if (m_context.connection_status == ConnectionStatus::KeyExchange) { | ||||||
|  | @ -486,7 +486,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[9]; |             ++m_context.handshake_messages[9]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("client key exchange"); |             dbgln("client key exchange"); | ||||||
| #endif | #endif | ||||||
|             if (m_context.is_server) { |             if (m_context.is_server) { | ||||||
|  | @ -506,7 +506,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             ++m_context.handshake_messages[10]; |             ++m_context.handshake_messages[10]; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("finished"); |             dbgln("finished"); | ||||||
| #endif | #endif | ||||||
|             payload_res = handle_finished(buffer.slice(1, payload_size), write_packets); |             payload_res = handle_finished(buffer.slice(1, payload_size), write_packets); | ||||||
|  | @ -593,7 +593,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|             break; |             break; | ||||||
|         case WritePacketStage::ClientHandshake: |         case WritePacketStage::ClientHandshake: | ||||||
|             if (m_context.client_verified == VerificationNeeded) { |             if (m_context.client_verified == VerificationNeeded) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|                 dbgln("> Client Certificate"); |                 dbgln("> Client Certificate"); | ||||||
| #endif | #endif | ||||||
|                 auto packet = build_certificate(); |                 auto packet = build_certificate(); | ||||||
|  | @ -601,14 +601,14 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|                 m_context.client_verified = Verified; |                 m_context.client_verified = Verified; | ||||||
|             } |             } | ||||||
|             { |             { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|                 dbgln("> Key exchange"); |                 dbgln("> Key exchange"); | ||||||
| #endif | #endif | ||||||
|                 auto packet = build_client_key_exchange(); |                 auto packet = build_client_key_exchange(); | ||||||
|                 write_packet(packet); |                 write_packet(packet); | ||||||
|             } |             } | ||||||
|             { |             { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|                 dbgln("> change cipher spec"); |                 dbgln("> change cipher spec"); | ||||||
| #endif | #endif | ||||||
|                 auto packet = build_change_cipher_spec(); |                 auto packet = build_change_cipher_spec(); | ||||||
|  | @ -617,7 +617,7 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|             m_context.cipher_spec_set = 1; |             m_context.cipher_spec_set = 1; | ||||||
|             m_context.local_sequence_number = 0; |             m_context.local_sequence_number = 0; | ||||||
|             { |             { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|                 dbgln("> client finished"); |                 dbgln("> client finished"); | ||||||
| #endif | #endif | ||||||
|                 auto packet = build_finished(); |                 auto packet = build_finished(); | ||||||
|  | @ -633,14 +633,14 @@ ssize_t TLSv12::handle_payload(ReadonlyBytes vbuffer) | ||||||
|         case WritePacketStage::Finished: |         case WritePacketStage::Finished: | ||||||
|             // finished
 |             // finished
 | ||||||
|             { |             { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|                 dbgln("> change cipher spec"); |                 dbgln("> change cipher spec"); | ||||||
| #endif | #endif | ||||||
|                 auto packet = build_change_cipher_spec(); |                 auto packet = build_change_cipher_spec(); | ||||||
|                 write_packet(packet); |                 write_packet(packet); | ||||||
|             } |             } | ||||||
|             { |             { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|                 dbgln("> client finished"); |                 dbgln("> client finished"); | ||||||
| #endif | #endif | ||||||
|                 auto packet = build_finished(); |                 auto packet = build_finished(); | ||||||
|  |  | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | #include <AK/Debug.h> | ||||||
| #include <LibCrypto/ASN1/DER.h> | #include <LibCrypto/ASN1/DER.h> | ||||||
| #include <LibCrypto/PK/Code/EMSA_PSS.h> | #include <LibCrypto/PK/Code/EMSA_PSS.h> | ||||||
| #include <LibTLS/TLSv12.h> | #include <LibTLS/TLSv12.h> | ||||||
|  | @ -72,7 +73,7 @@ bool TLSv12::expand_key() | ||||||
|     auto server_iv = key + offset; |     auto server_iv = key + offset; | ||||||
|     offset += iv_size; |     offset += iv_size; | ||||||
| 
 | 
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("client key"); |     dbgln("client key"); | ||||||
|     print_buffer(client_key, key_size); |     print_buffer(client_key, key_size); | ||||||
|     dbgln("server key"); |     dbgln("server key"); | ||||||
|  | @ -171,7 +172,7 @@ bool TLSv12::compute_master_secret(size_t length) | ||||||
|         ReadonlyBytes { m_context.remote_random, sizeof(m_context.remote_random) }); |         ReadonlyBytes { m_context.remote_random, sizeof(m_context.remote_random) }); | ||||||
| 
 | 
 | ||||||
|     m_context.premaster_key.clear(); |     m_context.premaster_key.clear(); | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("master key:"); |     dbgln("master key:"); | ||||||
|     print_buffer(m_context.master_key); |     print_buffer(m_context.master_key); | ||||||
| #endif | #endif | ||||||
|  | @ -213,7 +214,7 @@ ByteBuffer TLSv12::build_certificate() | ||||||
|     builder.append((u8)HandshakeType::CertificateMessage); |     builder.append((u8)HandshakeType::CertificateMessage); | ||||||
| 
 | 
 | ||||||
|     if (!total_certificate_size) { |     if (!total_certificate_size) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("No certificates, sending empty certificate message"); |         dbgln("No certificates, sending empty certificate message"); | ||||||
| #endif | #endif | ||||||
|         builder.append_u24(certificate_vector_header_size); |         builder.append_u24(certificate_vector_header_size); | ||||||
|  |  | ||||||
|  | @ -200,7 +200,7 @@ ByteBuffer TLSv12::hmac_message(const ReadonlyBytes& buf, const Optional<Readonl | ||||||
|     u64 sequence_number = AK::convert_between_host_and_network_endian(local ? m_context.local_sequence_number : m_context.remote_sequence_number); |     u64 sequence_number = AK::convert_between_host_and_network_endian(local ? m_context.local_sequence_number : m_context.remote_sequence_number); | ||||||
|     ensure_hmac(mac_length, local); |     ensure_hmac(mac_length, local); | ||||||
|     auto& hmac = local ? *m_hmac_local : *m_hmac_remote; |     auto& hmac = local ? *m_hmac_local : *m_hmac_remote; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("========================= PACKET DATA =========================="); |     dbgln("========================= PACKET DATA =========================="); | ||||||
|     print_buffer((const u8*)&sequence_number, sizeof(u64)); |     print_buffer((const u8*)&sequence_number, sizeof(u64)); | ||||||
|     print_buffer(buf.data(), buf.size()); |     print_buffer(buf.data(), buf.size()); | ||||||
|  | @ -344,7 +344,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer) | ||||||
| 
 | 
 | ||||||
|             length = decrypted_span.size(); |             length = decrypted_span.size(); | ||||||
| 
 | 
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("Decrypted: "); |             dbgln("Decrypted: "); | ||||||
|             print_buffer(decrypted); |             print_buffer(decrypted); | ||||||
| #endif | #endif | ||||||
|  | @ -395,7 +395,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer) | ||||||
|         } |         } | ||||||
|         break; |         break; | ||||||
|     case MessageType::Handshake: |     case MessageType::Handshake: | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("tls handshake message"); |         dbgln("tls handshake message"); | ||||||
| #endif | #endif | ||||||
|         payload_res = handle_payload(plain); |         payload_res = handle_payload(plain); | ||||||
|  | @ -406,7 +406,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer) | ||||||
|             auto packet = build_alert(true, (u8)AlertDescription::UnexpectedMessage); |             auto packet = build_alert(true, (u8)AlertDescription::UnexpectedMessage); | ||||||
|             payload_res = (i8)Error::UnexpectedMessage; |             payload_res = (i8)Error::UnexpectedMessage; | ||||||
|         } else { |         } else { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("change cipher spec message"); |             dbgln("change cipher spec message"); | ||||||
| #endif | #endif | ||||||
|             m_context.cipher_spec_set = true; |             m_context.cipher_spec_set = true; | ||||||
|  |  | ||||||
|  | @ -77,7 +77,7 @@ String TLSv12::read_line(size_t max_size) | ||||||
| bool TLSv12::write(ReadonlyBytes buffer) | bool TLSv12::write(ReadonlyBytes buffer) | ||||||
| { | { | ||||||
|     if (m_context.connection_status != ConnectionStatus::Established) { |     if (m_context.connection_status != ConnectionStatus::Established) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("write request while not connected"); |         dbgln("write request while not connected"); | ||||||
| #endif | #endif | ||||||
|         return false; |         return false; | ||||||
|  | @ -193,7 +193,7 @@ bool TLSv12::check_connection_state(bool read) | ||||||
| { | { | ||||||
|     if (!Core::Socket::is_open() || !Core::Socket::is_connected() || Core::Socket::eof()) { |     if (!Core::Socket::is_open() || !Core::Socket::is_connected() || Core::Socket::eof()) { | ||||||
|         // an abrupt closure (the server is a jerk)
 |         // an abrupt closure (the server is a jerk)
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("Socket not open, assuming abrupt closure"); |         dbgln("Socket not open, assuming abrupt closure"); | ||||||
| #endif | #endif | ||||||
|         m_context.connection_finished = true; |         m_context.connection_finished = true; | ||||||
|  | @ -216,7 +216,7 @@ bool TLSv12::check_connection_state(bool read) | ||||||
|                 m_context.application_buffer.size()); |                 m_context.application_buffer.size()); | ||||||
|         } else { |         } else { | ||||||
|             m_context.connection_finished = false; |             m_context.connection_finished = false; | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("FINISHED"); |             dbgln("FINISHED"); | ||||||
| #endif | #endif | ||||||
|         } |         } | ||||||
|  | @ -237,7 +237,7 @@ bool TLSv12::flush() | ||||||
|     if (out_buffer_length == 0) |     if (out_buffer_length == 0) | ||||||
|         return true; |         return true; | ||||||
| 
 | 
 | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|     dbgln("SENDING..."); |     dbgln("SENDING..."); | ||||||
|     print_buffer(out_buffer, out_buffer_length); |     print_buffer(out_buffer, out_buffer_length); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -208,7 +208,7 @@ static ssize_t _parse_asn1(const Context& context, Certificate& cert, const u8* | ||||||
|         size_t length = _get_asn1_length((const u8*)&buffer[position], size - position, octets); |         size_t length = _get_asn1_length((const u8*)&buffer[position], size - position, octets); | ||||||
| 
 | 
 | ||||||
|         if (octets > 4 || octets > size - position) { |         if (octets > 4 || octets > size - position) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("could not read the certificate"); |             dbgln("could not read the certificate"); | ||||||
| #endif | #endif | ||||||
|             return position; |             return position; | ||||||
|  | @ -216,7 +216,7 @@ static ssize_t _parse_asn1(const Context& context, Certificate& cert, const u8* | ||||||
| 
 | 
 | ||||||
|         position += octets; |         position += octets; | ||||||
|         if (size - position < length) { |         if (size - position < length) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("not enough data for sequence"); |             dbgln("not enough data for sequence"); | ||||||
| #endif | #endif | ||||||
|             return (i8)Error::NeedMoreData; |             return (i8)Error::NeedMoreData; | ||||||
|  | @ -415,7 +415,7 @@ static ssize_t _parse_asn1(const Context& context, Certificate& cert, const u8* | ||||||
|         auto fingerprint = hash.digest(); |         auto fingerprint = hash.digest(); | ||||||
|         cert.fingerprint.grow(fingerprint.data_length()); |         cert.fingerprint.grow(fingerprint.data_length()); | ||||||
|         cert.fingerprint.overwrite(0, fingerprint.immutable_data(), fingerprint.data_length()); |         cert.fingerprint.overwrite(0, fingerprint.immutable_data(), fingerprint.data_length()); | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("Certificate fingerprint:"); |         dbgln("Certificate fingerprint:"); | ||||||
|         print_buffer(cert.fingerprint); |         print_buffer(cert.fingerprint); | ||||||
| #endif | #endif | ||||||
|  | @ -446,7 +446,7 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer) | ||||||
|     ssize_t res = 0; |     ssize_t res = 0; | ||||||
| 
 | 
 | ||||||
|     if (buffer.size() < 3) { |     if (buffer.size() < 3) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("not enough certificate header data"); |         dbgln("not enough certificate header data"); | ||||||
| #endif | #endif | ||||||
|         return (i8)Error::NeedMoreData; |         return (i8)Error::NeedMoreData; | ||||||
|  | @ -462,7 +462,7 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer) | ||||||
|     res += 3; |     res += 3; | ||||||
| 
 | 
 | ||||||
|     if (certificate_total_length > buffer.size() - res) { |     if (certificate_total_length > buffer.size() - res) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|         dbgln("not enough data for claimed total cert length"); |         dbgln("not enough data for claimed total cert length"); | ||||||
| #endif | #endif | ||||||
|         return (i8)Error::NeedMoreData; |         return (i8)Error::NeedMoreData; | ||||||
|  | @ -475,7 +475,7 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer) | ||||||
|     while (size > 0) { |     while (size > 0) { | ||||||
|         ++index; |         ++index; | ||||||
|         if (buffer.size() - res < 3) { |         if (buffer.size() - res < 3) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("not enough data for certificate length"); |             dbgln("not enough data for certificate length"); | ||||||
| #endif | #endif | ||||||
|             return (i8)Error::NeedMoreData; |             return (i8)Error::NeedMoreData; | ||||||
|  | @ -484,7 +484,7 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer) | ||||||
|         res += 3; |         res += 3; | ||||||
| 
 | 
 | ||||||
|         if (buffer.size() - res < certificate_size) { |         if (buffer.size() - res < certificate_size) { | ||||||
| #ifdef TLS_DEBUG | #if TLS_DEBUG | ||||||
|             dbgln("not enough data for certificate body"); |             dbgln("not enough data for certificate body"); | ||||||
| #endif | #endif | ||||||
|             return (i8)Error::NeedMoreData; |             return (i8)Error::NeedMoreData; | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ namespace Web::HTML { | ||||||
| 
 | 
 | ||||||
| #pragma GCC diagnostic ignored "-Wunused-label" | #pragma GCC diagnostic ignored "-Wunused-label" | ||||||
| 
 | 
 | ||||||
| #ifdef TOKENIZER_TRACE | #if TOKENIZER_TRACE | ||||||
| #    define PARSE_ERROR()                                                              \ | #    define PARSE_ERROR()                                                              \ | ||||||
|         do {                                                                           \ |         do {                                                                           \ | ||||||
|             dbgln("Parse error (tokenization) {} @ {}", __PRETTY_FUNCTION__, __LINE__) \ |             dbgln("Parse error (tokenization) {} @ {}", __PRETTY_FUNCTION__, __LINE__) \ | ||||||
|  |  | ||||||
|  | @ -94,7 +94,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap | ||||||
| 
 | 
 | ||||||
|     auto content_type = headers.get("Content-Type"); |     auto content_type = headers.get("Content-Type"); | ||||||
|     if (content_type.has_value()) { |     if (content_type.has_value()) { | ||||||
| #ifdef RESOURCE_DEBUG | #if RESOURCE_DEBUG | ||||||
|         dbgln("Content-Type header: '{}'", content_type.value()); |         dbgln("Content-Type header: '{}'", content_type.value()); | ||||||
| #endif | #endif | ||||||
|         m_encoding = encoding_from_content_type(content_type.value()); |         m_encoding = encoding_from_content_type(content_type.value()); | ||||||
|  | @ -104,7 +104,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, const HashMap | ||||||
|         m_encoding = "utf-8"; // FIXME: This doesn't seem nice.
 |         m_encoding = "utf-8"; // FIXME: This doesn't seem nice.
 | ||||||
|         m_mime_type = url().data_mime_type(); |         m_mime_type = url().data_mime_type(); | ||||||
|     } else { |     } else { | ||||||
| #ifdef RESOURCE_DEBUG | #if RESOURCE_DEBUG | ||||||
|         dbgln("No Content-Type header to go on! Guessing based on filename..."); |         dbgln("No Content-Type header to go on! Guessing based on filename..."); | ||||||
| #endif | #endif | ||||||
|         m_encoding = "utf-8"; // FIXME: This doesn't seem nice.
 |         m_encoding = "utf-8"; // FIXME: This doesn't seem nice.
 | ||||||
|  |  | ||||||
|  | @ -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&) | ||||||
| { | { | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
|     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&) | ||||||
| { | { | ||||||
| #ifdef DEBUG_SPAM | #if DEBUG_SPAM | ||||||
|     dbgln("handle: WebContentClient::DidUnhoverLink!"); |     dbgln("handle: WebContentClient::DidUnhoverLink!"); | ||||||
| #endif | #endif | ||||||
|     m_view.notify_server_did_unhover_link({}); |     m_view.notify_server_did_unhover_link({}); | ||||||
|  |  | ||||||
|  | @ -61,7 +61,7 @@ OwnPtr<Messages::ImageDecoderServer::DecodeImageResponse> ClientConnection::hand | ||||||
| { | { | ||||||
|     auto encoded_buffer = message.data(); |     auto encoded_buffer = message.data(); | ||||||
|     if (!encoded_buffer.is_valid()) { |     if (!encoded_buffer.is_valid()) { | ||||||
| #ifdef IMAGE_DECODER_DEBUG | #if IMAGE_DECODER_DEBUG | ||||||
|         dbgln("Encoded data is invalid"); |         dbgln("Encoded data is invalid"); | ||||||
| #endif | #endif | ||||||
|         return {}; |         return {}; | ||||||
|  | @ -71,7 +71,7 @@ OwnPtr<Messages::ImageDecoderServer::DecodeImageResponse> ClientConnection::hand | ||||||
|     auto bitmap = decoder->bitmap(); |     auto bitmap = decoder->bitmap(); | ||||||
| 
 | 
 | ||||||
|     if (!bitmap) { |     if (!bitmap) { | ||||||
| #ifdef IMAGE_DECODER_DEBUG | #if IMAGE_DECODER_DEBUG | ||||||
|         dbgln("Could not decode image from encoded data"); |         dbgln("Could not decode image from encoded data"); | ||||||
| #endif | #endif | ||||||
|         return make<Messages::ImageDecoderServer::DecodeImageResponse>(Gfx::ShareableBitmap()); |         return make<Messages::ImageDecoderServer::DecodeImageResponse>(Gfx::ShareableBitmap()); | ||||||
|  |  | ||||||
|  | @ -863,7 +863,7 @@ void Compositor::recompute_occlusions() | ||||||
|         return IterationDecision::Continue; |         return IterationDecision::Continue; | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| #ifdef OCCLUSIONS_DEBUG | #if OCCLUSIONS_DEBUG | ||||||
|     dbgln("OCCLUSIONS:"); |     dbgln("OCCLUSIONS:"); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -144,12 +144,12 @@ void Screen::on_receive_mouse_data(const MousePacket& packet) | ||||||
|     auto prev_location = m_physical_cursor_location / m_scale_factor; |     auto prev_location = m_physical_cursor_location / m_scale_factor; | ||||||
|     if (packet.is_relative) { |     if (packet.is_relative) { | ||||||
|         m_physical_cursor_location.move_by(packet.x * m_acceleration_factor, packet.y * m_acceleration_factor); |         m_physical_cursor_location.move_by(packet.x * m_acceleration_factor, packet.y * m_acceleration_factor); | ||||||
| #ifdef WSSCREEN_DEBUG | #if WSSCREEN_DEBUG | ||||||
|         dbgln("Screen: New Relative mouse point @ {}", m_physical_cursor_location); |         dbgln("Screen: New Relative mouse point @ {}", m_physical_cursor_location); | ||||||
| #endif | #endif | ||||||
|     } else { |     } else { | ||||||
|         m_physical_cursor_location = { packet.x * physical_width() / 0xffff, packet.y * physical_height() / 0xffff }; |         m_physical_cursor_location = { packet.x * physical_width() / 0xffff, packet.y * physical_height() / 0xffff }; | ||||||
| #ifdef WSSCREEN_DEBUG | #if WSSCREEN_DEBUG | ||||||
|         dbgln("Screen: New Absolute mouse point @ {}", m_physical_cursor_location); |         dbgln("Screen: New Absolute mouse point @ {}", m_physical_cursor_location); | ||||||
| #endif | #endif | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 asynts
						asynts