rsx/cpu_thread: Fix cpu_thread::get_name() for RSX

This commit is contained in:
Eladash 2024-03-07 12:33:15 +02:00 committed by Elad.Ash
parent d39361705a
commit 69a90ef9e7
1 changed files with 18 additions and 4 deletions

View File

@ -1072,17 +1072,31 @@ void cpu_thread::add_remove_flags(bs_t<cpu_flag> to_add, bs_t<cpu_flag> to_remov
std::string cpu_thread::get_name() const std::string cpu_thread::get_name() const
{ {
// Downcast to correct type // Downcast to correct type
if (id_type() == 1) switch (id_type())
{
case 1:
{ {
return thread_ctrl::get_name(*static_cast<const named_thread<ppu_thread>*>(this)); return thread_ctrl::get_name(*static_cast<const named_thread<ppu_thread>*>(this));
} }
case 2:
if (id_type() == 2)
{ {
return thread_ctrl::get_name(*static_cast<const named_thread<spu_thread>*>(this)); return thread_ctrl::get_name(*static_cast<const named_thread<spu_thread>*>(this));
} }
default:
{
if (cpu_thread::get_current() == this && thread_ctrl::get_current())
{
return thread_ctrl::get_name();
}
fmt::throw_exception("Invalid cpu_thread type"); if (id_type() == 0x55)
{
return fmt::format("rsx::thread");
}
return fmt::format("Invalid cpu_thread type (0x%x)", id_type());
}
}
} }
u32 cpu_thread::get_pc() const u32 cpu_thread::get_pc() const