public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove windows_process_info::id
@ 2022-05-13 14:37 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-05-13 14:37 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4eab18b566a0a10d8436eb221c606df4a2803edc
commit 4eab18b566a0a10d8436eb221c606df4a2803edc
Author: Tom Tromey <tromey@adacore.com>
Date: Thu Apr 28 13:40:37 2022 -0600
Remove windows_process_info::id
I noticed that windows_process_info::id is only used by gdbserver, and
not really necessary. This patch removes it.
Diff:
---
gdb/nat/windows-nat.h | 1 -
gdbserver/win32-low.cc | 11 +++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index 27b653674c3..9f7f8b63192 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -144,7 +144,6 @@ struct windows_process_info
{
/* The process handle */
HANDLE handle = 0;
- DWORD id = 0;
DWORD main_thread_id = 0;
enum gdb_signal last_sig = GDB_SIGNAL_0;
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 192ea465e69..5b91ab768e5 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -337,7 +337,6 @@ do_initial_child_stuff (HANDLE proch, DWORD pid, int attached)
windows_process.last_sig = GDB_SIGNAL_0;
windows_process.handle = proch;
- windows_process.id = pid;
windows_process.main_thread_id = 0;
soft_interrupt_requested = 0;
@@ -678,12 +677,12 @@ win32_process_target::create_inferior (const char *program,
/* Wait till we are at 1st instruction in program, return new pid
(assuming success). */
- cs.last_ptid = wait (ptid_t (windows_process.id), &cs.last_status, 0);
+ cs.last_ptid = wait (ptid_t (pi.dwProcessId), &cs.last_status, 0);
/* Necessary for handle_v_kill. */
- signal_pid = windows_process.id;
+ signal_pid = pi.dwProcessId;
- return windows_process.id;
+ return pi.dwProcessId;
}
/* Attach to a running process.
@@ -816,7 +815,7 @@ win32_process_target::detach (process_info *process)
resume.sig = 0;
this->resume (&resume, 1);
- if (!DebugActiveProcessStop (windows_process.id))
+ if (!DebugActiveProcessStop (process->pid))
return -1;
DebugSetProcessKillOnExit (FALSE);
@@ -1375,7 +1374,7 @@ win32_process_target::write_memory (CORE_ADDR memaddr,
void
win32_process_target::request_interrupt ()
{
- if (GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, windows_process.id))
+ if (GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, signal_pid))
return;
/* GenerateConsoleCtrlEvent can fail if process id being debugged is
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-13 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 14:37 [binutils-gdb] Remove windows_process_info::id Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).