Don't write to inferior_ptid in infrun.c
authorPedro Alves <palves@redhat.com>
Thu, 18 Jun 2020 20:28:21 +0000 (21:28 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 18 Jun 2020 22:05:18 +0000 (23:05 +0100)
commit18493a005acc8fbccbee4a2b767334eaaf636dd2
treefeefc799b5c90063c949a32f059fc76cda55a866
parenta0776b131d7a154125fdc4d22b1dda967c790ae9
Don't write to inferior_ptid in infrun.c

gdb/ChangeLog:
2020-06-18  Pedro Alves  <palves@redhat.com>

* infrun.c (generic_mourn_inferior): Use switch_to_thread instead
of writing to inferior_ptid.
(scoped_restore_exited_inferior): Delete.
(handle_vfork_child_exec_or_exit): Simplify using
scoped_restore_current_pspace_and_thread.  Use switch_to_thread
instead of writing to inferior_ptid.
(THREAD_STOPPED_BY): Delete.
(thread_stopped_by_watchpoint, thread_stopped_by_sw_breakpoint)
(thread_stopped_by_hw_breakpoint): Delete.
(save_waitstatus): Use
scoped_restore_current_thread+switch_to_thread, and call
target_stopped_by_watchpoint instead of
thread_stopped_by_watchpoint, target_stopped_by_sw_breakpoint
instead of thread_stopped_by_sw_breakpoint, and
target_stopped_by_hw_breakpoint instead of
thread_stopped_by_hw_breakpoint.
(handle_inferior_event)
<TARGET_WAITKIND_EXITED/TARGET_WAITKIND_SIGNALLED>: Don't write to
inferior_ptid directly, nor
set_current_inferior/set_current_program_space.  Use
switch_to_thread / switch_to_inferior_no_thread instead.
gdb/ChangeLog
gdb/infrun.c