[RFA] Fix gdbserver crash if using kill in remote connection to windows gdbserver

Pedro Alves pedro@codesourcery.com
Tue Jun 23 17:22:00 GMT 2009


On Tuesday 23 June 2009 18:11:21, Doug Evans wrote:
> On Tue, Jun 23, 2009 at 9:18 AM, Pierre Muller<muller@ics.u-strasbg.fr> wrote:
> >  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.
> 
> I thought gdb used 42000 for targets that don't have pids (e.g.
> embedded targets).
> It's kinda odd that gdb is using the magic 42000 on a target with pids.
> Is that, perchance, the bug that needs fixing here?

If the target doesn't support multi-process extensions, then
there's no way for GDB to know the remote PID.

I haven't looked at the patch yet, but, if the target isn't
reporting multi-process support (win32 gdbserver isn't now),
then GDB should be using the 'k' packet, and that doesn't
carry the fake 42000.  In fact, the magic 42000 should not
appear in *any* packet, IIRC.  If GDB is sending the vKill
packet when multi-process is off, that is the bug.

-- 
Pedro Alves



More information about the Gdb-patches mailing list