Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: C code inline with assembler file output

2005-10-19 by bdmlpc

Hello,

just turn on debugging info ('-g') and have a look at your object- or
elf-file with 'arm-elf-objdump -DS <file>'. This will display C-source
and assembler in a mix. Hint: If you turn off optimization ('-O') the
output is more readable!

  Sten

--- In lpc2000@yahoogroups.com, "roelof t Hooft" <roelofh@i...> wrote:
>
> Hi all,
> 
> I would like to have the C code combined with the
> generated assembler output.
> I have these lines in the source code :
> 
> //      bcfg0 = 0x2000fbef;
> 
>         bcfg0 = ((flash_mw << 28) | (flash_bm << 27) | (flash_wp <<
> 26) | (flash_wst2 << 11) | (flash_rble << 10) | (flash_wst1 << 5) |
> flash_idcy);
> 
> The values for the second line are defined in a header file. Now I
> want to see the generated hex value. It is there in the corresponding
> .lst file, but there's no reference to the source code line that
> belongs to it.
> 
> How can I make the compiler/assembler/linker include the lines of
> source code (in the assembler output) for reference ?
> 
> I'm a bit puzzled by the wealth of options offered by the different
> programs. I also included the most common, I think, options to no
> avail.
> 
> TIA
> 
> roelof
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.