Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Langlois <pierre.langlois@embecosm.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][PR breakpoints/16606] AVR8 breakpoint out of range, decrement pc after break
Date: Thu, 13 Mar 2014 14:05:00 -0000	[thread overview]
Message-ID: <5321BB33.6090109@embecosm.com> (raw)
In-Reply-To: <20140312080759.GD4882@adacore.com>


>> I just realized that support for multiple address spaces was added
>> but never documented.
>> So the way to solve the issue is to add the @code qualifier as such:
>>
>> (gdb) break * (@code void *) 0x10e
>>
>> And it will set the TYPE_CODE_SPACE instance flag to the type when
>> calling integer_to_address.
>>
>> However, shouldn't @code be the default for breakpoints?
> I am not really sure about that. I know my example is not going to be
> the most frequent situation ever, but what if the code is data memory?
> I admit I didn't know about the @code, is there an equivalent for
> data pointers as well? If that were a yes, I think we could argue
> that indeed, @code would be a better default, and look into what
> it would take to make that happen.
>
I only just noticed the existence of the space qualifiers. So yes, there are both
@code and @data qualifiers for all targets. We could potentially have @code being
the default and then issuing break *(@data void*) 0xaddr if the architecture
supports executing data memory.

I realized none of these flags are set by default actually, the fact that break defaults
to a data address on AVR is because when evaluating "*0x10e", the resulting value is
given a type with a code TYPE_CODE_INT. The AVR target code interprets this as a data address.

I'm investigating where setting a default address spaces could be implemented.

Thank you for the comments


      reply	other threads:[~2014-03-13 14:05 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
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 [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=5321BB33.6090109@embecosm.com \
    --to=pierre.langlois@embecosm.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