mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
kernel-explorer: Implement Filesystem Destcriptors information
This commit is contained in:
parent
6b11d82dd0
commit
7b3c0a69f3
2 changed files with 21 additions and 1 deletions
|
@ -190,6 +190,8 @@ struct lv2_fs_object
|
||||||
name[filename.size()] = 0;
|
name[filename.size()] = 0;
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual std::string to_string() const { return {}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lv2_file final : lv2_fs_object
|
struct lv2_file final : lv2_fs_object
|
||||||
|
@ -271,6 +273,19 @@ struct lv2_file final : lv2_fs_object
|
||||||
|
|
||||||
// Make file view from lv2_file object (for MSELF support)
|
// Make file view from lv2_file object (for MSELF support)
|
||||||
static fs::file make_view(const std::shared_ptr<lv2_file>& _file, u64 offset);
|
static fs::file make_view(const std::shared_ptr<lv2_file>& _file, u64 offset);
|
||||||
|
|
||||||
|
virtual std::string to_string() const override
|
||||||
|
{
|
||||||
|
std::string_view type_s;
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case lv2_file_type::regular: type_s = "Regular file"; break;
|
||||||
|
case lv2_file_type::sdata: type_s = "SDATA"; break;
|
||||||
|
case lv2_file_type::edata: type_s = "EDATA"; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt::format(u8"%s, “%s”, Mode: 0x%x, Flags: 0x%x", type_s, name.data(), mode, flags);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lv2_dir final : lv2_fs_object
|
struct lv2_dir final : lv2_fs_object
|
||||||
|
@ -296,6 +311,11 @@ struct lv2_dir final : lv2_fs_object
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual std::string to_string() const override
|
||||||
|
{
|
||||||
|
return fmt::format(u8"Directory, “%s”, Entries: %u/%u", name.data(), std::min<u64>(pos, entries.size()), entries.size());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// sys_fs_fcntl arg base class (left empty for PODness)
|
// sys_fs_fcntl arg base class (left empty for PODness)
|
||||||
|
|
|
@ -592,7 +592,7 @@ void kernel_explorer::Update()
|
||||||
|
|
||||||
idm::select<lv2_fs_object>([&](u32 id, lv2_fs_object& fo)
|
idm::select<lv2_fs_object>([&](u32 id, lv2_fs_object& fo)
|
||||||
{
|
{
|
||||||
add_leaf(find_node(m_tree, additional_nodes::file_descriptors), qstr(fmt::format(u8"FD %u: “%s”", id, fo.name.data())));
|
add_leaf(find_node(m_tree, additional_nodes::file_descriptors), qstr(fmt::format("FD %u: %s", id, fo.to_string())));
|
||||||
});
|
});
|
||||||
|
|
||||||
// RawSPU Threads (TODO)
|
// RawSPU Threads (TODO)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue