List Info

Thread: Can I use -exec-interrupt to stop the inferior program?




Can I use -exec-interrupt to stop the inferior program?
user name
2006-05-15 21:31:10
Hello!

I'm looking for a solution how to stop the inferior
program,
which is running under gdb. I can stop it using ^C, but I
need a solution, that will work for the following case:

 Java application
       |   ^
 stdin |   | stdout
       v   |
 GDB debugger (gdb --i mi --tty /dev/pts/2 ...)
       |  ^
       v  |
 Inferior program  <--> External terminal
(/dev/pts/28)


The action to stop the program is initiated by
Java application, which cannot send ^C to the
external terminal. So I have to use stdin to
tell gdb to stop the inferior program. But gdb
does not read the "-exec-interrupt" command,
until the program is stopped


sside-linux nikm/t1-exec-interrupt> gdb --i mi --tty
/dev/pts/2 t2pl
~"GNU gdb 6.1\n"
~"Copyright 2004 Free Software Foundation,
Inc.\n"
~"GDB is free software, covered by the GNU General
Public License, and
you are\n"
~"welcome to change it and/or distribute copies of it
under certain
conditions.\n"
~"Type \"show copying\" to see the
conditions.\n"
~"There is absolutely no warranty for GDB.  Type
\"show warranty\" for
details.\n"
~"This GDB was configured as
\"x86_64-suse-linux\"..."
~"Using host libthread_db library
\"/lib64/tls/libthread_db.so.1\".\n"
~"\n"
(gdb)
run
&"run\n"
-exec-interrupt
^done,reason="exited",exit-code="0100&quo
t;
(gdb)
^error,msg="mi_cmd_exec_interrupt: Inferior not
executing."
(gdb)


Perhaps "-exec-interrupt" does not work in gdb
6.1?
If that's correct, can you tell me which version supports
"-exec-interrupt"?

Thanks in advance,
Nikolay Molchanov

Can I use -exec-interrupt to stop the inferior program?
user name
2006-05-15 22:44:24
 > (gdb)
 > run
 > &"run\n"
 > -exec-interrupt
 >
^done,reason="exited",exit-code="0100&quo
t;
 > (gdb)
 > ^error,msg="mi_cmd_exec_interrupt: Inferior not
executing."
 > (gdb)
 > 
 > 
 > Perhaps "-exec-interrupt" does not work in
gdb 6.1?
 > If that's correct, can you tell me which version
supports
 > "-exec-interrupt"?

It doesn't currently works as you would like i.e.
asynchronously, even in
CVS.

Can you get around the problem by using SIGTSTP instead of
SIGINT to stop
the program?  Thats what Emacs does.

-- 
Nick                                           http://www.inet.net.n
z/~nickrob
Can I use -exec-interrupt to stop the inferior program?
user name
2006-05-18 12:32:34
I had the same problem a while ago..
I wrote a driver in, C, that received "commands"
from the java
application and performed actions in the GDB. There was only
2
"commands" CMD and SIG.
Explaining by example
If I send CMDlist my driver will remove the CMD and send
list to GDB,
if I send SIG my driver will send a SIGINT to GDB... it
should be
SIGsigno where signo is the number of the signal but not
implemented
yet.
In java I have a class that encapsulate the driver and has 2
methods:
sendCommand(String command)
sendSignal(int signo)

If you want I can send you the driver and my java code.

The driver only work in linux


Eduardo

On 5/15/06, Nikolay Molchanov <Nikolay.Molchanovsun.com> wrote:
> Hello!
>
> I'm looking for a solution how to stop the inferior
program,
> which is running under gdb. I can stop it using ^C, but
I
> need a solution, that will work for the following case:
>
>  Java application
>       |   ^
>  stdin |   | stdout
>       v   |
>  GDB debugger (gdb --i mi --tty /dev/pts/2 ...)
>       |  ^
>       v  |
>  Inferior program  <--> External terminal
(/dev/pts/28)
>
>
> The action to stop the program is initiated by
> Java application, which cannot send ^C to the
> external terminal. So I have to use stdin to
> tell gdb to stop the inferior program. But gdb
> does not read the "-exec-interrupt"
command,
> until the program is stopped
>
>
> sside-linux nikm/t1-exec-interrupt> gdb --i mi --tty
/dev/pts/2 t2pl
> ~"GNU gdb 6.1\n"
> ~"Copyright 2004 Free Software Foundation,
Inc.\n"
> ~"GDB is free software, covered by the GNU
General Public License, and
> you are\n"
> ~"welcome to change it and/or distribute copies
of it under certain
> conditions.\n"
> ~"Type \"show copying\" to see the
conditions.\n"
> ~"There is absolutely no warranty for GDB.  Type
\"show warranty\" for
> details.\n"
> ~"This GDB was configured as
\"x86_64-suse-linux\"..."
> ~"Using host libthread_db library
\"/lib64/tls/libthread_db.so.1\".\n"
> ~"\n"
> (gdb)
> run
> &"run\n"
> -exec-interrupt
>
^done,reason="exited",exit-code="0100&quo
t;
> (gdb)
> ^error,msg="mi_cmd_exec_interrupt: Inferior not
executing."
> (gdb)
>
>
> Perhaps "-exec-interrupt" does not work in
gdb 6.1?
> If that's correct, can you tell me which version
supports
> "-exec-interrupt"?
>
> Thanks in advance,
> Nikolay Molchanov
>
>
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )