1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 18:11:04 +09:00

Show PID when using debug attach flag with corerun (#53385)

This commit is contained in:
Aaron Robinson 2021-05-27 17:07:07 -07:00 committed by GitHub
parent 83355e0112
commit 41466ffdf3
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -74,7 +74,8 @@ static void wait_for_debugger()
}
else if (state == pal::debugger_state_t::not_attached)
{
pal::fprintf(stdout, W("Waiting for the debugger to attach. Press any key to continue ...\n"));
uint32_t pid = pal::get_process_id();
pal::fprintf(stdout, W("Waiting for the debugger to attach (PID: %u). Press any key to continue ...\n"), pid);
(void)getchar();
state = pal::is_debugger_attached();
}

View file

@ -106,6 +106,11 @@ namespace pal
return { buffer.get() };
}
uint32_t get_process_id()
{
return (uint32_t)::GetCurrentProcessId();
}
debugger_state_t is_debugger_attached()
{
return (::IsDebuggerPresent() == TRUE) ? debugger_state_t::attached : debugger_state_t::not_attached;
@ -367,6 +372,11 @@ namespace pal
return abs_path;
}
uint32_t get_process_id()
{
return (uint32_t)getpid();
}
debugger_state_t is_debugger_attached()
{
#if defined(__APPLE__)