This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

invoking GDB from FE and signals


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]