[padb] r322 committed - Modify gdb_type_offset not to generate warnings when using solaris....

padb at googlecode.com padb at googlecode.com
Thu Nov 5 22:12:59 GMT 2009


Revision: 322
Author: apittman
Date: Thu Nov  5 14:11:00 2009
Log: Modify gdb_type_offset not to generate warnings when using solaris.
This is probably a gdb version issue rather than a solaris issue.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Wed Nov  4 05:07:25 2009
+++ /trunk/src/padb	Thu Nov  5 14:11:00 2009
@@ -5678,10 +5678,13 @@
      return gdb_strip_value( $p{reason} );
  }

+# Add a void * cast here to stop gdb trying to evaluate the type and
+# telling us that the offset isn't a valid pointer.  Without the cast gdb
+# adding extra text after the value which is causing hex to throw warnings.
  sub gdb_type_offset {
      my ( $gdb, $type, $field ) = @_;
      my %p = gdb_send_addr( $gdb,
-        "-data-evaluate-expression \"&(($type *)0)->$field\"" );
+        "-data-evaluate-expression \"(void *)&(($type *)0)->$field\"" );
      return unless ( $p{status} eq 'done' );
      return hex gdb_strip_value( $p{reason} );
  }




More information about the padb-devel mailing list