This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Setting breakpoints
- From: "Eric de Jong" <list_ericdejong_10 at gmx dot net>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 5 Jun 2003 10:18:57 +0200
- Subject: Re: [ECOS] Setting breakpoints
- References: <000001c32aa9$6c5e60f0$73dea8c0@lair>
>> Q: What section do I place the functions in question into?
After compiling ecos as a library, you will find a linker file called
"target.ld" in the ./install/lib directory. Edit it and add an extra text
section to it, say .ramtext
Then, you can place your code in it. As you do an "objdump -h" to your compiled
program, you will see something like this:
11 .text 00022ab4 00012044 00012044 000000e4 2**2
CONTENTS, ALLOC, LOAD, CODE
13 .bss 00006d4c 00034af8 00034af8 00022b98 2**5
ALLOC
18 .data 00010b84 02044878 02044878 00027410 2**2
CONTENTS, ALLOC, LOAD, DATA
notice that the .data section has attribute DATA, and .text has attribute CODE
When you create an extra section .ramtext and place a function in it, it should
get the CODE attribute. Now there are two importand things:
1) be sure to set the LMA address in rom/flash and the VMA address to ram.
Please read the info documentation of ld on how to do this.("Output section
LMA")
2) before a function in .romtext is called, the .romtext section must be copied
from flash to ram first! Do this from a function which is NOT in ram. See also
the info documentation.
You might experience problems with the linker file, as the addresses must be
sequential (haven't figured that out myself yet :). Put the extra .ramtext
section after the .text section or reset the location counter with the line
. = 0x12000;
of course, use your own valid address
Eric
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss