• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂191f02e59316d8ff15684d24e1c8f4d07b2dd582 (tree)
時間2020-06-19 07:09:05
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

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.

Change Summary

差異

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
11 2020-06-18 Pedro Alves <palves@redhat.com>
22
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+
311 * remote.c (remote_target::remote_notice_new_inferior): Use
412 switch_to_thread instead of writing to inferior_ptid directly.
513 (remote_target::add_current_inferior_and_thread): Use
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -653,9 +653,10 @@ gdbsim_target::create_inferior (const char *exec_file,
653653 != SIM_RC_OK)
654654 error (_("Unable to create sim inferior."));
655655
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);
659660
660661 insert_breakpoints (); /* Needed to get correct instruction
661662 in cache. */
@@ -761,7 +762,7 @@ gdbsim_target_open (const char *args, int from_tty)
761762
762763 /* There's nothing running after "target sim" or "load"; not until
763764 "run". */
764- inferior_ptid = null_ptid;
765+ switch_to_no_thread ();
765766
766767 gdbsim_is_open = 1;
767768 }
@@ -945,7 +946,6 @@ gdbsim_target::wait (ptid_t ptid, struct target_waitstatus *status, int options)
945946 if (sim_data == NULL)
946947 error (_("Unable to wait for pid %d. Inferior not found."),
947948 ptid.pid ());
948- inferior_ptid = ptid;
949949 }
950950
951951 if (remote_debug)