From: Pierre Langlois <pierre.langlois@embecosm.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH][PR breakpoints/16606] AVR8 breakpoint out of range, decrement pc after break
Date: Mon, 10 Mar 2014 09:23:00 -0000 [thread overview]
Message-ID: <531D848B.2090708@embecosm.com> (raw)
In-Reply-To: <531A2316.5090507@embecosm.com>
Hello,
I'm terribly sorry, I didn't include a Changelog entry to my previous email.
Here it is:
2014-03-10 Pierre Langlois <pierre.langlois@embecosm.com>
PR breakpoints/16606:
* linespec.c (linespec_expression_to_pc): Set
TYPE_INSTANCE_FLAG_CODE_SPACE to address given by the expression
parser.
* avr-tdep.c (avr_integer_to_address): Add TYPE_CODE_SPACE.
Best,
Pierre
On 07/03/14 19:50, Pierre Langlois wrote:
> Firstly, this patch fixes issuing breakpoints using an address
> expression on AVR.
>
> For example:
>
> (gdb) break *0x10e
> would result in a breakpoint at the address 0x80010e, out of range.
>
> AVR is an harvard architecture and we use the top bits of the internal
> addresses to determine whether this is a code address or a data
> address. In this case, 0x800000 was applied to this address because it
> was considered to be a data address. A more detailed explanation of
> this behaviour can be found on bugzilla:
> https://sourceware.org/bugzilla/show_bug.cgi?id=16606#c1
>
> When returning a struct value from the evaluation of *0x10e, nothing
> in this value indicates that it resides in code space. In this case
> the expression is a linespec, referring to source code, so we can
> safely assume the address is in code space. We can set the
> TYPE_CODE_SPACE instance flag on the type of the value. When the value
> is converted to an address, gdbarch_integer_to_address can apply the
> correct mask depending on TYPE_CODE_SPACE.
>
> This fix unveiled another issue, the program counter was not
> decremented after hitting the breakpoint instruction.
> This patch fixes this by adding gdbarch_decr_pc_after_break to AVR's
> gdbarch.
>
> Best,
>
> Pierre
>
next prev parent reply other threads:[~2014-03-10 9:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 19:50 Pierre Langlois
2014-03-10 9:23 ` Pierre Langlois [this message]
2014-03-10 11:08 ` Joel Brobecker
2014-03-10 17:07 ` Pedro Alves
2014-03-11 11:58 ` Pierre Langlois
2014-03-12 8:08 ` Joel Brobecker
2014-03-13 14:05 ` Pierre Langlois
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=531D848B.2090708@embecosm.com \
--to=pierre.langlois@embecosm.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