Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: Michael.Snyder@palmsource.com
Cc: andrew.stubbs@st.com, gdb@sourceware.org
Subject: Re: Problem with breakpoint addresses
Date: Sun, 15 Oct 2006 20:00:00 -0000	[thread overview]
Message-ID: <200610151812.k9FIC8pt022139@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <1160764729.14535.242.camel@localhost.localdomain> (message from 	Michael Snyder on Fri, 13 Oct 2006 11:38:49 -0700)

> From: Michael Snyder <Michael.Snyder@palmsource.com>
> Date: Fri, 13 Oct 2006 11:38:49 -0700
> 
> On Fri, 2006-10-13 at 09:19 +0100, Andrew STUBBS wrote:
> > Michael Snyder wrote:
> > > What's the size of $r1, and what's the size of an address?
> > > By converting $r1 to an address, you're applying an implied cast.
> > > If that doesn't give the expected result (eg. because $r1 is signed),
> > > then you need to use an explicit cast.
> > 
> > Registers are 32 bit, addresses are 32 bit. It's just something in GDB 
> > that uses 64 bit. It might be because sh-elf also supports sh64.
> > 
> > In any case, it is successfully setting the breakpoint and then failing 
> > to recognise it when it is hit. That isn't the behaviour I would like. 
> > If it totally failed to set it then giving the cast might be fair 
> > enough, if the user thought addresses were 64 bit.
> 
> Hmmm.  Well, gdb's internal representation of a target address is
> a typedef COREADDR, and usually it equates to a long long (64 bits).

Actually, in many cases it isn't.  If you're on a 32-bit host and
configure for a purely 32-bit target, CORE_ADDR will be a 32-bit type.

> Seems like, if we know that for a given architecture, an actual
> target address is only 32 bits, we should always make sure to 
> save only 32 bits into a COREADDR.

Indeed.  This is basically what I suggested to Jan to solve his
problem.

Mark


      reply	other threads:[~2006-10-15 20:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-12 17:54 Andrew STUBBS
2006-10-12 19:50 ` Michael Snyder
2006-10-13  8:29   ` Andrew STUBBS
2006-10-13 13:19     ` Daniel Jacobowitz
2006-10-30 16:18       ` Andrew STUBBS
2006-10-30 16:44         ` Daniel Jacobowitz
2006-10-30 16:55           ` Andrew STUBBS
2006-10-30 17:07             ` Daniel Jacobowitz
2006-10-13 18:39     ` Michael Snyder
2006-10-15 20:00       ` Mark Kettenis [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=200610151812.k9FIC8pt022139@elgar.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=Michael.Snyder@palmsource.com \
    --cc=andrew.stubbs@st.com \
    --cc=gdb@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