From: Pedro Alves <pedro_alves@po...> - 2008-08-02 02:21:26
On Tuesday 29 July 2008 21:26:36, Eran Ifrah wrote:
> Hi list,
> I have added support for remote debugging using gdbserver for my IDE
> project (http://codelite.org). All is functioning well besides the
> interrupt ('pause debugger').
> I am using the GDB MI.
Frontend developers are strongly advised to join the gdb@...
list, where MI development is discussed. This is a general gdb question,
not really related to mingw.
> Now, according to the docs, if I executes the '-exec-interrupt' command,
> the gdbserver will interrupt the debuggee process.
> here is the sequence of commands I type:
> gdbserver shell: gdbserver localhost:9090 myexe.exe
> at this point the gdbserver starts as expected and waits for connetion on
> port 9090
> I opened a new shell, and started typing the following:
> gdb shell: gdb myexe.exe -i=mi
> gdb shell: (gdb)target remote localhost:9090
> gdb shell: ... some info is printed here ...
> gdb shell: (gdb)-exec-continue
> gdb shell: <----------at this point, the 'debuggee' process is
> running properly (I can see its output in the gdbserver cmd prompt)
> however, the gdb itself is blocked, that is, I can not type commands
> gdb shell: -exec-interrupt <----------- not working
> Am I missing something here?
> or is it a bug in GDB?
Depends on perspective.
What you're missing is that "-exec-interrupt interrupts the *background*
execution" of the target. GDB by default doesn't accept input while the
target is running.
Removing that limitation is an ongoing project (google for gdb async mode).
You can currently try it by connecting with "target async" instead
of "target remote", or with recent CVS head, issue "maint set remote-async 1"
and connect with "target remote". Eventually, the need for the extra
command will be removed, as async mode, enabling MI command processing at
any time, will always be on.
In the mean time, you'll need to send a SIGINT signal to GDB instead.