gdb.dwarf2/dw2-ref-missing-frame.exp failure

Bug #615997 reported by Ulrich Weigand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GDB
Fix Released
Low
Yao Qi

Bug Description

FAIL: gdb.dwarf2/dw2-ref-missing-frame.exp: running to func_loopfb in runto

Further analysis required.

Revision history for this message
Yao Qi (yao-codesourcery) wrote :

Failure is caused by setting breakpoint on func_loopfb (at 0x839a), but program doesn't hit breakpoint.

(gdb) file /home/yao/maverick/home/yao/cvs/build/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame^M
Reading symbols from /home/yao/maverick/home/yao/cvs/build/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame...done.^M
(gdb) delete breakpoints^M
(gdb) info breakpoints^M
No breakpoints or watchpoints.^M
(gdb) break func_loopfb^M
Breakpoint 1 at 0x839a // <---- [2]
(gdb) run ^M
Starting program: /home/yao/maverick/home/yao/cvs/build/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame ^M
^M
Program exited normally.^M
(gdb) FAIL: gdb.dwarf2/dw2-ref-missing-frame.exp: running to func_loopfb in runto

Disassembly function main and func_loopfb,

Dump of assembler code for function main:
   0x000083a8 <+0>: push {r7, lr}
   0x000083aa <+2>: sub sp, #8
   0x000083ac <+4>: add r7, sp, #0
   0x000083ae <+6>: mov.w r3, #1
   0x000083b2 <+10>: str r3, [r7, #4]
   0x000083b4 <+12>: bl 0x8390 <func_nofb>
   0x000083b8 <+16>: bl 0x839c <func_loopfb> // <--- [1]

(gdb) disassemble func_loopfb
Dump of assembler code for function func_loopfb:
   0x0000839a <+0>: nop
   0x0000839c <+0>: push {r7}
   0x0000839e <+2>: add r7, sp, #0
   0x000083a0 <+4>: mov sp, r7
   0x000083a2 <+6>: pop {r7}
   0x000083a4 <+8>: bx lr

The reason of breakpoint is not hit is that debugger set breakpoint at at 0x839a [2], but main function branch to func_loopfb at 0x0000839c [1].

There might be some ways to fix this problem,
1. Don't generate nop insn,
2. Change target address of bl from 839c to 839a,
3. Tell GDB to set breakpoint insn on 'push' rather than 'nop'

Revision history for this message
Yao Qi (yao-codesourcery) wrote :

In this test case, it is assumed that address of 'func_loopfb_start' is equal to 'func_loopfb'. This assumption is *not* correct in thumb mode. This small patch can fix this bug. Tested this on both armel and x86.

Index: gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c,v
retrieving revision 1.1
diff -u -r1.1 dw2-ref-missing-frame-func.c
--- gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c 25 Jun 2010 15:34:46 -0000 1.1
+++ gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c 12 Aug 2010 06:33:51 -0000
@@ -19,6 +19,7 @@
 asm ("cu_text_start:");

 asm (".globl func_nofb_start");
+asm (".align 2");
 asm ("func_nofb_start:");

 void
@@ -31,6 +32,7 @@
 asm ("func_nofb_end:");

 asm (".globl func_loopfb_start");
+asm (".align 2");
 asm ("func_loopfb_start:");

 void

Changed in gdb-linaro:
assignee: nobody → Yao Qi (yao-codesourcery)
status: New → In Progress
Revision history for this message
Yao Qi (yao-codesourcery) wrote :
Revision history for this message
Yao Qi (yao-codesourcery) wrote :
Changed in gdb-linaro:
status: In Progress → Fix Committed
Revision history for this message
Yao Qi (yao-codesourcery) wrote :
Changed in gdb-linaro:
importance: Undecided → Low
Changed in gdb-linaro:
milestone: none → 7.2-2010.10-0
Michael Hope (michaelh1)
Changed in gdb-linaro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.