This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA v2] valprint.c / *-valprint.c: Don't lose `embedded_offset'


> > Joel, there are Ada changes in the patch, are those okay?

Hi Pedro. The changes look sane to me. There was only one place where
the offset was missing, affecting packed records.  Patch attached.

I wish we could allow everyone to get a clean run in gdb.ada,
it really sucks :-(.  I tried to speed things up a bit on the compiler
side with the descriptive-type stuff, but it's very very hard to get
feedback from maintainers who have the power to approve or make
suggestions...  I need to check with Olivier, but he might have given
up on it :-(.

-- 
Joel
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 1255b00..2b5aa44 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -1132,11 +1132,11 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
 	      struct value_print_options opts;
 
 	      adjust_type_signedness (TYPE_FIELD_TYPE (type, i));
-	      v = ada_value_primitive_packed_val (NULL, valaddr,
-						  bit_pos / HOST_CHAR_BIT,
-						  bit_pos % HOST_CHAR_BIT,
-						  bit_size,
-						  TYPE_FIELD_TYPE (type, i));
+	      v = ada_value_primitive_packed_val
+		    (NULL, valaddr,
+		     offset + bit_pos / HOST_CHAR_BIT,
+		     bit_pos % HOST_CHAR_BIT,
+		     bit_size, TYPE_FIELD_TYPE (type, i));
 	      opts = *options;
 	      opts.deref_ref = 0;
 	      val_print (TYPE_FIELD_TYPE (type, i),

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]