aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.h
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-11-12 20:50:29 +0000
committerPedro Alves <pedro@palves.net>2023-03-27 19:02:04 +0100
commit57573e54afb9f7ed957eec43dfd2830f2384c970 (patch)
tree86ed9f239c76c3a714a5bac49bb2315263eed856 /gdb/linux-nat.h
parent58c010877e77ad9dd4e14272f9500d40b75e7429 (diff)
downloadfsf-binutils-gdb-57573e54afb9f7ed957eec43dfd2830f2384c970.zip
fsf-binutils-gdb-57573e54afb9f7ed957eec43dfd2830f2384c970.tar.gz
fsf-binutils-gdb-57573e54afb9f7ed957eec43dfd2830f2384c970.tar.bz2
linux-nat: introduce pending_status_str
I noticed that some debug log output printing an lwp's pending status wasn't considering lp->waitstatus. This fixes it, by introducing a new pending_status_str function. Also fix the comment in gdb/linux-nat.h describing lwp_info::waitstatus and details the description of lwp_info::status while at it. Change-Id: I66e5c7a363d30a925b093b195d72925ce5b6b980 Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/linux-nat.h')
-rw-r--r--gdb/linux-nat.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 45534c9..770fe92 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -232,7 +232,9 @@ struct lwp_info : intrusive_list_node<lwp_info>
/* The last resume GDB requested on this thread. */
resume_kind last_resume_kind = resume_continue;
- /* If non-zero, a pending wait status. */
+ /* If non-zero, a pending wait status. A pending process exit is
+ recorded in WAITSTATUS, because W_EXITCODE(0,0) happens to be
+ 0. */
int status = 0;
/* When 'stopped' is set, this is where the lwp last stopped, with
@@ -260,9 +262,10 @@ struct lwp_info : intrusive_list_node<lwp_info>
/* Non-zero if we expect a duplicated SIGINT. */
int ignore_sigint = 0;
- /* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus
- for this LWP's last event. This may correspond to STATUS above,
- or to a local variable in lin_lwp_wait. */
+ /* If WAITSTATUS->KIND != TARGET_WAITKIND_IGNORE, the waitstatus for
+ this LWP's last event. This usually corresponds to STATUS above,
+ however because W_EXITCODE(0,0) happens to be 0, a process exit
+ will be recorded here, while 'status == 0' is ambiguous. */
struct target_waitstatus waitstatus;
/* Signal whether we are in a SYSCALL_ENTRY or