[padb] r397 committed - Be careful when interacting with gdb, don't try and write to it...

padb at googlecode.com padb at googlecode.com
Sun Oct 24 00:38:16 BST 2010


Revision: 397
Author: apittman at gmail.com
Date: Sat Oct 23 16:34:51 2010
Log: Be careful when interacting with gdb, don't try and write to it
if we haven't had any communication, it's probably dead - most
likely because it never ran in the first place.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Sat Oct 23 16:33:23 2010
+++ /trunk/src/padb	Sat Oct 23 16:34:51 2010
@@ -5984,6 +5984,16 @@

  sub gdb_quit {
      my ($gdb) = @_;
+    if ( $gdb->{seq} == 1 ) {
+        foreach my $fdname (qw(rdr wtr err)) {
+            next unless exists $gdb->{$fdname};
+            close $gdb->{$fdname};
+        }
+        if ( defined $gdb->{debugfd} ) {
+            close $gdb->{debugfd};
+        }
+        return;
+    }
      gdb_send( $gdb, 'quit' );
      waitpid $gdb->{gdbpid}, 0;
      foreach my $fdname (qw(rdr wtr err)) {




More information about the padb-devel mailing list