From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Cc: "'Pedro Alves'" <pedro@codesourcery.com>
Subject: [RFA] Fix gdbserver crash if using kill in remote connection to windows gdbserver
Date: Tue, 23 Jun 2009 16:18:00 -0000 [thread overview]
Message-ID: <003001c9f41e$3a294830$ae7bd890$@u-strasbg.fr> (raw)
I wanted to test Doug Evans patch for hardware watchpoint support
for i386 gdbserver but ran into a new crash for gdbserver in the testsuite.
GDB uses an internal fake pid (42000) for
remote targets not supporting multi-processes,
but send this fake pid to gdbserver when
kill command is used with remote target.
This made win32-low look for a inferior of
pid 42000, which does not exist and created a crash
in remove_process that was called with a NULL argument.
This fixes win32 target, but there might be other targets
that suffer from the same problem...
Pedro, could you check this?
Is this patch OK?
Pierre Muller
Pascal language support maintainer for GDB
2009-06-23 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-low.c (win32_kill): Use current_process_id
to find process to remove as long as multi_process is zero.
(win32_detach): Idem.
Index: src/gdb/gdbserver/win32-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/win32-low.c,v
retrieving revision 1.36
diff -u -p -r1.36 win32-low.c
--- src/gdb/gdbserver/win32-low.c 22 Jun 2009 19:33:41 -0000 1.36
+++ src/gdb/gdbserver/win32-low.c 23 Jun 2009 16:11:01 -0000
@@ -675,7 +675,12 @@ win32_kill (int pid)
win32_clear_inferiors ();
- process = find_process_pid (pid);
+ /* GDB used a fake pid of 42000 for targets that don't support
multi_process
+ yet. */
+ if (multi_process)
+ process = find_process_pid (pid);
+ else
+ process = find_process_pid (current_process_id);
remove_process (process);
return 0;
}
@@ -711,7 +716,12 @@ win32_detach (int pid)
return -1;
DebugSetProcessKillOnExit (FALSE);
- process = find_process_pid (pid);
+ /* GDB used a fake pid of 42000 for targets that don't support
multi_process
+ yet. */
+ if (multi_process)
+ process = find_process_pid (pid);
+ else
+ process = find_process_pid (current_process_id);
remove_process (process);
win32_clear_inferiors ();
next reply other threads:[~2009-06-23 16:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-23 16:18 Pierre Muller [this message]
2009-06-23 17:11 ` Doug Evans
2009-06-23 17:22 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='003001c9f41e$3a294830$ae7bd890$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox