George Anzinger wrote:

> > > Using the 386 kgdb code, I wanted to get gdb to evaluate a kernel
> > > function.  The result wiped out the system (i.e. reboot).  I think the
> > > problem is that gdb puts the calling code and parameters on the stack,
> > > but i386_stub is using the same stack.  Gdb only knows the stack address
> > > above the call to the stub (i.e. where the trap was taken).  This means
> > > that the stubs stack is wiped.  Has anyone addressed this?  What gdb
> > > does makes sense if it is using ptrace, but not if it is remote
> > > debugging.

The mechanism that GDB uses to perform inferior function calls works
just fine when talking to standard remote stub.

Could I encourage you to investigate ways of modifing your kgdb stub so
that it can better handle GDBs behavour.  One possible way is to have a
separate stack dedicated to the stub and migrate across to that after
the interrupt has been taken.

        enjoy,
                Andrew

Reply via email to