mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 03:06:52 -04:00
kern: improve kdebug attach semantics
This commit is contained in:
parent
4c73c461f1
commit
2b91956051
8 changed files with 369 additions and 135 deletions
|
@ -307,8 +307,14 @@ namespace ams::kern::arch::arm64 {
|
|||
R_UNLESS(debug.IsNotNull(), svc::ResultInvalidHandle());
|
||||
|
||||
/* Get the process from the debug object. */
|
||||
process = debug->GetProcess();
|
||||
R_UNLESS(process.IsNotNull(), svc::ResultProcessTerminated());
|
||||
R_UNLESS(debug->IsAttached(), svc::ResultProcessTerminated());
|
||||
R_UNLESS(debug->OpenProcess(), svc::ResultProcessTerminated());
|
||||
|
||||
/* Close the process when we're done. */
|
||||
ON_SCOPE_EXIT { debug->CloseProcess(); };
|
||||
|
||||
/* Get the proces. */
|
||||
KProcess * const process = debug->GetProcessUnsafe();
|
||||
|
||||
/* Set the value to be the context id. */
|
||||
value = process->GetId() & 0xFFFFFFFF;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue