This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARMClang V6 Assembler - missing line number info in debugger

Hi,

we are trying to debug code written using the new GNU-style syntax with the ARM ClangV6 toolkit. The processor platform is an NXP LPC177x (Cortex M3), I am running uVision 5.24.2.0 with ARMClang 6.7.

While assembling files in general works (after you remember to put .thumb_func before every exported symbol...), the Keil debugger is unable to show source code information for the assembler code, i.e. file name, line number and source code line. This works fine for the old V5 ARM assembler.

Looking into the generated object files and the final .axf ELF file (with arm-none-eabi-objdump), I can see debug line information (arm-none-eabi-objdump -drl) for object files generated with the new V6 assembler as well as by the linker, such as the following:

000000e4 <__bla>:
__bla():
Z:\Users\me\Desktop\Keil/bla.s:8
  e4:   f04f 002a       mov.w   r0, #42 ; 0x2a

000000e8 <l1>:
l1():
Z:\Users\me\Desktop\Keil/bla.s:9
  e8:   f04f 0117       mov.w   r1, #23

000000ec <l0>:
l0():
Z:\Users\me\Desktop\Keil/bla.s:10
  ec:   3901            subs    r1, #1
Z:\Users\me\Desktop\Keil/bla.s:11
  ee:   d1fd            bne.n   ec <l0>
Z:\Users\me\Desktop\Keil/bla.s:12
  f0:   3801            subs    r0, #1
Z:\Users\me\Desktop\Keil/bla.s:13
  f2:   d1f9            bne.n   e8 <l1>

000000f4 <endless>:
endless():
Z:\Users\me\Desktop\Keil/bla.s:16
  f4:   e7fe            b.n     f4 <endless>

000000f8 <Reset_Handler>:
Reset_Handler():
Z:\Users\me\Desktop\Keil/RTE\Device\LPC1778\/startup_LPC177x_8x.s:135
  f8:   4808            ldr     r0, [pc, #32]   ; (11c <__user_initial_stackheap+0xc>)

Here, the code from address e8 to f4 (incl.) was assembled using the V6 assembler (the only file in the project using the new assembler), the code starting from Reset_Handler is an old startup file using the V5 assembler. I assume the debug information shown by objdump is DWARF-3 debug information.

However, the debugger does not show any source information (apart from the disassembled instructions) for the code at addresses e8...f4, whereas this works as expected for the rest of the code.

Looking at the ELF sections of the object files for bla.s and startup_LPC177x_8x.s with readelf, bla.o shows fewer debug sections than startup_LPC177x_8x.o. So, I suspect that there is additional debug information contained in that .o which is actually used by the Keil debugger and the DWARF line number information is ignored?

Ideally, there should be a way to generate line number information with the V6 assembler that is accepted by the debugger or - the other way round - a way to tell the debugger to use the DWARF debug infos. However, I was unable to find a solution so far.

Any help is appreciated.

-- Michael