Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Nick Clifton <nickc@redhat.com>
Cc: gdb-patches@sourceware.org, kevinb@redhat.com
Subject: Re: RFA: Fix compile time warnings building iq2000-tdep.c
Date: Tue, 28 Nov 2006 17:17:00 -0000	[thread overview]
Message-ID: <20061128171641.GF21834@nevyn.them.org> (raw)
In-Reply-To: <456C6BC3.3090006@redhat.com>

On Tue, Nov 28, 2006 at 05:02:59PM +0000, Nick Clifton wrote:
> +       CORE_ADDR dummy;
> +       union
> +       {
> + 	gdb_byte bytes[sizeof dummy];
> + 	CORE_ADDR addr;
> +       }
> +       return_buffer;
> +
>         /* Return values > 8 bytes are returned in memory,
>   	 pointed to by FN_RETURN_REGNUM.  */
> !       regcache_cooked_read (regcache, E_FN_RETURN_REGNUM, 
> return_buffer.bytes);
> !       read_memory (return_buffer.addr, valbuf, TYPE_LENGTH (type));
>       }
>   }
> 
> (Rest of the patch as before).
> 
> This makes the puning of gdb_byte and CORE_ADDR explicit, which I think 
> is a good thing, but maybe there is a preferred gdb way of doing this ? 
>  (Also I could not think of a clean way of obtaining the size of a 
> CORE_ADDR without using a dummy variable).

If your host and target have different endianness, this isn't going to
work so well.  And CORE_ADDR may be 32-bit or 64-bit.

I suspect that what you really want is extract_typed_address; and to
size the buffer according to a target pointer, not according to a
CORE_ADDR.

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2006-11-28 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-28 16:41 Nick Clifton
2006-11-28 16:56 ` Daniel Jacobowitz
2006-11-28 17:12   ` Nick Clifton
2006-11-28 17:17     ` Daniel Jacobowitz [this message]

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=20061128171641.GF21834@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=nickc@redhat.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