Harvard architecture and gdb

James Bowman james.bowman@ftdichip.com
Wed Jan 13 03:32:00 GMT 2016


I am maintainer for a Harvard architecture target, FT32.

FT32 has two address spaces, flash and RAM. They both occupy addresses starting at address 0. This is similar to AVR. We use a __flash__ modifier to specify address space 1.

But I am struggling to understand how to describe the architecture to gdb. In particular FT32 uses address spaces to distinguish between pointers to RAM and flash. But gdb only seems to actually care about address spaces for *pointers*. When gcc writes the debug info for a plain object, it does not emit the DW_AT_address_class field; nor does gdb handle DW_AT_address_class for non-pointer types.  So I am at a loss to understand how these two variables would be distinguished by gdb:

  int ram_var = 1234;
  __flash__ const int flash_var = 1234;

I suspect I have misunderstood something fundamental. Does anyone have any suggestions? Thanks.

--
James Bowman
FTDI Open Source Liaison



More information about the Gdb mailing list