kern: improve some debug output

This commit is contained in:
Michael Scire 2021-08-20 00:06:43 -07:00
parent fe79bc253a
commit f175802136
2 changed files with 11 additions and 4 deletions

View file

@ -293,6 +293,13 @@ namespace ams::kern::arch::arm64 {
/* Print that an exception occurred. */ /* Print that an exception occurred. */
MESOSPHERE_RELEASE_LOG("Exception occurred. %016lx\n", GetCurrentProcess().GetProgramId()); MESOSPHERE_RELEASE_LOG("Exception occurred. %016lx\n", GetCurrentProcess().GetProgramId());
{
/* Print the current thread's registers. */
KDebug::PrintRegister();
/* Print a backtrace. */
KDebug::PrintBacktrace();
}
/* If the SVC is handled, handle it. */ /* If the SVC is handled, handle it. */
if (!svc::ResultNotHandled::Includes(result)) { if (!svc::ResultNotHandled::Includes(result)) {

View file

@ -62,7 +62,7 @@ namespace ams::kern::KDumpObject {
const auto end = accessor.end(); const auto end = accessor.end();
const auto &handle_table = process->GetHandleTable(); const auto &handle_table = process->GetHandleTable();
const size_t max_handles = handle_table.GetMaxCount(); const size_t max_handles = handle_table.GetTableSize();
for (size_t i = 0; i < max_handles; ++i) { for (size_t i = 0; i < max_handles; ++i) {
/* Get the object + handle. */ /* Get the object + handle. */
ams::svc::Handle handle = ams::svc::InvalidHandle; ams::svc::Handle handle = ams::svc::InvalidHandle;
@ -181,7 +181,7 @@ namespace ams::kern::KDumpObject {
const auto end = accessor.end(); const auto end = accessor.end();
const auto &handle_table = process->GetHandleTable(); const auto &handle_table = process->GetHandleTable();
const size_t max_handles = handle_table.GetMaxCount(); const size_t max_handles = handle_table.GetTableSize();
for (size_t i = 0; i < max_handles; ++i) { for (size_t i = 0; i < max_handles; ++i) {
/* Get the object + handle. */ /* Get the object + handle. */
ams::svc::Handle handle = ams::svc::InvalidHandle; ams::svc::Handle handle = ams::svc::InvalidHandle;
@ -203,7 +203,7 @@ namespace ams::kern::KDumpObject {
{ {
for (auto it = accessor.begin(); it != end && client_port_process.IsNull(); ++it) { for (auto it = accessor.begin(); it != end && client_port_process.IsNull(); ++it) {
KProcess *cur = static_cast<KProcess *>(std::addressof(*it)); KProcess *cur = static_cast<KProcess *>(std::addressof(*it));
for (size_t j = 0; j < cur->GetHandleTable().GetMaxCount(); ++j) { for (size_t j = 0; j < cur->GetHandleTable().GetTableSize(); ++j) {
ams::svc::Handle cur_h = ams::svc::InvalidHandle; ams::svc::Handle cur_h = ams::svc::InvalidHandle;
KScopedAutoObject cur_o = cur->GetHandleTable().GetObjectByIndex(std::addressof(cur_h), j); KScopedAutoObject cur_o = cur->GetHandleTable().GetObjectByIndex(std::addressof(cur_h), j);
if (cur_o.IsNotNull()) { if (cur_o.IsNotNull()) {
@ -236,7 +236,7 @@ namespace ams::kern::KDumpObject {
{ {
for (auto it = accessor.begin(); it != end; ++it) { for (auto it = accessor.begin(); it != end; ++it) {
KProcess *cur = static_cast<KProcess *>(std::addressof(*it)); KProcess *cur = static_cast<KProcess *>(std::addressof(*it));
for (size_t j = 0; j < cur->GetHandleTable().GetMaxCount(); ++j) { for (size_t j = 0; j < cur->GetHandleTable().GetTableSize(); ++j) {
ams::svc::Handle cur_h = ams::svc::InvalidHandle; ams::svc::Handle cur_h = ams::svc::InvalidHandle;
KScopedAutoObject cur_o = cur->GetHandleTable().GetObjectByIndex(std::addressof(cur_h), j); KScopedAutoObject cur_o = cur->GetHandleTable().GetObjectByIndex(std::addressof(cur_h), j);
if (cur_o.IsNull()) { if (cur_o.IsNull()) {