From: Joel Brobecker <brobecker@adacore.com>
To: Pierre Langlois <pierre.langlois@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Add support for the __flash qualifier on AVR
Date: Tue, 15 Jul 2014 15:01:00 -0000 [thread overview]
Message-ID: <20140715145904.GF4888@adacore.com> (raw)
In-Reply-To: <1405435683-10535-1-git-send-email-pierre.langlois@embecosm.com>
On Tue, Jul 15, 2014 at 03:48:03PM +0100, Pierre Langlois wrote:
> The __flash qualifier is part of the named address spaces for AVR [1]. It allows
> putting read-only data in the flash memory, normally reserved for code.
>
> When used together with a pointer, the DW_AT_address_class attribute is set to 1
> and allows GDB to detect that when it will be dereferenced, the data will be
> loaded from the flash memory (with the LPM instruction).
>
> We can now properly debug the following code:
[...]
> 2014-07-08 Pierre Langlois <pierre.langlois@embecosm.com>
>
> gdb/
> * avr-tdep.c (AVR_TYPE_ADDRESS_CLASS_FLASH): New macro.
> (AVR_TYPE_INSTANCE_FLAG_ADDRESS_CLASS_FLASH): Likewise.
> (avr_address_to_pointer): Check for AVR_TYPE_ADDRESS_CLASS_FLASH.
> (avr_pointer_to_address): Likewise.
> (avr_address_class_type_flags): New function.
> (avr_address_class_type_flags_to_name): Likewise.
> (avr_address_class_name_to_type_flags): Likewise.
> (avr_gdbarch_init): Set address_class_type_flags,
> address_class_type_flags_to_name and
> address_class_name_to_type_flags.
>
> gdb/testsuite/
> * gdb.arch/avr-flash-qualifer.c: New.
> * gdb.arch/avr-flash-qualifer.exp: New.
Thank you. This is now OK to commit with a couple of minor modifications.
First, would you mind reformatting the revision log so as to stay withing
76 characters instead of 80? This is because "git show" will indent that
revision log by 4 characters, thus causing formatting issues for those
of us who still use an 80 columns terminal.
Also:
> +static int
> +avr_address_class_type_flags (int byte_size, int dwarf2_addr_class)
> +{
> + /* The value 1 of the DW_AT_address_class attribute corresponds to the __flash
This line is too long (81 chars?)
> +int
> +main (void)
> +{
> + const __flash char *pointer_to_flash = &data_in_flash;
> + /* break here. */
Something I missed here. The project decided to try to follow the same
coding standards for our test programs as in the GDB code. So can you
skip a line after the variable declaration, and before the comment?
--
Joel
next prev parent reply other threads:[~2014-07-15 14:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 10:54 [PATCH] " Pierre Langlois
2014-07-15 10:36 ` [PING][PATCH] " Pierre Langlois
2014-07-15 14:00 ` [PATCH] " Joel Brobecker
2014-07-15 14:46 ` Pierre Langlois
2014-07-15 14:59 ` [PATCH v2] " Pierre Langlois
2014-07-15 15:01 ` Joel Brobecker [this message]
2014-07-15 15:56 ` Pierre Langlois
2014-07-15 16:42 ` [PUSHED] " Pierre Langlois
2014-07-21 16:02 ` [PATCH] " Pedro Alves
2014-07-23 17:42 ` Pierre Langlois
2014-07-24 1:35 ` Pedro Alves
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=20140715145904.GF4888@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pierre.langlois@embecosm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).