From: Daniel Jacobowitz <drow@false.org>
To: "Fabrício de Novaes" <fabricio@dea.inpe.br>,
"Paul Koning" <pkoning@equallogic.com>
Cc: gdb@sourceware.org
Subject: Re: Does GDB use VMA addresses when uploading an image to debug in a remote target?
Date: Fri, 01 Sep 2006 16:04:00 -0000 [thread overview]
Message-ID: <20060901160410.GA13927@nevyn.them.org> (raw)
In-Reply-To: <1140631963.8331@satelite.dea.inpe.br>
On Wed, Feb 22, 2006 at 03:12:43PM -0300, FabrÃcio de Novaes wrote:
> 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.
Replying to this old report again...
I was absolutely convinced for a long time that GDB's "load" wrote to
the VMA, a very confusing behavior. I remember another bug being
reported that seemed to illustrate this also, but I can't find it.
However, today I actually tried it, and it did exactly the right thing:
wrote to the LMA!
FabrÃcio, if you still can reproduce this problem, could you send me
the output of "load" and tell me what version of GDB you were using?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-09-01 16:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-22 18:18 Fabrício de Novaes
2006-02-22 18:23 ` Daniel Jacobowitz
2006-02-22 18:38 ` Paul Koning
2006-09-01 16:04 ` Daniel Jacobowitz [this message]
[not found] ` <AGEIJDMABNDJLNBDGKBPMEBFCDAA.fabricio@dea.inpe.br>
2006-09-01 17:03 ` RES: " Daniel Jacobowitz
2006-02-22 19:21 Fabrício de Novaes
2006-02-22 19:23 ` Daniel Jacobowitz
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=20060901160410.GA13927@nevyn.them.org \
--to=drow@false.org \
--cc=fabricio@dea.inpe.br \
--cc=gdb@sourceware.org \
--cc=pkoning@equallogic.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).