1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 11:13:19 +01:00

kernel-explorer: Implement Filesystem Destcriptors information

This commit is contained in:
Eladash 2020-09-15 17:37:37 +03:00 committed by Ivan
parent 6b11d82dd0
commit 7b3c0a69f3
2 changed files with 21 additions and 1 deletions

View File

@ -190,6 +190,8 @@ struct lv2_fs_object
name[filename.size()] = 0;
return name;
}
virtual std::string to_string() const { return {}; }
};
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)
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
@ -296,6 +311,11 @@ struct lv2_dir final : lv2_fs_object
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)

View File

@ -592,7 +592,7 @@ void kernel_explorer::Update()
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)