Description
On Linux/Mac the exit code of the target process is obtained through waitpid (Linux docs, Apple docs, PAL code that makes use of it). However, unlike on Windows -- if multiple places in a process are calling waitpid, unless the WNOWAIT flag is used (which doesn't seem to exist OSX), then my understanding is that this will prevent other callers from obtaining the exit code.
The debugging services open a HANDLE to the target process (as expected) through the PAL, which means that they may wind up 'owning' the exit code of the target process, but they don't, at least as far as I know, wind up propagating this exit code to the debugger.
The potential fixes I can think of are:
- Add a new 'managed callback' interface with another version of the ExitProcess method which provides the exit code to the debugger if the debugging services were able to obtain it.
-or-
- Make changes to the PAL (ex: new fake access right to indicate that waitpid should be used) and opt-into them with the debugging services to avoid 'owning' the exit code. Thus the calling debugger can reliably use waitpid to obtain the exit code.
Regression?
No, this has never worked on Linux/Mac
Description
On Linux/Mac the exit code of the target process is obtained through waitpid (Linux docs, Apple docs, PAL code that makes use of it). However, unlike on Windows -- if multiple places in a process are calling waitpid, unless the
WNOWAITflag is used (which doesn't seem to exist OSX), then my understanding is that this will prevent other callers from obtaining the exit code.The debugging services open a HANDLE to the target process (as expected) through the PAL, which means that they may wind up 'owning' the exit code of the target process, but they don't, at least as far as I know, wind up propagating this exit code to the debugger.
The potential fixes I can think of are:
-or-
Regression?
No, this has never worked on Linux/Mac