• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

GNU Binutils with patches for OS216


コミットメタ情報

リビジョン49e3f3e80956fb285529ef204857f55f6e5f3bba (tree)
日時2020-06-04 04:19:11
作者Pedro Alves <palves@redh...>
コミッターPedro Alves

ログメッセージ

Don't write to inferior_ptid in nto-procfs.c

A best effort patch, which fixes some bit rot and removes some
inferior_ptid references -- this port clearly hasn't been built in a
long while.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* nto-procfs.c (nto_procfs_target::update_thread_list): Avoid
inferior_ptid.
(nto_procfs_target::attach): Avoid inferior_ptid. Switch to
thread.
(nto_procfs_target::detach): Avoid referencing
inferior_ptid. Use switch_to_no_thread instead of writing to
inferior_ptid directly.
(nto_procfs_target::mourn_inferior): Use switch_to_no_thread
instead of writing to inferior_ptid directly.
(nto_procfs_target::create_inferior): Avoid inferior_ptid. Switch
to thread.

変更サマリ

差分

--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -393,7 +393,7 @@ nto_procfs_target::update_thread_list ()
393393
394394 prune_threads ();
395395
396- pid = inferior_ptid.pid ();
396+ pid = current_inferior ()->pid;
397397
398398 status.tid = 1;
399399
@@ -712,7 +712,7 @@ nto_procfs_target::attach (const char *args, int from_tty)
712712 printf_unfiltered ("Attaching to %s\n",
713713 target_pid_to_str (ptid_t (pid)).c_str ());
714714 }
715- inferior_ptid = do_attach (ptid_t (pid));
715+ ptid_t ptid = do_attach (ptid_t (pid));
716716 inf = current_inferior ();
717717 inferior_appeared (inf, pid);
718718 inf->attach_flag = 1;
@@ -720,7 +720,9 @@ nto_procfs_target::attach (const char *args, int from_tty)
720720 if (!target_is_pushed (ops))
721721 push_target (ops);
722722
723- procfs_update_thread_list (ops);
723+ update_thread_list ();
724+
725+ switch_to_thread (find_thread_ptid (this, ptid));
724726 }
725727
726728 void
@@ -1000,19 +1002,16 @@ nto_procfs_target::xfer_partial (enum target_object object,
10001002 void
10011003 nto_procfs_target::detach (inferior *inf, int from_tty)
10021004 {
1003- int pid;
1004-
10051005 target_announce_detach ();
10061006
10071007 if (siggnal)
1008- SignalKill (nto_node (), inferior_ptid.pid (), 0, 0, 0, 0);
1008+ SignalKill (nto_node (), inf->pid, 0, 0, 0, 0);
10091009
10101010 close (ctl_fd);
10111011 ctl_fd = -1;
10121012
1013- pid = inferior_ptid.pid ();
1014- inferior_ptid = null_ptid;
1015- detach_inferior (pid);
1013+ switch_to_no_thread ();
1014+ detach_inferior (inf->pid);
10161015 init_thread_list ();
10171016 inf_child_maybe_unpush_target (ops);
10181017 }
@@ -1132,7 +1131,7 @@ nto_procfs_target::mourn_inferior ()
11321131 SignalKill (nto_node (), inferior_ptid.pid (), 0, SIGKILL, 0, 0);
11331132 close (ctl_fd);
11341133 }
1135- inferior_ptid = null_ptid;
1134+ switch_to_no_thread ();
11361135 init_thread_list ();
11371136 inf_child_mourn_inferior (ops);
11381137 }
@@ -1303,8 +1302,9 @@ nto_procfs_target::create_inferior (const char *exec_file,
13031302 if (fds[2] != STDERR_FILENO)
13041303 close (fds[2]);
13051304
1306- inferior_ptid = do_attach (ptid_t (pid));
1307- procfs_update_thread_list (ops);
1305+ ptid_t ptid = do_attach (ptid_t (pid));
1306+ update_thread_list ();
1307+ switch_to_thread (find_thread_ptid (this, ptid));
13081308
13091309 inf = current_inferior ();
13101310 inferior_appeared (inf, pid);