This is the mail archive of the gdb@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]

Does GDB use VMA addresses when uploading an image to debug in a remote target?


Hi all,


I have a GCC application that will run in a board with an ERC32 (SPARC) processor. For many reasons, this app has to run in RAM, not ROM.

So, the ELF32 image has a ".boot" section which starts the board and copies the main program from a ".text" section to RAM. This .text section has different LMA (pointing to ROM) and VMA (RAM) addresses, as you can see below:

Idx Name          Size      VMA       LMA       File off  Algn
  0 .boot         00001320  00000000  00000000  000000b4  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text         0001d1b0  02001000  00001320  000013d8  2**3
                  CONTENTS, ALLOC, LOAD, CODE
[...]


I'm trying to debug this app using GDB and a simulator. My problem is that, when I load the image to debug, the .text section is already in the 0x2001000 address (VMA), and the LMA area (starting from 0x1320) is empty - so I can't debug appropriately the routine that copies the .text section to RAM.

I'd like to know if GDB loads sections from an ELF file to a target using the VMA addresses and, if yes, if it's possible to change this behavior and tell it to send my .text section to its LMA address.

Any answer or comment will be very appreciated.
Thank you in advance and best regards,


Fabrício de Novaes Kucinskis.

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