Reputation:
When GDB finishes, I get the following output:
─── Output/messages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[Inferior 1 (process 18473) exited with code 05]
5
, after gdb has finished?18473
refer to the thread ID, the (unix) process ID, or something else?Upvotes: 2
Views: 50
Reputation: 213486
Is there a way to capture the exit code in the prompt, 5, after gdb has finished?
In GDB, you could use $_exitcode
convenience variable.
Does 18473 refer to the thread ID, the (unix) process ID, or something else?
The UNIX process ID.
Finally, why it is called an "inferior" process?
That's just what GDB developers call it. It the same as "the process GDB is debugging" (as opposed to the GDB process itself), and is much shorter. It's also "inferior" to GDB in the sense that GDB is controlling it (making it stop, single-step, or run as GDB desires).
Upvotes: 1