diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-01 13:23:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-01 13:23:26 +0100 |
commit | c3c8eae25ac2f80568cd74a2b0216d4aaa0088d3 (patch) | |
tree | c595aecb0d7d9c4666b5ad66ab0d1089d31c73d1 /Kernel | |
parent | 22d0a6d92f9e5a93b248eef0609d40ecb332f869 (diff) | |
download | serenity-c3c8eae25ac2f80568cd74a2b0216d4aaa0088d3.zip |
Kernel: Remove some unnecessary .characters() when doing dbg()<<String
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Arch/i386/CPU.cpp | 9 | ||||
-rw-r--r-- | Kernel/KSyms.cpp | 4 | ||||
-rw-r--r-- | Kernel/Net/IPv4Socket.cpp | 6 |
3 files changed, 11 insertions, 8 deletions
diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp index 6240535726..639b4f1c89 100644 --- a/Kernel/Arch/i386/CPU.cpp +++ b/Kernel/Arch/i386/CPU.cpp @@ -238,7 +238,6 @@ EH_ENTRY(14, page_fault); void page_fault_handler(RegisterState regs) { clac(); - //ASSERT(current); u32 fault_address; asm("movl %%cr2, %%eax" @@ -246,8 +245,12 @@ void page_fault_handler(RegisterState regs) #ifdef PAGE_FAULT_DEBUG u32 fault_page_directory = read_cr3(); - dbg() << (current ? Process::current->name().characters() : "(none)") << "(" << (current ? Process::current->pid() : 0) << "): ring" << (regs.cs & 3) << " " << (regs.exception_code & 1 ? "PV" : "NP") << " page fault in PD=" << String::format("%x", fault_page_directory) << ", " << (regs.exception_code & 8 ? "reserved-bit " : "") << regs.exception_code & 2 ? "write" : "read" - << " V" << String::format("%08x", fault_address); + dbg() << "Ring " << (regs.cs & 3) + << " " << (regs.exception_code & 1 ? "PV" : "NP") + << " page fault in PD=" << String::format("%x", fault_page_directory) << ", " + << (regs.exception_code & 8 ? "reserved-bit " : "") + << (regs.exception_code & 2 ? "write" : "read") + << " " << VirtualAddress(fault_address); #endif #ifdef PAGE_FAULT_DEBUG diff --git a/Kernel/KSyms.cpp b/Kernel/KSyms.cpp index 0348136473..2e70264a15 100644 --- a/Kernel/KSyms.cpp +++ b/Kernel/KSyms.cpp @@ -155,7 +155,7 @@ static void load_ksyms_from_data(const ByteBuffer& buffer) break; if (!symbol.ksym) { if (Process::current && Process::current->elf_loader() && Process::current->elf_loader()->has_symbols()) { - dbg() << String::format("%p", symbol.address) << " " << Process::current->elf_loader()->symbolicate(symbol.address).characters(); + dbg() << String::format("%p", symbol.address) << " " << Process::current->elf_loader()->symbolicate(symbol.address); } else { dbg() << String::format("%p", symbol.address) << " (no ELF symbols for process)"; } @@ -165,7 +165,7 @@ static void load_ksyms_from_data(const ByteBuffer& buffer) if (symbol.ksym->address == ksym_highest_address && offset > 4096) dbg() << String::format("%p", symbol.address); else - dbg() << String::format("%p", symbol.address) << " " << demangle(symbol.ksym->name).characters() << " +" << offset; + dbg() << String::format("%p", symbol.address) << " " << demangle(symbol.ksym->name) << " +" << offset; } } diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp index 255144ce91..df07aef537 100644 --- a/Kernel/Net/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -113,7 +113,7 @@ KResult IPv4Socket::bind(const sockaddr* user_address, socklen_t address_size) auto requested_local_port = ntohs(address.sin_port); if (!Process::current->is_superuser()) { if (requested_local_port < 1024) { - dbg() << Process::current << " (uid " << Process::current->uid() << ") attempted to bind " << class_name() << " to port " << requested_local_port; + dbg() << "UID " << Process::current->uid() << " attempted to bind " << class_name() << " to port " << requested_local_port; return KResult(-EACCES); } } @@ -122,7 +122,7 @@ KResult IPv4Socket::bind(const sockaddr* user_address, socklen_t address_size) m_local_port = requested_local_port; #ifdef IPV4_SOCKET_DEBUG - dbg() << "IPv4Socket::bind " << class_name() << "{" << this << "} to " << m_local_address.to_string().characters() << ":" << m_local_port; + dbg() << "IPv4Socket::bind " << class_name() << "{" << this << "} to " << m_local_address << ":" << m_local_port; #endif return protocol_bind(); @@ -316,7 +316,7 @@ ssize_t IPv4Socket::receive_packet_buffered(FileDescription& description, void* if (addr) { #ifdef IPV4_SOCKET_DEBUG - dbg() << "Incoming packet is from: " << packet.peer_address.to_string().characters() << ":" << packet.peer_port; + dbg() << "Incoming packet is from: " << packet.peer_address << ":" << packet.peer_port; #endif auto& ia = *(sockaddr_in*)addr; memcpy(&ia.sin_addr, &packet.peer_address, sizeof(IPv4Address)); |