[padb-devel] [padb] r129 committed - If we fail to attach to a process then check if gdb is actuall install...

codesite-noreply at google.com codesite-noreply at google.com
Thu Aug 20 15:58:48 BST 2009


Revision: 129
Author: apittman
Date: Thu Aug 20 07:57:42 2009
Log: If we fail to attach to a process then check if gdb is actuall  
installed
and if it isn't warn about this as the probable cause.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Thu Aug 20 04:27:55 2009
+++ /trunk/src/padb	Thu Aug 20 07:57:42 2009
@@ -4302,7 +4302,14 @@
      send_cont_signal($pid);
      my $result = gdb_send( $gdb, "attach $pid" );

-    return unless defined $result;
+    if ( not defined $result ) {
+        $gdb->{error} = "Failed to attach to process";
+        if ( not find_exe("gdb") ) {
+            $gdb->{error} = "Failed to attach to process (gdb not  
installed?)";
+        }
+        return;
+    }
+
      return if ( $result eq "error" );

      $gdb->{attached} = 1;
@@ -5812,7 +5819,11 @@
              $proc->{gdb} = $gdb;
              push( @all, $proc );
          } else {
-            output $vp, "Failed to attach to process";
+            if ( defined $gdb->{error} ) {
+                output $vp, $gdb->{error};
+            } else {
+                output $vp, "Failed to attach to process";
+            }
          }

      }
@@ -5838,7 +5849,11 @@
                  if ( gdb_attach( $g, $pid ) ) {
                      $gdb = $g;
                  } else {
-                    output $vp, "Failed to attach to process";
+                    if ( defined $gdb->{error} ) {
+                        output $vp, $gdb->{error};
+                    } else {
+                        output $vp, "Failed to attach to process";
+                    }
                  }
              } else {
                  $gdb = $proc->{gdb};




More information about the padb-devel mailing list