[v2] Fix kill of processes created by win32_create_inferior
Commit Message
handle_v_kill uses signal_pid because win32 doesn't support multi-process.
Without this gdb just refuses to kill the process:
(gdb) kill
Kill the program being debugged? (y or n) y
Can't kill process
gdbserver/ChangeLog:
2020-02-11 Hannes Domani <ssbssa@yahoo.de>
* win32-low.c (win32_create_inferior): Set signal_pid.
---
gdbserver/win32-low.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On 2020-02-11 11:41 a.m., Hannes Domani via gdb-patches wrote:
> handle_v_kill uses signal_pid because win32 doesn't support multi-process.
>
> Without this gdb just refuses to kill the process:
> (gdb) kill
> Kill the program being debugged? (y or n) y
> Can't kill process
What would be interesting to see and paste in the commit message is the remote
protocol communication between GDB and GDBserver (just the vKill packet and its
response). Do "set debug remote 1" to make GDB print that communication.
The patch is ok to be pushed with that added, thanks.
Simon
Am Mittwoch, 12. Februar 2020, 05:59:31 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:
> On 2020-02-11 11:41 a.m., Hannes Domani via gdb-patches wrote:
>
> > handle_v_kill uses signal_pid because win32 doesn't support multi-process.
> >
> > Without this gdb just refuses to kill the process:
> > (gdb) kill
> > Kill the program being debugged? (y or n) y
> > Can't kill process
>
>
> What would be interesting to see and paste in the commit message is the remote
> protocol communication between GDB and GDBserver (just the vKill packet and its
> response). Do "set debug remote 1" to make GDB print that communication.
>
> The patch is ok to be pushed with that added, thanks.
Pushed with this additional info, thanks.
@@ -709,6 +709,9 @@ win32_create_inferior (const char *program,
(assuming success). */
cs.last_ptid = win32_wait (ptid_t (current_process_id), &cs.last_status, 0);
+ /* Necessary for handle_v_kill. */
+ signal_pid = current_process_id;
+
return current_process_id;
}