From dcdf46f5767b9f538dbf251a46afc1a861217552 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 30 May 2021 21:13:42 -0700 Subject: [PATCH] kern: slightly improve genericity of debugger break event --- libraries/libmesosphere/source/kern_k_debug_base.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/libmesosphere/source/kern_k_debug_base.cpp b/libraries/libmesosphere/source/kern_k_debug_base.cpp index cdd2e9b70..dafc018c4 100644 --- a/libraries/libmesosphere/source/kern_k_debug_base.cpp +++ b/libraries/libmesosphere/source/kern_k_debug_base.cpp @@ -308,8 +308,11 @@ namespace ams::kern { } /* Send an exception event to represent our breaking the process. */ - static_assert(util::size(thread_ids) >= 4); - this->PushDebugEvent(ams::svc::DebugEvent_Exception, ams::svc::DebugException_DebuggerBreak, thread_ids[0], thread_ids[1], thread_ids[2], thread_ids[3]); + /* TODO: How should this be handled in the case of more than 4 physical cores? */ + static_assert(util::size(thread_ids) <= 4); + [&](std::index_sequence) ALWAYS_INLINE_LAMBDA { + this->PushDebugEvent(ams::svc::DebugEvent_Exception, ams::svc::DebugException_DebuggerBreak, thread_ids[Ix]...); + }(std::make_index_sequence()); /* Signal. */ this->NotifyAvailable();