debbugging symbols, assembly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

debbugging symbols, assembly

Balthasar Szczepański
Hello,
I'm new here, so please forgive me if this is not the right place to ask this.

I stared using msp430-gcc recently. (Earlier I used something else.)
I'm working on on some program written in C and assembly.
I wanted to debug it in mspdebug (in simulation mode, because the pif
has not implemented single stepping). I wanted to debug some assembly
code.
However I noticed that I only had access to symbols (functions,
variablles) from the C file but not from the assembly file. Looks like
the symbols form the assembly file are not present in the .elf file.
I was not able to find by myself how to compile / assemble it to have
all symbols in the .elf file

Currently, I use these commands:
msp430-gcc -g -c -Os -mmcu=msp430f1232 -o main.o main.c
msp430-gcc    -E     -mmcu=msp430f1232 -o asmp.s asm.S
msp430-as  -g        -mmcu=msp430f1232 -o asm.o  asmp.s
msp430-gcc -g        -mmcu=msp430f1232 -o st.elf main.o asm.o

If someone was able to tell how to do this so that I have all the
symbols in the .elf I would be thankful.

Balthasar Szczepański

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: debbugging symbols, assembly

Ingo van Lil
On 03/01/2016 11:12 PM, Balthasar Szczepański wrote:

> However I noticed that I only had access to symbols (functions,
> variablles) from the C file but not from the assembly file. Looks like
> the symbols form the assembly file are not present in the .elf file.
> I was not able to find by myself how to compile / assemble it to have
> all symbols in the .elf file

mspdebug does not use debug symbols (the ones you enable with the -g
compiler switch), just the plain symbol names that are also used for
linking. However, in the ELF format, each symbol has a type field, and
mspdebug only uses symbols of certain types (object, function, etc.).
You can display the symbol table of an ELF object with "readelf --syms
file.o". Symbols whose type is listed as NOTYPE will be ignored by mspdebug.

If you want an assembler-defined symbol to be visible in mspdebug you
have to declare its type with a directive like ".type my_function,
@function".

Regards,
Ingo

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users