Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: Ed Satterthwaite <ehs@sibyte.com>
Cc: gdb-patches@sources.redhat.com, cagney@cygnus.com
Subject: Re: [RFA] info breakpoints: handle 64-bit addresses
Date: Fri, 16 Mar 2001 11:25:00 -0000	[thread overview]
Message-ID: <3AB265E3.3C510856@cygnus.com> (raw)
In-Reply-To: <20010316013348.A6253DF21@wagner.sibyte.com>

Ed Satterthwaite wrote:
> 
> As written, this patch has a slightly unfortunate side effect for MIPS
> targets.
> 
> Michael Snyder <msnyder@cygnus.com> wrote
> 
> > 2001-03-14  Michael Snyder  <msnyder@redhat.com>
> >
> >         * breakpoint.c (print_one_breakpoint): Handle 64-bit addresses.
> 
> In the code below, b->address is a CORE_ADDR, which is 64 bits when
> gdb is configured to support 64-bit MIPS targets.  TARGET_ADDR_BIT is
> implicitly set in mips-tdep.c according to the ABI deduced from the
> object file.  For 32-bit or unknown ABI's, that will be 32.  In the
> MIPS architecture, a 64-bit CPU sign-extends 32-bit addresses.
> 
> At least on some hosts, the output conversion is done by sprintf.
> Thus 32-bit addresses with bit 31 clear will print as 8 hex digits,
> while those with bit 31 set (e.g., kseg0 and kseg1) will spill into 16
> hex digits, thereby spoiling the intended column alignment.
> 
> Here's a possible alternative for the first arm of the new
> conditional.  It's similar to usage in mips-tdep.c.  It avoids the
> cast to unsigned long in the original code but does assume ANSI C.
> 
>    tmp = longest_local_hex_string_custom ((b->address
>                                            & (CORE_ADDR) 0xffffffff),
>                                           "08l");

Ah -- OK, this is reasonable.  Thanks for the suggestion.


      reply	other threads:[~2001-03-16 11:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-15 17:34 Ed Satterthwaite
2001-03-16 11:25 ` Michael Snyder [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=3AB265E3.3C510856@cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=cagney@cygnus.com \
    --cc=ehs@sibyte.com \
    --cc=gdb-patches@sources.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