From: Michael Snyder <Michael.Snyder@palmsource.com>
To: Andrew STUBBS <andrew.stubbs@st.com>
Cc: GDB List <gdb@sourceware.org>
Subject: Re: Problem with breakpoint addresses
Date: Thu, 12 Oct 2006 19:50:00 -0000 [thread overview]
Message-ID: <1160682611.14535.191.camel@localhost.localdomain> (raw)
In-Reply-To: <452E8150.5090209@st.com>
On Thu, 2006-10-12 at 18:54 +0100, Andrew STUBBS wrote:
> Hi,
>
> I have a problem setting breakpoints from addresses stored in registers.
>
> Here's an example:
>
> (gdb) set $r1 = 0x80000000
> (gdb) b *$r1
> Breakpoint 2 at 0x80000000
>
> The breakpoint looks like it is set correctly, but actually, if it is to
> work, I have to set it like this:
>
> (gdb) b *($r1 & ~0U)
> Breakpoint 3 at 0x80000000
>
> This shows the difference:
>
> (gdb) info breakpoints
> Num Type Disp Enb Address What
> 2 breakpoint keep y 0xffffffff80000000
> 3 breakpoint keep y 0x80000000
>
> The address has been sign extended. Note that there is no problem with
> registers of unsigned type. This is with an sh-elf target hosted on
> i686-pc-linux-gnu and using 'target sim'.
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.
next prev parent reply other threads:[~2006-10-12 19:50 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 [this message]
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
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=1160682611.14535.191.camel@localhost.localdomain \
--to=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