[padb] r398 committed - Re-instate the behaviour of ignoring SIGPIPE to avoid GDB errors...

padb at googlecode.com padb at googlecode.com
Sun Oct 24 01:35:44 BST 2010


Revision: 398
Author: apittman at gmail.com
Date: Sat Oct 23 17:35:27 2010
Log: Re-instate the behaviour of ignoring SIGPIPE to avoid GDB errors
being fatal.  This allows padb to correctly detect that the attach
has failed and report a sensible error message.
fixes #5

http://code.google.com/p/padb/source/detail?r=398

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Sat Oct 23 16:34:51 2010
+++ /trunk/src/padb	Sat Oct 23 17:35:27 2010
@@ -5953,7 +5953,14 @@
  # number of years however so lets try not doing it for a while and see
  # where that gets us.

-# $SIG{PIPE} = 'IGNORE';
+# Enabling this again until I can fix things properly as it's causing  
problems.
+# if gdb isn't installed then we get a SIGPIPE (which is normally fatal)  
when
+# starting it, previously this would happen inside an eval block but now  
with
+# the global attach it doesn't.  Ideally we should catch the case where  
gdb isn't
+# there and pass the error back up but that is tricky to do so for now  
simply
+# catch the signal, we won't then be able to attach and will report a  
sensible
+# error message to the user.
+$SIG{PIPE} = 'IGNORE';

  sub gdb_start {
      my ( $exe, $core ) = @_;
@@ -6024,7 +6031,7 @@
      if ( not defined $p{status} ) {
          $gdb->{error} = 'Failed to attach to process';
          if ( not find_exe('gdb') ) {
-            $gdb->{error} = 'Failed to attach to process (gdb not  
installed?)';
+            $gdb->{error} = 'Failed to attach to process (is gdb  
installed?)';
          }
          return;
      }
@@ -6095,7 +6102,7 @@
      if ( not defined $p{status} ) {
          $gdb->{error} = 'Failed to attach to process';
          if ( not find_exe('gdb') ) {
-            $gdb->{error} = 'Failed to attach to process (gdb not  
installed?)';
+            $gdb->{error} = 'Failed to attach to process (is gdb  
installed?)';
          }
          return;
      }




More information about the padb-devel mailing list