unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16745: Can't send SIGTSTP from Emacs through GDB
@ 2014-02-13 19:33 Barry OReilly
  2014-02-14  9:28 ` Andreas Schwab
  2014-02-14 13:11 ` Daimrod
  0 siblings, 2 replies; 4+ messages in thread
From: Barry OReilly @ 2014-02-13 19:33 UTC (permalink / raw)
  To: 16745

[-- Attachment #1: Type: text/plain, Size: 2272 bytes --]

When running GDB in Emacs and sending SIGTSTP via C-c C-z to another
Emacs ran under GDB, the Emacs under GDB does not appear to receive
the SIGTSTP.

Recipe:

  ./src/emacs -Q
  M-x gdb
  gdb -i=mi src/emacs
  run -Q
  C-c C-z
  [The Emacs under GDB is not stopped.]

However, when I run GDB from the shell rather than from Emacs:

  gdb src/emacs
  run -Q
  C-z
  [The Emacs under GDB stopped.]

I noticed src/.gdbinit has line:

  handle SIGTSTP nopass

So I tried with and without this to no effect.

When I run with these debug statements:

diff --git a/src/process.c b/src/process.c
index 85470b6..176de75 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5753,6 +5753,9 @@ process_send_signal (Lisp_Object process, int signo,
Lisp_Object current_group,
 #else
          sig_char = &t.c_cc[VSUSP];
 #endif
+          { struct timespec debug_ts; char debug_dateStr[20]; {
clock_gettime(CLOCK_REALTIME, &debug_ts); struct tm mytm;
localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_dateStr, 20,
"%Y-%m-%dT%H:%M:%S", &mytm); }
+               printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG:
sig_char=%02x\n", // TODO: debugging
+                                 debug_dateStr, debug_ts.tv_nsec,
getpid(), pthread_self(), __FILE__, __LINE__, *sig_char ); fflush(stdout); }
          break;
        }

@@ -5901,6 +5904,9 @@ traffic.  */)
 #ifndef SIGTSTP
   error ("No SIGTSTP support");
 #else
+  { struct timespec debug_ts; char debug_dateStr[20]; {
clock_gettime(CLOCK_REALTIME, &debug_ts); struct tm mytm;
localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_dateStr, 20,
"%Y-%m-%dT%H:%M:%S", &mytm); }
+       printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG: Send SIGTSTP\n", //
TODO: debugging
+                         debug_dateStr, debug_ts.tv_nsec, getpid(),
pthread_self(), __FILE__, __LINE__ ); fflush(stdout); }
   process_send_signal (process, SIGTSTP, current_group, 0);
 #endif
   return process;

The output during the ill recipe is:

2014-02-13T14:11:49.438466000|pid:22430|tid:47532927609088|process.c|5909|
DEBUG: Send SIGTSTP
2014-02-13T14:11:49.438547000|pid:22430|tid:47532927609088|process.c|5758|
DEBUG: sig_char=1a

So the signal is being sent it seems. What might be the obstruction?

I am on RHEL 5, using latest Emacs from trunk and GDB 7.1.

[-- Attachment #2: Type: text/html, Size: 2600 bytes --]

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

end of thread, other threads:[~2014-02-14 14:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 19:33 bug#16745: Can't send SIGTSTP from Emacs through GDB Barry OReilly
2014-02-14  9:28 ` Andreas Schwab
2014-02-14 14:19   ` Barry OReilly
2014-02-14 13:11 ` Daimrod

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).