From 247bade76a742f1520d78a796a134fb5291c95f3 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 10 Dec 2020 04:06:02 -0800 Subject: [PATCH] kern/sm: fix debug port output --- libmesosphere/source/kern_k_dump_object.cpp | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/libmesosphere/source/kern_k_dump_object.cpp b/libmesosphere/source/kern_k_dump_object.cpp index 74782947..4a5d72a2 100644 --- a/libmesosphere/source/kern_k_dump_object.cpp +++ b/libmesosphere/source/kern_k_dump_object.cpp @@ -181,21 +181,22 @@ namespace ams::kern::KDumpObject { } } } - MESOSPHERE_RELEASE_LOG("%-9s: Handle %08x Obj=%p Cur=%3d Peak=%3d Max=%3d\n", name, handle, obj.GetPointerUnsafe(), client->GetNumSessions(), client->GetPeakSessions(), client->GetMaxSessions()); + } - /* Identify any sessions. */ - { - for (auto it = accessor.begin(); it != end && client_port_process.IsNull(); ++it) { - KProcess *cur = static_cast(std::addressof(*it)); - for (size_t j = 0; j < cur->GetHandleTable().GetMaxCount(); ++j) { - ams::svc::Handle cur_h = ams::svc::InvalidHandle; - KScopedAutoObject cur_o = cur->GetHandleTable().GetObjectByIndex(std::addressof(cur_h), j); - if (cur_o.IsNull()) { - continue; - } - if (auto *session = cur_o->DynamicCast(); session != nullptr && session->GetParent()->GetParent() == client) { - MESOSPHERE_RELEASE_LOG(" Client %p Server %p %-12s: PID=%3lu\n", session, std::addressof(session->GetParent()->GetServerSession()), cur->GetName(), cur->GetId()); - } + MESOSPHERE_RELEASE_LOG("%-9s: Handle %08x Obj=%p Cur=%3d Peak=%3d Max=%3d\n", name, handle, obj.GetPointerUnsafe(), client->GetNumSessions(), client->GetPeakSessions(), client->GetMaxSessions()); + + /* Identify any sessions. */ + { + for (auto it = accessor.begin(); it != end; ++it) { + KProcess *cur = static_cast(std::addressof(*it)); + for (size_t j = 0; j < cur->GetHandleTable().GetMaxCount(); ++j) { + ams::svc::Handle cur_h = ams::svc::InvalidHandle; + KScopedAutoObject cur_o = cur->GetHandleTable().GetObjectByIndex(std::addressof(cur_h), j); + if (cur_o.IsNull()) { + continue; + } + if (auto *session = cur_o->DynamicCast(); session != nullptr && session->GetParent()->GetParent() == client) { + MESOSPHERE_RELEASE_LOG(" Client %p Server %p %-12s: PID=%3lu\n", session, std::addressof(session->GetParent()->GetServerSession()), cur->GetName(), cur->GetId()); } } }