• 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

修訂fe7d6a8db01f2a71520578267df7cd2d780ececb (tree)
時間2020-06-19 07:11:57
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Don't write to inferior_ptid in darwin-nat.c

Untested.

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

* darwin-nat.c (darwin_nat_target::decode_message): Don't write to
inferior_ptid.
(darwin_nat_target::stop_inferior, darwin_nat_target::kill): Avoid
inferior_ptid.
(darwin_attach_pid): Use switch_to_no_thread instead of writing to
inferior_ptid directly.
(darwin_nat_target::init_thread_list): Switch to thread, instead
of writing to inferior_ptid.
(darwin_nat_target::attach): Don't write to inferior_ptid.
(darwin_nat_target::get_ada_task_ptid): Avoid inferior_ptid.

Change Summary

差異

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,18 @@
11 2020-06-18 Pedro Alves <palves@redhat.com>
22
3+ * darwin-nat.c (darwin_nat_target::decode_message): Don't write to
4+ inferior_ptid.
5+ (darwin_nat_target::stop_inferior, darwin_nat_target::kill): Avoid
6+ inferior_ptid.
7+ (darwin_attach_pid): Use switch_to_no_thread instead of writing to
8+ inferior_ptid directly.
9+ (darwin_nat_target::init_thread_list): Switch to thread, instead
10+ of writing to inferior_ptid.
11+ (darwin_nat_target::attach): Don't write to inferior_ptid.
12+ (darwin_nat_target::get_ada_task_ptid): Avoid inferior_ptid.
13+
14+2020-06-18 Pedro Alves <palves@redhat.com>
15+
316 * gnu-nat.c (gnu_nat_target::create_inferior): Switch to the added
417 thread.
518 (gnu_nat_target::attach): Don't write to inferior_ptid directly.
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1111,8 +1111,7 @@ darwin_nat_target::decode_message (mach_msg_header_t *hdr,
11111111 /* Looks necessary on Leopard and harmless... */
11121112 wait4 (inf->pid, &wstatus, 0, NULL);
11131113
1114- inferior_ptid = ptid_t (inf->pid, 0, 0);
1115- return inferior_ptid;
1114+ return ptid_t (inf->pid);
11161115 }
11171116 else
11181117 {
@@ -1402,7 +1401,7 @@ darwin_nat_target::stop_inferior (inferior *inf)
14021401 /* Wait until the process is really stopped. */
14031402 while (1)
14041403 {
1405- ptid = wait_1 (inferior_ptid, &wstatus);
1404+ ptid = wait_1 (ptid_t (inf->pid), &wstatus);
14061405 if (wstatus.kind == TARGET_WAITKIND_STOPPED
14071406 && wstatus.value.sig == GDB_SIGNAL_STOP)
14081407 break;
@@ -1527,13 +1526,13 @@ darwin_nat_target::kill ()
15271526
15281527 darwin_resume_inferior (inf);
15291528
1530- ptid = wait_1 (inferior_ptid, &wstatus);
1529+ ptid = wait_1 (ptid_t (inf->pid), &wstatus);
15311530 }
15321531 else if (errno != ESRCH)
15331532 warning (_("Failed to kill inferior: kill (%d, 9) returned [%s]"),
15341533 inf->pid, safe_strerror (errno));
15351534
1536- target_mourn_inferior (inferior_ptid);
1535+ target_mourn_inferior (ptid_t (inf->pid));
15371536 }
15381537
15391538 static void
@@ -1653,7 +1652,7 @@ darwin_attach_pid (struct inferior *inf)
16531652 catch (const gdb_exception &ex)
16541653 {
16551654 exit_inferior (inf);
1656- inferior_ptid = null_ptid;
1655+ switch_to_no_thread ();
16571656
16581657 throw;
16591658 }
@@ -1692,7 +1691,7 @@ darwin_nat_target::init_thread_list (inferior *inf)
16921691 struct thread_info *first_thread
16931692 = thread_info_from_private_thread_info (first_pti);
16941693
1695- inferior_ptid = first_thread->ptid;
1694+ switch_to_thread (first_thread);
16961695 }
16971696
16981697 /* The child must synchronize with gdb: gdb must set the exception port
@@ -2027,7 +2026,6 @@ darwin_nat_target::attach (const char *args, int from_tty)
20272026 error (_("Can't attach to process %d: %s (%d)"),
20282027 pid, safe_strerror (errno), errno);
20292028
2030- inferior_ptid = ptid_t (pid);
20312029 inf = current_inferior ();
20322030 inferior_appeared (inf, pid);
20332031 inf->attach_flag = 1;
@@ -2439,7 +2437,7 @@ darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
24392437 names_count * sizeof (mach_port_t));
24402438
24412439 if (res)
2442- return ptid_t (inferior_ptid.pid (), 0, res);
2440+ return ptid_t (current_inferior ()->pid, 0, res);
24432441 else
24442442 return null_ptid;
24452443 }