I have a source file, converted it to assembly and added 2 instructions and generated the final elf. When I load this final elf, symbols doesnt match the source due to assembly instructions addition.
Is there a way to align them ? am using ARM cortex-M4 and cortex-M0. I have tried to edit #line in assembly file to make sure lines match with source code but that doesn't give a good alignment. Any ideas?
Alignment seen on T32, Tried to highlight the source code
-----------------------------------
______addr/line|code_____|label____|mnemonic________________|comment______________________________________________________|
|...
|
| REQUIRE _printf_percent
| REQUIRE _printf_d
| REQUIRE _printf_int_dec
|foo2 PROC
| ; PATCH TOOL - START
16| PUSH {R0}
ST:00008098|B401 foo2: push {r0}
17| POP {R0}
ST:0000809A|BC01 pop {r0}
|#include<stdio.h>
|void foo2() ------------------ this is what I inserted
5|{
____ST:0000809C|A011________________add_____r0,pc,#0x44
6| printf("In foo2");
ST:0000809E|F000 bl_h 0x809E
ST:000080A0|B837 undef 0xB837
|}
|void foo1() ------------------ this is what came by default
12|{
ST:000080A2|B401 foo1: push {r0}
13| printf("In foo1");
ST:000080A4|BC01 pop {r0}
|void foo1()------------------ this is what I inserted
ST:000080A6|A011 add r0,pc,#0x44
ST:000080A8|F000 bl_h 0x80A8
ST:000080AA|B832 undef 0xB832
Hello,
I think you should put extra "#line" before the new instruction such as PUSH or POP.
The "#line" will reset the line number to the parameter of it.
Best regards,
Yasuhiko Koumoto.
Tried adding extra #line before inserted instructions but doesn't help.
It appears that generated assembly-object file doesn't have all the debug information as compared to object created from source. Any idea how they can be generated?
Here are the few things tried already
Compiler options: --debug --dwarf3 --debug_macros
Assembler options: --debug
Liner options: --bestdebug
--interleave doesn’t allow to reassemble the files.
can I ask your expectation?
As you say, the elf file includes many debug information.
What do you especially want?