Miss debug information in code built with lto
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Fix Released
|
Undecided
|
Terry Guo |
Bug Description
Build attached project and then debug the elf file, inside gdb we can see the mixed view of assembly code and c source code:
(gdb) disassemble /m main
Dump of assembler code for function main():
5 int main() {
0x00000194 <+0>: push {r3, lr}
6 while(1) {
7 myled = 0;
8 wait(0.2);
0x00000198 <+4>: ldr r0, [pc, #28] ; (0x1b8 <main()+36>)
0x000001a0 <+12>: bl 0x1464 <wait>
9 myled = 0;
10 wait(0.2);
0x000001a8 <+20>: ldr r0, [pc, #12] ; (0x1b8 <main()+36>)
0x000001ac <+24>: bl 0x1464 <wait>
0x000001b0 <+28>: b.n 0x196 <main()+2>
0x000001b2 <+30>: nop
0x000001b4 <+32>: lsls r0, r3, #6
0x000001b6 <+34>: asrs r0, r0, #32
0x000001b8 <+36>: ldmia r4!, {r0, r2, r3, r6, r7}
0x000001ba <+38>: subs r6, #76 ; 0x4c
End of assembler dump.
But when build the project with option -flto, we won't be able to see such mixed view. It seems some debug information are missed due to lto:
terguo01@
GNU gdb (GNU Tools for ARM Embedded Processors) 7.6.0.20140731-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=
For bug reporting instructions, please see:
<http://
Reading symbols from /work/terguo01/
(gdb) disassemble /m main
Dump of assembler code for function main:
0x00000194 <+0>: push {r7, lr}
0x00000196 <+2>: sub sp, #16
0x00000198 <+4>: add r7, sp, #0
0x0000019a <+6>: ldr r3, [pc, #84] ; (0x1f0 <main+92>)
Changed in gcc-arm-embedded: | |
milestone: | 4.9-2014-q4-major → 4.9-2015-q1-update |
status: | Fix Committed → In Progress |
Changed in gcc-arm-embedded: | |
status: | In Progress → Fix Committed |
Changed in gcc-arm-embedded: | |
status: | Fix Committed → Fix Released |
Hi, any news on this issue?
Has it something to do with skipped flags during LTO?
I want to use the 4.8 toolchain for the next Emblocks release but this issue is a bit annoying.
Thanks!