diff --git a/Kernel/Net/LoopbackAdapter.cpp b/Kernel/Net/LoopbackAdapter.cpp index 5728b68b34..a5b8c1575f 100644 --- a/Kernel/Net/LoopbackAdapter.cpp +++ b/Kernel/Net/LoopbackAdapter.cpp @@ -49,7 +49,7 @@ LoopbackAdapter::~LoopbackAdapter() void LoopbackAdapter::send_raw(ReadonlyBytes payload) { - dbg() << "LoopbackAdapter: Sending " << payload.size() << " byte(s) to myself."; + dbgln("LoopbackAdapter: Sending {} byte(s) to myself.", payload.size()); did_receive(payload); } diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 0a11bbbca0..bc86bb0afd 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -149,7 +149,7 @@ KResult Socket::setsockopt(int level, int option, Userspace user_va } return KSuccess; default: - dbg() << "setsockopt(" << option << ") at SOL_SOCKET not implemented."; + dbgln("setsockopt({}) at SOL_SOCKET not implemented.", option); return KResult(-ENOPROTOOPT); } } @@ -226,7 +226,7 @@ KResult Socket::getsockopt(FileDescription&, int level, int option, Userspacerequest_type() == AsyncBlockDeviceRequest::Read) { - dbg() << "IDEChannel: Read block " << m_current_request_block_index << "/" << m_current_request->block_count(); + dbgln("IDEChannel: Read block {}/{}", m_current_request_block_index, m_current_request->block_count()); if (ata_do_read_sector()) { if (++m_current_request_block_index >= m_current_request->block_count()) { complete_current_request(AsyncDeviceRequest::Success); @@ -283,7 +283,7 @@ void IDEChannel::handle_irq(const RegisterState&) } } else { if (!m_current_request_flushing_cache) { - dbg() << "IDEChannel: Wrote block " << m_current_request_block_index << "/" << m_current_request->block_count(); + dbgln("IDEChannel: Wrote block {}/{}", m_current_request_block_index, m_current_request->block_count()); if (++m_current_request_block_index >= m_current_request->block_count()) { // We read the last block, flush cache ASSERT(!m_current_request_flushing_cache); diff --git a/Kernel/Storage/Partition/GUIDPartitionTable.cpp b/Kernel/Storage/Partition/GUIDPartitionTable.cpp index f7d3f7d843..81ea9666ea 100644 --- a/Kernel/Storage/Partition/GUIDPartitionTable.cpp +++ b/Kernel/Storage/Partition/GUIDPartitionTable.cpp @@ -133,7 +133,7 @@ bool GUIDPartitionTable::initialize() Array unique_guid {}; unique_guid.span().overwrite(0, entry.unique_guid, unique_guid.size()); String name = entry.partition_name; - dbg() << "Detected GPT partition (entry " << entry_index << ") , offset " << entry.first_lba << " , limit " << entry.last_lba; + dbgln("Detected GPT partition (entry={}), offset={}, limit={}", entry_index, entry.first_lba, entry.last_lba); m_partitions.append({ entry.first_lba, entry.last_lba, partition_type, unique_guid, entry.attributes, "" }); raw_byte_index += header().partition_entry_size; } diff --git a/Kernel/Syscalls/module.cpp b/Kernel/Syscalls/module.cpp index 7728b2faa4..c404d4970e 100644 --- a/Kernel/Syscalls/module.cpp +++ b/Kernel/Syscalls/module.cpp @@ -86,17 +86,17 @@ int Process::sys$module_load(Userspace user_path, size_t path_lengt switch (relocation.type()) { case R_386_PC32: { // PC-relative relocation - dbg() << "PC-relative relocation: " << relocation.symbol().name(); + dbgln("PC-relative relocation: {}", relocation.symbol().name()); u32 symbol_address = address_for_kernel_symbol(relocation.symbol().name()); if (symbol_address == 0) missing_symbols = true; - dbg() << " Symbol address: " << (void*)symbol_address; + dbgln(" Symbol address: {:p}", symbol_address); ptrdiff_t relative_offset = (char*)symbol_address - ((char*)&patch_ptr + 4); patch_ptr = relative_offset; break; } case R_386_32: // Absolute relocation - dbg() << "Absolute relocation: '" << relocation.symbol().name() << "' value:" << relocation.symbol().value() << ", index:" << relocation.symbol_index(); + dbgln("Absolute relocation: '{}' value={}, index={}", relocation.symbol().name(), relocation.symbol().value(), relocation.symbol_index()); if (relocation.symbol().bind() == STB_LOCAL) { auto* section_storage_containing_symbol = section_storage_by_name.get(relocation.symbol().section().name()).value_or(nullptr); @@ -104,13 +104,13 @@ int Process::sys$module_load(Userspace user_path, size_t path_lengt u32 symbol_address = (ptrdiff_t)(section_storage_containing_symbol + relocation.symbol().value()); if (symbol_address == 0) missing_symbols = true; - dbg() << " Symbol address: " << (void*)symbol_address; + dbgln(" Symbol address: {:p}", symbol_address); patch_ptr += symbol_address; } else if (relocation.symbol().bind() == STB_GLOBAL) { u32 symbol_address = address_for_kernel_symbol(relocation.symbol().name()); if (symbol_address == 0) missing_symbols = true; - dbg() << " Symbol address: " << (void*)symbol_address; + dbgln(" Symbol address: {:p}", symbol_address); patch_ptr += symbol_address; } else { ASSERT_NOT_REACHED(); @@ -133,7 +133,7 @@ int Process::sys$module_load(Userspace user_path, size_t path_lengt } elf_image->for_each_symbol([&](const ELF::Image::Symbol& symbol) { - dbg() << " - " << symbol.type() << " '" << symbol.name() << "' @ " << (void*)symbol.value() << ", size=" << symbol.size(); + dbgln(" - {} '{}' @ {:p}, size={}", symbol.type(), symbol.name(), symbol.value(), symbol.size()); if (symbol.name() == "module_init") { module->module_init = (ModuleInitPtr)(text_base + symbol.value()); } else if (symbol.name() == "module_fini") { @@ -150,7 +150,7 @@ int Process::sys$module_load(Userspace user_path, size_t path_lengt return -EINVAL; if (g_modules->contains(module->name)) { - dbg() << "a module with the name " << module->name << " is already loaded; please unload it first"; + dbgln("a module with the name {} is already loaded; please unload it first", module->name); return -EEXIST; } diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index 769a588272..a212e1ef4a 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -57,9 +57,9 @@ int Process::sys$mount(Userspace user_params) auto description = file_description(source_fd); if (!description.is_null()) - dbg() << "mount " << fs_type << ": source fd " << source_fd << " @ " << target; + dbgln("mount {}: source fd {} @ {}", fs_type, source_fd, target); else - dbg() << "mount " << fs_type << " @ " << target; + dbgln("mount {} @ {}", fs_type, target); auto custody_or_error = VFS::the().resolve_path(target, current_directory()); if (custody_or_error.is_error()) @@ -93,7 +93,7 @@ int Process::sys$mount(Userspace user_params) return -ENODEV; } - dbg() << "mount: attempting to mount " << description->absolute_path() << " on " << target; + dbgln("mount: attempting to mount {} on {}", description->absolute_path(), target); fs = Ext2FS::create(*description); } else if (fs_type == "9p" || fs_type == "Plan9FS") { @@ -114,15 +114,15 @@ int Process::sys$mount(Userspace user_params) } if (!fs->initialize()) { - dbg() << "mount: failed to initialize " << fs_type << " filesystem, fd - " << source_fd; + dbgln("mount: failed to initialize {} filesystem, fd={}", fs_type, source_fd); return -ENODEV; } auto result = VFS::the().mount(fs.release_nonnull(), target_custody, params.flags); if (!description.is_null()) - dbg() << "mount: successfully mounted " << description->absolute_path() << " on " << target; + dbgln("mount: successfully mounted {} on {}", description->absolute_path(), target); else - dbg() << "mount: successfully mounted " << target; + dbgln("mount: successfully mounted {}", target); return result; }