* RE: Sending signal to inferior
@ 2006-01-03 13:11 Sanborn, Ed
2006-01-03 22:54 ` Jim Blandy
0 siblings, 1 reply; 12+ messages in thread
From: Sanborn, Ed @ 2006-01-03 13:11 UTC (permalink / raw)
To: gdb
Please delete me from this list.
-----Original Message-----
From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
Behalf Of Bob Rossi
Sent: Friday, December 30, 2005 5:58 PM
To: Carlos Eduardo Rodrigues de Almeida; gdb@sources.redhat.com
Subject: Re: Sending signal to inferior
On Fri, Dec 30, 2005 at 11:48:02AM -0500, Daniel Jacobowitz wrote:
> On Fri, Dec 30, 2005 at 11:43:00AM -0500, Bob Rossi wrote:
> > On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues
de Almeida wrote:
> > > Thank you.. I'm trying to solve this for days..
> >
> > Wow, that took me a long time to figure out, and I wrote libtgdb.
> >
> > It's the tty command that is allowing libtgdb to interrupt GDB when
> > the inferior is running. Apparently, if you don't move the
> > inferior's terminal via the GDB tty command, then you can't
> > interrupt the inferior when it's running.
> >
> > Basically, I'm assuming that the SIGINT to GDB is ignored if the
> > inferior has control of the terminal. However, if you put the
> > inferior on a different terminal, then GDB must handle the SIGINT.
> > This explanation is just a guess though.
>
> It shouldn't be. Check whether GDB is reaching handle_sigint() and
> whether it is going through the event loop properly?
This is a tough one. For some reason, if I start debugging GDB, it
doesn't reach the handle_sigint line. However, with fprintf there, I'm
seeing output. Could I be doing something wrong or is this expected?
I configured && compiled like this:
cvs -d ':ext:bobbybrasko@sources.redhat.com:/cvs/src' co gdb
CFLAGS=-g ../src/configure
make
I was wondering if any of the -W compile options stop me from debuging
GDB in this case.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Sending signal to inferior
@ 2005-12-30 3:37 Carlos Eduardo Rodrigues de Almeida
2005-12-30 4:11 ` Bob Rossi
0 siblings, 1 reply; 12+ messages in thread
From: Carlos Eduardo Rodrigues de Almeida @ 2005-12-30 3:37 UTC (permalink / raw)
To: gdb
Hi all,
I'm trying to write a front-end to GDB.
For the first experiment I wrote a small program just to control gdb..
The program is at the end of the message
I run some program and I can't stop it sending a SIGINT to GDB
if I
kill -2 GDBPID
nothing happens
the only way to stop the inferior is to ps, get its pid and
kill -2 INFERIORPID
someone had this problem in the list but I couldn't find the
solution.. someone pointed to tgdb
http://cgdb.sourceforge.net/
I noticed something:
tgdb has a tgdb_driver that is exactly what I'm trying to do but using
tgdb.. a little program that controls gdb..
Running some program with tgdb_driver I get 3 process:
tgdb_driver
gdb (created by tgdb_driver)
inferior (created by gdb)
if I send a SIGINT to gdb it stops the inferior.
with my program I get:
echo
gdb
inferior
if I send a SIGINT to gdb, it DOES not stop the inferior...
I looked at the source code and it mentions the setsid() funcition:
/* If this is not called, when user types ^c SIGINT gets sent to gdb */
setsid();
but if I comment out this line it keeps working...
I couldn't find what tgdb does to stop the inferior when I send gdb
the SIGINT.. does someone can point me a solution?
Thank you!
Eduardo
The program I wrote:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <termio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
typedef struct _ARG {
int fd_read;
int fd_write;
}ARG;
char buf[2048];
int nRead;
int treatfd(void *arg);
int treatSTDIN(void *arg);
pid_t fork_status;
char cmd1[] = "file /home/eduardo/lab3/Debug/lab3\n";
char cmd2[] = "run\n";
char cmd3[] = "quit\n";
char cmd4[] = "\002";
int main(void) {
int stdin_pipe[2], stdout_pipe[2], stderr_pipe[2];
pthread_t tstdin, tstdout, tstderr;
ARG argstdin, argstdout, argstderr;
struct termio Termio;
int bwritten;
if( (pipe(stdin_pipe) != 0) || (pipe(stdout_pipe) != 0) ||
pipe(stderr_pipe) != 0) {
printf("Error creating pipes");
exit(1);
}
fork_status = fork();
if(fork_status == -1){
printf("Error forking");
exit(1);
}
/* Chield process */
else if(fork_status == 0) {
setsid();
close(0);
dup(stdin_pipe[0]);
close(stdin_pipe[0]);
close(stdin_pipe[1]);
close(1);
dup(stdout_pipe[1]);
close(stdout_pipe[0]);
close(stdout_pipe[1]);
close(2);
dup(stderr_pipe[1]);
close(stderr_pipe[0]);
close(stderr_pipe[1]);
// printf("executando gdb");
execlp("gdb", "gdb", (char *)0);
// printf("Error with execl");
exit(1);
}
/* Parent process */
else {
close(stdin_pipe[0]);
close(stdout_pipe[1]);
close(stderr_pipe[1]);
fd_set rdSet;
int max;
int selectRet;
max = (0 > stdout_pipe[0]) ? 0 : stdout_pipe[0];
max = (max > stderr_pipe[0]) ? max : stderr_pipe[0];
while(1) {
FD_ZERO(&rdSet);
FD_SET(0, &rdSet);
FD_SET(stdout_pipe[0], &rdSet);
FD_SET(stderr_pipe[0], &rdSet);
selectRet = select(max + 1, &rdSet, NULL, NULL, NULL);
if(selectRet == -1)
return;
if(FD_ISSET(0, &rdSet)) {
nRead = read(0, buf, 2048);
write(stdin_pipe[1], buf, nRead);
}
if(FD_ISSET(stdout_pipe[0], &rdSet)) {
nRead = read(stdout_pipe[0], buf, 2048);
if(nRead == 0)
return;
write(1, buf, nRead);
}
if(FD_ISSET(stderr_pipe[0], &rdSet)) {
nRead = read(stderr_pipe[0], buf, 2048);
if(nRead == 0)
return;
write(2, buf, nRead);
}
}
}
}
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Sending signal to inferior
2005-12-30 3:37 Carlos Eduardo Rodrigues de Almeida
@ 2005-12-30 4:11 ` Bob Rossi
2005-12-30 4:29 ` Carlos Eduardo Rodrigues de Almeida
0 siblings, 1 reply; 12+ messages in thread
From: Bob Rossi @ 2005-12-30 4:11 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida; +Cc: gdb
> I couldn't find what tgdb does to stop the inferior when I send gdb
> the SIGINT.. does someone can point me a solution?
Hi Eduardo,
I don't understand. If I compile and run your program on a sample
inferior, tgdb_driver and your driver act the same. What is the exact
difference you are seeing?
With your driver:
$ ./driver ./test
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux".
(gdb) No symbol table is loaded. Use the "file" command.
file ./test
Reading symbols from /home/bob/cvs/cgdb/cgdb/builddir/tgdb/tgdb-base/src/tmp/test...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) (gdb) Quit
With tgdb_driver:
$ ./tgdb_driver ./test
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux"...No symbol table is loaded. Use the "file" command.
Using host libthread_db library "/lib/libthread_db.so.1".
(tgdb) Quit
(tgdb)
In both cases, I ran
$ kill -s INT PID
This is tested on a Debian box, with GDB GNU gdb 6.3-debian.
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 4:11 ` Bob Rossi
@ 2005-12-30 4:29 ` Carlos Eduardo Rodrigues de Almeida
2005-12-30 4:42 ` Bob Rossi
0 siblings, 1 reply; 12+ messages in thread
From: Carlos Eduardo Rodrigues de Almeida @ 2005-12-30 4:29 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida, gdb
The problem is when the inferior is running... I'll try to explain better
My program:
[eduardo@~/echo]$./echo
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
(gdb) file ../lab3/Debug/lab3
Reading symbols from /home/eduardo/lab3/Debug/lab3...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/eduardo/lab3/Debug/lab3
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 6959)]
Now the program is running and displaying a window
on another terminal
ps -A
(partial ps...)
6958 ? 00:00:00 gdb
6959 ? 00:00:01 lab3
6964 pts/1 00:00:00 bash
6968 pts/1 00:00:00 ps
kill -2 6958
nothing happens on my program
using tgdb_driver:
[eduardo@~/Downloads/cgdb-0.5.3/tgdb/tgdb-base/src]$./tgdb_driver
\x19GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
(tgdb) \x19file /home/eduardo/lab3/Debug/lab3
Reading symbols from /home/eduardo/lab3/Debug/lab3...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(tgdb) run
Starting program: /home/eduardo/lab3/Debug/lab3
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 6950)]
on another terminal:
ps -A
(partial ps..)
6947 pts/1 00:00:00 tgdb_driver
6948 pts/3 00:00:00 tgdb_driver
6949 pts/1 00:00:00 gdb
6950 ? 00:00:01 lab3
6953 pts/2 00:00:00 ps
kill -2 6949
and on the tgdb_driver terminal:
Program received signal SIGINT, Interrupt.
[Switching to Thread 16384 (LWP 6950)]
0x00002aaaabf39084 in poll () from /lib/libc.so.6
(tgdb)
I can't make the program receive the sigint, interrupt itself and the
control return to GDB
Thank you for the answer
Eduardo
On 12/30/05, Bob Rossi <bob@brasko.net> wrote:
> > I couldn't find what tgdb does to stop the inferior when I send gdb
> > the SIGINT.. does someone can point me a solution?
>
> Hi Eduardo,
>
> I don't understand. If I compile and run your program on a sample
> inferior, tgdb_driver and your driver act the same. What is the exact
> difference you are seeing?
>
> With your driver:
> $ ./driver ./test
> GNU gdb 6.3-debian
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i386-linux".
> (gdb) No symbol table is loaded. Use the "file" command.
> file ./test
> Reading symbols from /home/bob/cvs/cgdb/cgdb/builddir/tgdb/tgdb-base/src/tmp/test...done.
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) (gdb) Quit
>
> With tgdb_driver:
>
> $ ./tgdb_driver ./test
> GNU gdb 6.3-debian
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i386-linux"...No symbol table is loaded. Use the "file" command.
> Using host libthread_db library "/lib/libthread_db.so.1".
>
> (tgdb) Quit
> (tgdb)
>
> In both cases, I ran
> $ kill -s INT PID
>
> This is tested on a Debian box, with GDB GNU gdb 6.3-debian.
>
> Bob Rossi
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 4:29 ` Carlos Eduardo Rodrigues de Almeida
@ 2005-12-30 4:42 ` Bob Rossi
2005-12-30 4:57 ` Carlos Eduardo Rodrigues de Almeida
0 siblings, 1 reply; 12+ messages in thread
From: Bob Rossi @ 2005-12-30 4:42 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida; +Cc: gdb
On Fri, Dec 30, 2005 at 04:29:19AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> The problem is when the inferior is running... I'll try to explain better
Hi Eduardo,
Yes, that helped, I've reproduced your problem. It's time for me to go to bed,
but I'll try to look at this tommorow.
BTW, what kind of front end are you writing? What communication protocol
do you plan on using with GDB? Is this open source or proprietary?
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 4:42 ` Bob Rossi
@ 2005-12-30 4:57 ` Carlos Eduardo Rodrigues de Almeida
2005-12-30 16:43 ` Bob Rossi
0 siblings, 1 reply; 12+ messages in thread
From: Carlos Eduardo Rodrigues de Almeida @ 2005-12-30 4:57 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida, gdb
Thank you.. I'm trying to solve this for days..
I'll be writing the gui in java, I feel very confortable with it and
with some libraries it can be very powerfull.
I'm trying to create a subprocess and comunicate via stin, stdout and
stderr.. using mi.
Do you sugest a better aproach?
It is going to be open source!
If you want to help I can share all my ideas :)
Eduardo
On 12/30/05, Bob Rossi <bob@brasko.net> wrote:
> On Fri, Dec 30, 2005 at 04:29:19AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> > The problem is when the inferior is running... I'll try to explain better
>
> Hi Eduardo,
>
> Yes, that helped, I've reproduced your problem. It's time for me to go to bed,
> but I'll try to look at this tommorow.
>
> BTW, what kind of front end are you writing? What communication protocol
> do you plan on using with GDB? Is this open source or proprietary?
>
> Bob Rossi
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 4:57 ` Carlos Eduardo Rodrigues de Almeida
@ 2005-12-30 16:43 ` Bob Rossi
2005-12-30 16:48 ` Daniel Jacobowitz
0 siblings, 1 reply; 12+ messages in thread
From: Bob Rossi @ 2005-12-30 16:43 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida; +Cc: gdb
On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> Thank you.. I'm trying to solve this for days..
Wow, that took me a long time to figure out, and I wrote libtgdb.
It's the tty command that is allowing libtgdb to interrupt GDB when the
inferior is running. Apparently, if you don't move the inferior's
terminal via the GDB tty command, then you can't interrupt the inferior
when it's running.
Basically, I'm assuming that the SIGINT to GDB is ignored if the
inferior has control of the terminal. However, if you put the inferior
on a different terminal, then GDB must handle the SIGINT. This
explanation is just a guess though.
With your program, type 'tty /dev/null' and then run the inferior. You
should now be able to interrupt it via the SIGINT signal to GDB.
> I'll be writing the gui in java, I feel very confortable with it and
> with some libraries it can be very powerfull.
You should look at the eclipse project. They have a fe written in Java.
> I'm trying to create a subprocess and communicate via stin, stdout and
> stderr.. using mi.
Nope. I was hoping you were going to use the MI interface.
> Do you sugest a better aproach?
I'm currently writing a parser that can parse an MI output command. One of
the initial ideas I had was to parse GDB/MI, and have the parser output a
GDB-MI-XML format. That might be useful for you in Java, since it has a
native XML parser, and then you don't have to worry about the low level
stuff. The XML output isn't done, but would probably be pretty trivial
to do.
> It is going to be open source!
>
> If you want to help I can share all my ideas :)
Feel free to send ideas to me, maybe off list. Even though CGDB isn't
far along, there's lot's of area's I went wrong purely through
ignorance, and a lack of features that used to be available in GDB.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 16:43 ` Bob Rossi
@ 2005-12-30 16:48 ` Daniel Jacobowitz
2005-12-30 17:04 ` Bob Rossi
2005-12-30 22:58 ` Bob Rossi
0 siblings, 2 replies; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-12-30 16:48 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida, gdb
On Fri, Dec 30, 2005 at 11:43:00AM -0500, Bob Rossi wrote:
> On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> > Thank you.. I'm trying to solve this for days..
>
> Wow, that took me a long time to figure out, and I wrote libtgdb.
>
> It's the tty command that is allowing libtgdb to interrupt GDB when the
> inferior is running. Apparently, if you don't move the inferior's
> terminal via the GDB tty command, then you can't interrupt the inferior
> when it's running.
>
> Basically, I'm assuming that the SIGINT to GDB is ignored if the
> inferior has control of the terminal. However, if you put the inferior
> on a different terminal, then GDB must handle the SIGINT. This
> explanation is just a guess though.
It shouldn't be. Check whether GDB is reaching handle_sigint() and
whether it is going through the event loop properly?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 16:48 ` Daniel Jacobowitz
@ 2005-12-30 17:04 ` Bob Rossi
2005-12-30 22:58 ` Bob Rossi
1 sibling, 0 replies; 12+ messages in thread
From: Bob Rossi @ 2005-12-30 17:04 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida, gdb
On Fri, Dec 30, 2005 at 11:48:02AM -0500, Daniel Jacobowitz wrote:
> On Fri, Dec 30, 2005 at 11:43:00AM -0500, Bob Rossi wrote:
> > On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> > > Thank you.. I'm trying to solve this for days..
> >
> > Wow, that took me a long time to figure out, and I wrote libtgdb.
> >
> > It's the tty command that is allowing libtgdb to interrupt GDB when the
> > inferior is running. Apparently, if you don't move the inferior's
> > terminal via the GDB tty command, then you can't interrupt the inferior
> > when it's running.
> >
> > Basically, I'm assuming that the SIGINT to GDB is ignored if the
> > inferior has control of the terminal. However, if you put the inferior
> > on a different terminal, then GDB must handle the SIGINT. This
> > explanation is just a guess though.
>
> It shouldn't be. Check whether GDB is reaching handle_sigint() and
> whether it is going through the event loop properly?
Yes, this is definatly a bug in GDB. If I use the tty command, and pass
to it the terminal that GDB is running on, then GDB can be interupted.
This does not seem correct.
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 16:48 ` Daniel Jacobowitz
2005-12-30 17:04 ` Bob Rossi
@ 2005-12-30 22:58 ` Bob Rossi
2005-12-30 23:14 ` Bob Rossi
1 sibling, 1 reply; 12+ messages in thread
From: Bob Rossi @ 2005-12-30 22:58 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida, gdb
On Fri, Dec 30, 2005 at 11:48:02AM -0500, Daniel Jacobowitz wrote:
> On Fri, Dec 30, 2005 at 11:43:00AM -0500, Bob Rossi wrote:
> > On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> > > Thank you.. I'm trying to solve this for days..
> >
> > Wow, that took me a long time to figure out, and I wrote libtgdb.
> >
> > It's the tty command that is allowing libtgdb to interrupt GDB when the
> > inferior is running. Apparently, if you don't move the inferior's
> > terminal via the GDB tty command, then you can't interrupt the inferior
> > when it's running.
> >
> > Basically, I'm assuming that the SIGINT to GDB is ignored if the
> > inferior has control of the terminal. However, if you put the inferior
> > on a different terminal, then GDB must handle the SIGINT. This
> > explanation is just a guess though.
>
> It shouldn't be. Check whether GDB is reaching handle_sigint() and
> whether it is going through the event loop properly?
This is a tough one. For some reason, if I start debugging GDB, it
doesn't reach the handle_sigint line. However, with fprintf there, I'm
seeing output. Could I be doing something wrong or is this expected?
I configured && compiled like this:
cvs -d ':ext:bobbybrasko@sources.redhat.com:/cvs/src' co gdb
CFLAGS=-g ../src/configure
make
I was wondering if any of the -W compile options stop me from debuging
GDB in this case.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Sending signal to inferior
2005-12-30 22:58 ` Bob Rossi
@ 2005-12-30 23:14 ` Bob Rossi
0 siblings, 0 replies; 12+ messages in thread
From: Bob Rossi @ 2005-12-30 23:14 UTC (permalink / raw)
To: Carlos Eduardo Rodrigues de Almeida, gdb
On Fri, Dec 30, 2005 at 05:58:12PM -0500, Bob Rossi wrote:
> On Fri, Dec 30, 2005 at 11:48:02AM -0500, Daniel Jacobowitz wrote:
> > On Fri, Dec 30, 2005 at 11:43:00AM -0500, Bob Rossi wrote:
> > > On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues de Almeida wrote:
> > > > Thank you.. I'm trying to solve this for days..
> > >
> > > Wow, that took me a long time to figure out, and I wrote libtgdb.
> > >
> > > It's the tty command that is allowing libtgdb to interrupt GDB when the
> > > inferior is running. Apparently, if you don't move the inferior's
> > > terminal via the GDB tty command, then you can't interrupt the inferior
> > > when it's running.
> > >
> > > Basically, I'm assuming that the SIGINT to GDB is ignored if the
> > > inferior has control of the terminal. However, if you put the inferior
> > > on a different terminal, then GDB must handle the SIGINT. This
> > > explanation is just a guess though.
> >
> > It shouldn't be. Check whether GDB is reaching handle_sigint() and
> > whether it is going through the event loop properly?
>
> This is a tough one. For some reason, if I start debugging GDB, it
> doesn't reach the handle_sigint line. However, with fprintf there, I'm
> seeing output. Could I be doing something wrong or is this expected?
>
> I configured && compiled like this:
> cvs -d ':ext:bobbybrasko@sources.redhat.com:/cvs/src' co gdb
> CFLAGS=-g ../src/configure
> make
>
> I was wondering if any of the -W compile options stop me from debuging
> GDB in this case.
>
What I can tell you from instrumentation is this. handle_sigint is not
called when the inferior is running and the tty command was used. Out of
the 4 cases
inferior running/tty used
inferior running/tty not used
inferior not running/tty used
inferior not running/tty not used
only the first case does not allow GDB to get into handle_sigint.
So, if GDB get's a SIGINT when the inferior is running and the tty is not set,
then handle_sigint get's called. After the inferior is done running,
quit() get's called and displays "Quit".
If GDB get's a SIGINT when the inferior is running and the tty is not
set, handle_sigint does not get called, and somehow GDB is interupted.
However, I can't figure out why.
Bob Rossi
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-01-03 22:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-03 13:11 Sending signal to inferior Sanborn, Ed
2006-01-03 22:54 ` Jim Blandy
-- strict thread matches above, loose matches on Subject: below --
2005-12-30 3:37 Carlos Eduardo Rodrigues de Almeida
2005-12-30 4:11 ` Bob Rossi
2005-12-30 4:29 ` Carlos Eduardo Rodrigues de Almeida
2005-12-30 4:42 ` Bob Rossi
2005-12-30 4:57 ` Carlos Eduardo Rodrigues de Almeida
2005-12-30 16:43 ` Bob Rossi
2005-12-30 16:48 ` Daniel Jacobowitz
2005-12-30 17:04 ` Bob Rossi
2005-12-30 22:58 ` Bob Rossi
2005-12-30 23:14 ` Bob Rossi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox