Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* invoking GDB from FE and signals
@ 2006-05-13 15:09 Bob Rossi
  2006-05-13 15:11 ` Daniel Jacobowitz
  0 siblings, 1 reply; 55+ messages in thread
From: Bob Rossi @ 2006-05-13 15:09 UTC (permalink / raw)
  To: gdb

Hi,

Does anyone know the correct way to invoke GDB from a front end. I know
it's possible to use either a PTY or a pipe. By using the PTY, readline
is between the FE and GDB. By using a pipe, readline is not used. Of
course, I'm still using annotate=2 here, not gdb/mi which doesn't
support readline either way.

For a long time, using many different GDB's I've started GDB using a
pipe, thinking readline wasn't necessary. Now I have run into a bad
problem. This difference is important, because I believe GDB handles
signals slightly different when readline is on the terminal or not.

When my FE receives a ^c on the terminal, I need to send that to GDB.
For a long time I have sent a 'kill (gdb_pid, SIGINT)' to GDB to
accomplish this task. This has worked well for me, and I use this
technique for SIGINT, SIGTERM and SIGQUIT. 

I recently had someone report to me that when my FE is started on a Mac
and ^c is entered, I send the signal to GDB and it responds with
"(Quit)" as expected. However, if GDB is running the inferior, and ^c is
received, I send the 'kill' and GDB shuts down. It was reported that
when the user just used GDB, both of these case's worked as expected. Of
course, the major difference is that readline was used with just GDB and
when using my FE, no readline was available when GDB received the
signal.

Is there a better way for the FE to send this data to GDB? Is this a bug
in GDB? Do I need to start GDB with readline between the FE and it?

Finally, this should be documented and tested (which I'll be glad to do). 
Especially since when using the MI interface, readline will never be
available to be between GDB and the FE if started with a PTY or a pipe.

Thanks,
Bob Rossi


^ permalink raw reply	[flat|nested] 55+ messages in thread
* RE: invoking GDB from FE and signals
@ 2006-05-18 16:27 Alain Magloire
  2006-05-18 16:55 ` Bob Rossi
                   ` (2 more replies)
  0 siblings, 3 replies; 55+ messages in thread
From: Alain Magloire @ 2006-05-18 16:27 UTC (permalink / raw)
  To: gdb



> Bob Rossi
> Sent: Wednesday, May 17, 2006 9:41 PM
> To: gdb@sources.redhat.com
> Subject: Re: invoking GDB from FE and signals
> 
> On Sat, May 13, 2006 at 11:10:57AM -0400, Daniel Jacobowitz wrote:
> > On Sat, May 13, 2006 at 11:10:26AM -0400, Bob Rossi wrote:
> > > OK, I can find out the details. However, I'm thinking the supported
> way
> > > of starting GDB from a FE is via a pipe. This would prevent readline
> > > from being in the way, and is the only way to do it with MI anyways,
> > > right?
> >
> > There's no such thing as "the supported way".
> 
> There is something else I just discovered today. I think it's rather
> important. If you start GDB via a pipe, then it will not ask you
> questions like
>   Make breakpoint pending on future shared library load? (y or [n])
> or
>   The program is running.  Exit anyway? (y or n)
> instead, it will just assume the answer is yes.
> 
> So, switching to a pty has other advantages that might not seem obvious
> at first. This could also be documented.
> 

Surprisingly, the main reason why we use a pty in the Eclipse/CDT is to get
rid of the xxxx number of PRs about not seeing the output of printf() and
before you ask ... telling the user to fflush() and explaining the stdio
flushing policy for pipes/files vs. terminal ended up in hate mails.

We send the signal to the inferior ... the problem when running gdb is to
... get the inferior PID ... sigh. We have circumvent the problem is
commercial products but did not fine a generic way to get the pid.


^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2006-05-22 22:37 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-13 15:09 invoking GDB from FE and signals Bob Rossi
2006-05-13 15:11 ` Daniel Jacobowitz
2006-05-13 15:19   ` Bob Rossi
2006-05-13 15:48     ` Daniel Jacobowitz
2006-05-13 15:49       ` Bob Rossi
2006-05-13 17:11         ` Daniel Jacobowitz
2006-05-14  3:25           ` Bob Rossi
2006-05-14  4:17             ` Nick Roberts
2006-05-14  4:18               ` Eli Zaretskii
2006-05-14  5:01               ` Daniel Jacobowitz
2006-05-15  6:55                 ` Nick Roberts
2006-05-15 13:35                   ` Daniel Jacobowitz
2006-05-15 13:39                 ` Bob Rossi
2006-05-15 15:04                   ` Daniel Jacobowitz
2006-05-15 19:04                   ` Jim Blandy
2006-05-15 13:37             ` Jim Blandy
2006-05-15 14:58               ` Bob Rossi
2006-05-15 18:50                 ` Jim Blandy
2006-05-15 20:09               ` Bob Rossi
2006-05-15 18:42           ` PAUL GILLIAM
2006-05-15 19:18             ` Bob Rossi
2006-05-15 19:43               ` Daniel Jacobowitz
2006-05-15 20:05                 ` Bob Rossi
2006-05-15 20:09                   ` Daniel Jacobowitz
2006-05-15 20:20                     ` Bob Rossi
2006-05-15 21:02                       ` Daniel Jacobowitz
2006-05-15 21:08                         ` Bob Rossi
2006-05-15 21:31                           ` Daniel Jacobowitz
2006-05-15 21:33                             ` Bob Rossi
2006-05-15 20:11                   ` PAUL GILLIAM
2006-05-15 20:33                     ` Bob Rossi
2006-05-15 21:52                       ` Joel Brobecker
2006-05-15 22:40                     ` Bob Rossi
2006-05-16  3:32                       ` Nick Roberts
2006-05-18  1:40                     ` Bob Rossi
2006-05-18 12:32                       ` Jim Blandy
2006-05-18  7:28       ` Bob Rossi
2006-05-18 16:27 Alain Magloire
2006-05-18 16:55 ` Bob Rossi
2006-05-18 16:59 ` Andreas Schwab
     [not found] ` <vt2bqtvl157.fsf@theseus.home.>
2006-05-18 17:44   ` Bob Rossi
2006-05-18 21:56     ` Jim Blandy
2006-05-19  1:19       ` Bob Rossi
2006-05-19  3:00         ` Daniel Jacobowitz
2006-05-19 12:49           ` Bob Rossi
2006-05-19 15:37             ` Daniel Jacobowitz
2006-05-19 15:56               ` Bob Rossi
2006-05-19 17:55                 ` Jim Blandy
2006-05-19 19:22                   ` Bob Rossi
2006-05-23  3:46                     ` Jim Blandy
2006-05-18 22:51     ` Andreas Schwab
2006-05-18 23:25       ` Bob Rossi
2006-05-19  1:17         ` Andreas Schwab
2006-05-18 23:28       ` Jim Blandy
2006-05-19  0:59         ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox