aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-06-18 21:28:34 +0100
committerPedro Alves <palves@redhat.com>2020-06-18 23:16:25 +0100
commit31ce04e9e0ce96e752e2c53dfad5881d24e9f080 (patch)
tree4bebe259ec9548d269d83f7bc9086c4540955a9b /gdb
parent1ee1a363454d88a87ad2ade7530b2a7fb670021e (diff)
downloadgdb-31ce04e9e0ce96e752e2c53dfad5881d24e9f080.zip
gdb-31ce04e9e0ce96e752e2c53dfad5881d24e9f080.tar.gz
gdb-31ce04e9e0ce96e752e2c53dfad5881d24e9f080.tar.bz2
Don't write to inferior_ptid in windows-nat.c, part I
The inferior_ptid hack in do_initial_win32_stuff, added back in 2008: https://sourceware.org/ml/gdb-patches/2008-10/msg00012.html with: commit 9f9d052e600ed9436f9fd558d62a189c8cc3d43e Author: Pierre Muller <muller@sourceware.org> AuthorDate: Thu Oct 2 14:20:07 2008 +0000 * win32-nat.c (do_initial_win32_stuff): Set inferior_ptid. is no longer needed. Back then, current_inferior looked like this: struct inferior* current_inferior (void) { struct inferior *inf = find_inferior_pid (ptid_get_pid (inferior_ptid)); gdb_assert (inf); return inf; } Nowadays, current_inferior() just returns the global current_inferior_ pointer, which didn't exist back then. gdb/ChangeLog: 2020-06-18 Pedro Alves <palves@redhat.com> * windows-nat.c (do_initial_windows_stuff): No longer set inferior_ptid.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/windows-nat.c6
2 files changed, 4 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc8c371..18da2d9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2020-06-18 Pedro Alves <palves@redhat.com>
+ * windows-nat.c (do_initial_windows_stuff): No longer set inferior_ptid.
+
+2020-06-18 Pedro Alves <palves@redhat.com>
+
* go32-nat.c (go32_nat_target::create_inferior): Switch to thread
after creating it, instead of writing to inferior_ptid. Don't
write to inferior_ptid.
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index c3a4bdc..19bc52b 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2019,12 +2019,6 @@ do_initial_windows_stuff (struct target_ops *ops, DWORD pid, int attaching)
inferior_appeared (inf, pid);
inf->attach_flag = attaching;
- /* Make the new process the current inferior, so terminal handling
- can rely on it. When attaching, we don't know about any thread
- id here, but that's OK --- nothing should be referencing the
- current thread until we report an event out of windows_wait. */
- inferior_ptid = ptid_t (pid);
-
target_terminal::init ();
target_terminal::inferior ();