mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Remove some unnecessary .characters() when doing dbg()<<String
This commit is contained in:
parent
22d0a6d92f
commit
c3c8eae25a
Notes:
sideshowbarker
2024-07-19 08:57:24 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c3c8eae25ac
3 changed files with 11 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue