Hi all, just an onfo about huw to use gcc tree
Richard Guenther
richard.guenther@gmail.com
Sat Mar 3 21:30:00 GMT 2007
On 3/3/07, Fabio Giovagnini <fabio.giovagnini@aurion-tech.com> wrote:
> Thanks for the answer.
> I go deeper in my thought so that maybe you can give me more infos about how I
> have to investagte about gcc/gdb
>
> We are developers of embedded software on board designed and build by us;
> Generally we use 16 bit cisc and 32 bits risc cpu (Renesas h8/h8s; sh 2 / 3 ).
> We write applications for automotive enviroment mainly.
> We write the code using c/c++ and we compile using gcc.
> Because of we do not have much memory (ram and flash) we develop in the
> following way: each software we write has the same communication protocol
> running on RS232 or over TCP/IP and we have a simple monitoring progarm able
> to show the contents of the memory addresses in some format (char, int, long,
> signed unsigned, strings, ecc).
> Generally we declare a global variable, we write a debug value into it and
> during the run time we read at the right moment the content of such a
> variable.
> Good.
> For avoiding to read by hand .map file produced by ld, I developed a flex /
> bison simple analizer able to extract from .map file the address of a symbol.
> So into my tool I load the .map file and I write the name of the variable and
> I can read the content of it.
> This way of working becomes very hard if I use struct and union in c and
> classes in c++; I should know the offeset of each field of the struct so
> addind it to the base address known from the .map file, for each istance of
> such a struct I coud write "mysrtuct.myfield" into my tool, and, calculating
> the rigth address, my protocol could ask the target to read/write the content
> at that address.
>
> I prefer to avoid -g option because of my memory is never enough; but a good
> compromise cound be if I could compile the debug infos into sections I could
> remove after used by gdb for giving me the informations about the offset of
> each field. Is it possible?
Just use the dwarf info produced by the compiler with -g and strip the
binary. Of course I would debug embedded stuff using a simulator...
Richard.
More information about the Gcc
mailing list