Linux gdbserver confused when event randomization picks process exit event
The tail end of linux_wait_1 isn't expecting that the select_event_lwp machinery can pick a whole-process exit event to report to GDB. When that happens, both gdb and gdbserver end up quite confused: ... (gdb) [Thread 24971.24971] #1 stopped. 0x0000003615a011f0 in ?? () c& Continuing. (gdb) [New Thread 24971.24981] [New Thread 24983.24983] [New Thread 24971.24982] [Thread 24983.24983] #3 stopped. 0x0000003615ebc7cc in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:130 130 pid = ARCH_FORK (); [New Thread 24984.24984] Error in re-setting breakpoint -16: PC register is not available Error in re-setting breakpoint -17: PC register is not available Error in re-setting breakpoint -18: PC register is not available Error in re-setting breakpoint -19: PC register is not available Error in re-setting breakpoint -24: PC register is not available Error in re-setting breakpoint -25: PC register is not available Error in re-setting breakpoint -26: PC register is not available Error in re-setting breakpoint -27: PC register is not available Error in re-setting breakpoint -28: PC register is not available Error in re-setting breakpoint -29: PC register is not available Error in re-setting breakpoint -30: PC register is not available PC register is not available (gdb) gdb/gdbserver/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE. (linux_thread_alive): Use lwp_is_marked_dead. (extended_event_reported): Delete. (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE instead of extended_event_reported. (mark_lwp_dead): Don't set the 'dead' flag. Store the waitstatus as well. (lwp_is_marked_dead): New function. (lwp_running): Use lwp_is_marked_dead. * linux-low.h: Delete 'dead' field, and update 'waitstatus's comment.
This commit is contained in:
parent
ad071a3055
commit
00db26facc
3 changed files with 54 additions and 35 deletions
|
@ -261,16 +261,13 @@ struct lwp_info
|
|||
event already received in a wait()). */
|
||||
int stopped;
|
||||
|
||||
/* If this flag is set, the lwp is known to be dead already (exit
|
||||
event already received in a wait(), and is cached in
|
||||
status_pending). */
|
||||
int dead;
|
||||
|
||||
/* When stopped is set, the last wait status recorded for this lwp. */
|
||||
int last_status;
|
||||
|
||||
/* This is used to store extended ptrace event information until
|
||||
it is reported to GDB. */
|
||||
/* If WAITSTATUS->KIND != TARGET_WAITKIND_IGNORE, the waitstatus for
|
||||
this LWP's last event, to pass to GDB without any further
|
||||
processing. This is used to store extended ptrace event
|
||||
information or exit status until it can be reported to GDB. */
|
||||
struct target_waitstatus waitstatus;
|
||||
|
||||
/* When stopped is set, this is where the lwp last stopped, with
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue