[padb-devel] [padb] r145 committed - Pass any attach errors from gdb back to the user.

codesite-noreply at google.com codesite-noreply at google.com
Mon Aug 24 16:50:28 BST 2009


Revision: 145
Author: apittman
Date: Mon Aug 24 08:50:05 2009
Log: Pass any attach errors from gdb back to the user.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Mon Aug 24 08:28:18 2009
+++ /trunk/src/padb	Mon Aug 24 08:50:05 2009
@@ -4467,9 +4467,9 @@
      my ( $gdb, $pid ) = @_;

      send_cont_signal($pid);
-    my $result = gdb_send( $gdb, "attach $pid" );
-
-    if ( not defined $result ) {
+    my %p = gdb_n_send( $gdb, "attach $pid" );
+
+    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?)";
@@ -4477,7 +4477,15 @@
          return;
      }

-    return if ( $result eq "error" );
+    if ( $p{status} eq "error" ) {
+        my $r = gdb_parse_reason( $p{reason} );
+        if ( defined $r->{msg} ) {
+            $gdb->{error} = "Failed to attach to process: $r->{msg}";
+        } else {
+            $gdb->{error} = "Failed to attach to process";
+        }
+        return;
+    }

      $gdb->{attached} = 1;
      $gdb->{tracepid} = $pid;




More information about the padb-devel mailing list