Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Jiong Wang <jiwang@tilera.com>,
	gdb-patches@sourceware.org,        Walter Lee <walt@tilera.com>,
	Tom Tromey <tromey@redhat.com>
Subject: Re: [RFC/TileGX 5/6]show registers in columns
Date: Fri, 08 Feb 2013 21:09:00 -0000	[thread overview]
Message-ID: <51156968.4080408@redhat.com> (raw)
In-Reply-To: <20130208190946.GD17107@adacore.com>

On 02/08/2013 07:09 PM, Joel Brobecker wrote:

>>>> +	  else
>>>> +	    {
>>>> +	      fprintf_filtered (file, "0x");
>>>> +	      for (k = 0; k < tilegx_reg_size; k++)
>>>> +		{
>>>> +		  int idx;
>>>> +		  if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
>>>> +		    idx = k;
>>>> +		  else
>>>> +		    idx = tilegx_reg_size - 1 - k;
>>>> +		  fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]);
> 
> 	I do not think that this is the right way of printing the register
> value, by doing all the work yourself. I am not completely sure
> what the best solution would be, though. The other Global Maintainers
> may have a more definitive answer, but perhaps plongest (value_as_long
> (register_value)). My suggestion is a little iffy because it assumes
> for instance that all register values are signed / or unsigned.

Usually you'd use val_print.  How about just exporting and
calling default_print_one_register_info?  You get consistency
with other archs for free, and unavailable values handled too.

-- 
Pedro Alves


  reply	other threads:[~2013-02-08 21:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18  9:30 Jiong Wang
2013-01-18 13:50 ` Joel Brobecker
2013-01-18 16:07   ` Jiong Wang
2013-02-08 19:09     ` Joel Brobecker
2013-02-08 21:09       ` Pedro Alves [this message]
2013-02-13 14:42         ` Jiong Wang
2013-02-11 19:20       ` 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=51156968.4080408@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jiwang@tilera.com \
    --cc=tromey@redhat.com \
    --cc=walt@tilera.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