1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:17:35 +00:00

Everywhere: Debug macros instead of constexpr.

This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
This commit is contained in:
asynts 2021-01-23 23:59:27 +01:00 committed by Andreas Kling
parent bb483f7ef4
commit 8465683dcf
98 changed files with 414 additions and 972 deletions

View file

@ -49,7 +49,7 @@ KResultOr<NonnullRefPtr<FileDescription>> FileDescription::create(Custody& custo
description->m_custody = custody;
auto result = description->attach();
if (result.is_error()) {
dbgln<debug_file_description>("Failed to create file description for custody: {}", result);
dbgln<FILEDESCRIPTION_DEBUG>("Failed to create file description for custody: {}", result);
return result;
}
return description;
@ -60,7 +60,7 @@ KResultOr<NonnullRefPtr<FileDescription>> FileDescription::create(File& file)
auto description = adopt(*new FileDescription(file));
auto result = description->attach();
if (result.is_error()) {
dbgln<debug_file_description>("Failed to create file description for file: {}", result);
dbgln<FILEDESCRIPTION_DEBUG>("Failed to create file description for file: {}", result);
return result;
}
return description;

View file

@ -986,7 +986,7 @@ NonnullRefPtr<Inode> ProcFS::root_inode() const
RefPtr<Inode> ProcFS::get_inode(InodeIdentifier inode_id) const
{
dbgln<debug_procfs>("ProcFS::get_inode({})", inode_id.index());
dbgln<PROCFS_DEBUG>("ProcFS::get_inode({})", inode_id.index());
if (inode_id == root_inode()->identifier())
return m_root_inode;
@ -1099,7 +1099,7 @@ void ProcFSInode::did_seek(FileDescription& description, off_t new_offset)
InodeMetadata ProcFSInode::metadata() const
{
dbgln<debug_procfs>("ProcFSInode::metadata({})", index());
dbgln<PROCFS_DEBUG>("ProcFSInode::metadata({})", index());
InodeMetadata metadata;
metadata.inode = identifier();
metadata.ctime = mepoch;
@ -1108,7 +1108,7 @@ InodeMetadata ProcFSInode::metadata() const
auto proc_parent_directory = to_proc_parent_directory(identifier());
auto proc_file_type = to_proc_file_type(identifier());
dbgln<debug_procfs>(" -> pid={}, fi={}, pdi={}", to_pid(identifier()).value(), (int)proc_file_type, (int)proc_parent_directory);
dbgln<PROCFS_DEBUG>(" -> pid={}, fi={}, pdi={}", to_pid(identifier()).value(), (int)proc_file_type, (int)proc_parent_directory);
if (is_process_related_file(identifier())) {
ProcessID pid = to_pid(identifier());
@ -1173,14 +1173,14 @@ InodeMetadata ProcFSInode::metadata() const
ssize_t ProcFSInode::read_bytes(off_t offset, ssize_t count, UserOrKernelBuffer& buffer, FileDescription* description) const
{
dbgln<debug_procfs>("ProcFS: read_bytes offset: {} count: {}", offset, count);
dbgln<PROCFS_DEBUG>("ProcFS: read_bytes offset: {} count: {}", offset, count);
ASSERT(offset >= 0);
ASSERT(buffer.user_or_kernel_ptr());
if (!description)
return -EIO;
if (!description->data()) {
dbgln<debug_procfs>("ProcFS: Do not have cached data!");
dbgln<PROCFS_DEBUG>("ProcFS: Do not have cached data!");
return -EIO;
}
@ -1204,7 +1204,7 @@ InodeIdentifier ProcFS::ProcFSDirectoryEntry::identifier(unsigned fsid) const
KResult ProcFSInode::traverse_as_directory(Function<bool(const FS::DirectoryEntryView&)> callback) const
{
dbgln<debug_procfs>("ProcFS: traverse_as_directory {}", index());
dbgln<PROCFS_DEBUG>("ProcFS: traverse_as_directory {}", index());
if (!Kernel::is_directory(identifier()))
return ENOTDIR;

View file

@ -400,7 +400,7 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::create(StringView path, int optio
return EROFS;
LexicalPath p(path);
dbgln<debug_vfs>("VFS::create: '{}' in {}", p.basename(), parent_inode.identifier());
dbgln<VFS_DEBUG>("VFS::create: '{}' in {}", p.basename(), parent_inode.identifier());
uid_t uid = owner.has_value() ? owner.value().uid : current_process->euid();
gid_t gid = owner.has_value() ? owner.value().gid : current_process->egid();
auto inode_or_error = parent_inode.create_child(p.basename(), mode, 0, uid, gid);
@ -442,7 +442,7 @@ KResult VFS::mkdir(StringView path, mode_t mode, Custody& base)
return EROFS;
LexicalPath p(path);
dbgln<debug_vfs>("VFS::mkdir: '{}' in {}", p.basename(), parent_inode.identifier());
dbgln<VFS_DEBUG>("VFS::mkdir: '{}' in {}", p.basename(), parent_inode.identifier());
return parent_inode.create_child(p.basename(), S_IFDIR | mode, 0, current_process->euid(), current_process->egid()).result();
}