diff --git a/rpcs3/rpcs3qt/kernel_explorer.cpp b/rpcs3/rpcs3qt/kernel_explorer.cpp index a44a3e0e71..08403062c2 100644 --- a/rpcs3/rpcs3qt/kernel_explorer.cpp +++ b/rpcs3/rpcs3qt/kernel_explorer.cpp @@ -205,7 +205,35 @@ void kernel_explorer::Update() case SYS_LWMUTEX_OBJECT: { auto& lwm = static_cast(obj); - l_addTreeChild(node, qstr(fmt::format(u8"LWMutex: ID = 0x%08x “%s”, Wq = %zu", id, lv2_obj::name64(lwm.name), lwm.sq.size()))); + std::string owner_str = "unknown"; // Either invalid state or the lwmutex control data was moved from + sys_lwmutex_t lwm_data{}; + + if (lwm.control.try_read(lwm_data)) + { + switch (const u32 owner = lwm_data.vars.owner) + { + case lwmutex_free: owner_str = "free"; break; + //case lwmutex_dead: owner_str = "dead"; break; + case lwmutex_reserved: owner_str = "reserved"; break; + default: + { + if (owner >= ppu_thread::id_base && owner <= ppu_thread::id_base + ppu_thread::id_step - 1) + { + owner_str = fmt::format("0x%x", owner); + } + + break; + } + } + } + else + { + l_addTreeChild(node, qstr(fmt::format(u8"LWMutex: ID = 0x%08x “%s”, Wq = %zu (Couldn't extract control data)", id, lv2_obj::name64(lwm.name), lwm.sq.size()))); + break; + } + + l_addTreeChild(node, qstr(fmt::format(u8"LWMutex: ID = 0x%08x “%s”,%s Owner = %s, Locks = %u, Wq = %zu", id, lv2_obj::name64(lwm.name), + (lwm_data.attribute & SYS_SYNC_RECURSIVE) ? " Recursive," : "", owner_str, lwm_data.recursive_count, lwm.sq.size()))); break; } case SYS_TIMER_OBJECT: