GNU Binutils with patches for OS216
修訂 | 191f02e59316d8ff15684d24e1c8f4d07b2dd582 (tree) |
---|---|
時間 | 2020-06-19 07:09:05 |
作者 | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
Don't write to inferior_ptid in remote-sim.c
gdb/ChangeLog:
2020-06-18 Pedro Alves <palves@redhat.com>
* remote-sim.c (gdbsim_target::create_inferior): Switch to thread
after creating it, instead of writing to inferior_ptid.
(gdbsim_target_open): Use switch_to_no_thread instead of writing
to inferior_ptid directly.
(gdbsim_target::wait): Don't write to inferior_ptid.
@@ -1,5 +1,13 @@ | ||
1 | 1 | 2020-06-18 Pedro Alves <palves@redhat.com> |
2 | 2 | |
3 | + * remote-sim.c (gdbsim_target::create_inferior): Switch to thread | |
4 | + after creating it, instead of writing to inferior_ptid. | |
5 | + (gdbsim_target_open): Use switch_to_no_thread instead of writing | |
6 | + to inferior_ptid directly. | |
7 | + (gdbsim_target::wait): Don't write to inferior_ptid. | |
8 | + | |
9 | +2020-06-18 Pedro Alves <palves@redhat.com> | |
10 | + | |
3 | 11 | * remote.c (remote_target::remote_notice_new_inferior): Use |
4 | 12 | switch_to_thread instead of writing to inferior_ptid directly. |
5 | 13 | (remote_target::add_current_inferior_and_thread): Use |
@@ -653,9 +653,10 @@ gdbsim_target::create_inferior (const char *exec_file, | ||
653 | 653 | != SIM_RC_OK) |
654 | 654 | error (_("Unable to create sim inferior.")); |
655 | 655 | |
656 | - inferior_ptid = sim_data->remote_sim_ptid; | |
657 | - inferior_appeared (current_inferior (), inferior_ptid.pid ()); | |
658 | - add_thread_silent (this, inferior_ptid); | |
656 | + inferior_appeared (current_inferior (), | |
657 | + sim_data->remote_sim_ptid.pid ()); | |
658 | + thread_info *thr = add_thread_silent (this, sim_data->remote_sim_ptid); | |
659 | + switch_to_thread (thr); | |
659 | 660 | |
660 | 661 | insert_breakpoints (); /* Needed to get correct instruction |
661 | 662 | in cache. */ |
@@ -761,7 +762,7 @@ gdbsim_target_open (const char *args, int from_tty) | ||
761 | 762 | |
762 | 763 | /* There's nothing running after "target sim" or "load"; not until |
763 | 764 | "run". */ |
764 | - inferior_ptid = null_ptid; | |
765 | + switch_to_no_thread (); | |
765 | 766 | |
766 | 767 | gdbsim_is_open = 1; |
767 | 768 | } |
@@ -945,7 +946,6 @@ gdbsim_target::wait (ptid_t ptid, struct target_waitstatus *status, int options) | ||
945 | 946 | if (sim_data == NULL) |
946 | 947 | error (_("Unable to wait for pid %d. Inferior not found."), |
947 | 948 | ptid.pid ()); |
948 | - inferior_ptid = ptid; | |
949 | 949 | } |
950 | 950 | |
951 | 951 | if (remote_debug) |