From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: [commit] Fix compilation warning in procfs.c on mips-irix
Date: Thu, 16 Apr 2009 18:24:00 -0000 [thread overview]
Message-ID: <200904161924.52037.pedro@codesourcery.com> (raw)
In-Reply-To: <20090416173025.GO7557@adacore.com>
On Thursday 16 April 2009 18:30:25, Joel Brobecker wrote:
> While I was building GDB on mips-irix, I noticed a couple of warnings,
> so I decided to fix them.
>
> On mips-irix, the pr_vaddr field is a caddr, and apparently, CORE_ADDR
> is not the same size as this type. So we need to cast it to an integer
> type with the same size first, and then to CORE_ADDR.
{
- return (*func) ((CORE_ADDR) map->pr_vaddr,
+ return (*func) ((CORE_ADDR) (uintptr_t) map->pr_vaddr,
map->pr_size,
(map->pr_mflags & MA_READ) != 0,
(map->pr_mflags & MA_WRITE) != 0,
Isn't this a problem for MIPS, due to pointer sign-extension?
proc-service has these utility routines to handle the similar
case on mips-linux:
/* Convert a psaddr_t to a CORE_ADDR. */
static CORE_ADDR
ps_addr_to_core_addr (psaddr_t addr)
{
if (exec_bfd && bfd_get_sign_extend_vma (exec_bfd))
return (intptr_t) addr;
else
return (uintptr_t) addr;
}
/* Convert a CORE_ADDR to a psaddr_t. */
static psaddr_t
core_addr_to_ps_addr (CORE_ADDR addr)
{
if (exec_bfd && bfd_get_sign_extend_vma (exec_bfd))
return (psaddr_t) (intptr_t) addr;
else
return (psaddr_t) (uintptr_t) addr;
}
--
Pedro Alves
next prev parent reply other threads:[~2009-04-16 18:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-16 17:30 Joel Brobecker
2009-04-16 18:24 ` Pedro Alves [this message]
2009-04-16 18:45 ` Joel Brobecker
2009-04-16 19:52 ` Daniel Jacobowitz
2009-04-17 13:27 ` Pedro Alves
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=200904161924.52037.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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