This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb and binutils branch master updated. 487d975399dfcb2bb2f0998a7d12bd62acdd9fa1


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  487d975399dfcb2bb2f0998a7d12bd62acdd9fa1 (commit)
      from  57745c903f78ffdb10a6198a6e35e5a1e63ea4b0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=487d975399dfcb2bb2f0998a7d12bd62acdd9fa1

commit 487d975399dfcb2bb2f0998a7d12bd62acdd9fa1
Author: Pierre Langlois <pierre.langlois@embecosm.com>
Date:   Tue Jul 15 17:03:09 2014 +0100

    Add support for the __flash qualifier on AVR
    
    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:
    
    ~~~
    const __flash char data_in_flash = 0xab;
    
    int
    main (void)
    {
      const __flash char *pointer_to_flash = &data_in_flash;
    }
    ~~~
    
    ~~~
    (gdb) print pointer_to_flash
    $1 = 0x1e8 <data_in_flash> "\253"
    (gdb) print/x *pointer_to_flash
    $2 = 0xab
    (gdb) x/x pointer_to_flash
    0x1e8 <data_in_flash>: 0xXXXXXXab
    ~~~
    
    Whereas previously, GDB would revert to the default address space which is
    RAM and mapped in higher memory:
    
    ~~~
    (gdb) print pointer_to_flash
    $1 = 0x8001e8 ""
    ~~~
    
    [1] https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html
    
    2014-07-15  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.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                  |   13 ++++
 gdb/avr-tdep.c                                 |   86 ++++++++++++++++++++++--
 gdb/testsuite/ChangeLog                        |    5 ++
 gdb/testsuite/gdb.arch/avr-flash-qualifier.c   |   33 +++++++++
 gdb/testsuite/gdb.arch/avr-flash-qualifier.exp |   52 ++++++++++++++
 5 files changed, 184 insertions(+), 5 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/avr-flash-qualifier.c
 create mode 100644 gdb/testsuite/gdb.arch/avr-flash-qualifier.exp


hooks/post-receive
-- 
gdb and binutils


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]