public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA v2] valprint.c / *-valprint.c: Don't lose `embedded_offset'
Date: Mon, 24 Jan 2011 17:37:00 -0000	[thread overview]
Message-ID: <20110124165624.GA2413@adacore.com> (raw)
In-Reply-To: <201101241324.04771.pedro@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

> > 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

[-- Attachment #2: val-offset.diff --]
[-- Type: text/x-diff, Size: 793 bytes --]

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),

  reply	other threads:[~2011-01-24 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 13:24 Pedro Alves
2011-01-24 16:56 ` Pedro Alves
2011-01-24 17:37   ` Joel Brobecker [this message]
2011-01-24 19:39     ` Pedro Alves
2011-01-24 19:46       ` Pedro Alves
2011-01-24 21:06       ` Joel Brobecker
2011-01-24 19:47 ` Pedro Alves
2011-01-28 11:35 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110124165624.GA2413@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).