gdb.base/pending.exp failures

Bug #615989 reported by Ulrich Weigand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GDB
Invalid
Low
Unassigned

Bug Description

FAIL: gdb.base/pending.exp: run to resolved breakpoint 1 (without symbols)
FAIL: gdb.base/pending.exp: continue to resolved breakpoint 1
FAIL: gdb.base/pending.exp: continue to resolved breakpoint 3 (the program exited)

Further analysis required.

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

The first failure is caused by breakpoint setting by mistake. In test case, breakpoint is set on function 'pendfunc1', and expected to set/hit on line 22, however, breakpoint is hit on line 23.

Reproduce it in another way,
$ ./gdb /home/yao/Work/LP615989/pendshr.c.o
(gdb) b pendfunc1
During symbol reading, DW_AT_name missing from DW_TAG_base_type.
Breakpoint 1 at 0x6: file /home/yao/maverick/home/yao/cvs/src/gdb/testsuite/gdb.base/pendshr.c, line 23.

You can see that breakpoint is set at address 0x6, which is associated with line 23. We can prove this by dumping .debug_line, as follows,

  Special opcode 49: advance Address by 6 to 0x6 and Line by 2 to 23 // <---- here,
  Special opcode 45: advance Address by 6 to 0xc and Line by -2 to 21
  Special opcode 20: advance Address by 2 to 0xe and Line by 1 to 22
   Special opcode 62: advance Address by 8 to 0x16 and Line by 1 to 23

Disasm pendfunc1 shows that, ldr insn (on 0x6) loads a const.

00000000 <pendfunc1>:
   0: b580 push {r7, lr}
   2: b084 sub sp, #16
   4: af00 add r7, sp, #0
   6: 4b09 ldr r3, [pc, #36] ; (2c <pendfunc1+0x2c>)
   8: a200 add r2, pc, #0 ; (adr r2, c <pendfunc1+0xc>)
   a: 4413 add r3, r2

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

pendfunc1:
        @ args = 0, pretend = 0, frame = 16
        @ frame_needed = 1, uses_anonymous_args = 0
        push {r7, lr} @ 27 *push_multi [length = 4]
        sub sp, sp, #16 @ 28 *arm_addsi3/5 [length = 4]
        add r7, sp, #0 @ 30 *arm_addsi3/1 [length = 4]
        ldr r3, .L3 @ 9 pic_load_addr_thumb2 [length = 4]

Insn ldr on address 0x6 is generated from rtl 'pic_load_addr_thumb2', so it should *not* be associated with line 23,

So this entry
      'Special opcode 49: advance Address by 6 to 0x6 and Line by 2 to 23'
in .debug_line is wrong. AFAICS, the first failure is caused by a compiler bug.

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

Run this test with gcc-linaro-4.5-2010.08-1, failures go away!!

$ make check RUNTESTFLAGS="pending.exp CC_FOR_TARGET='/home/yao/gcc-linaro-4.5-2010.08-1-armv7l-maverick-cbuild2-pavo2/bin/armv7l-unknown-linux-gnueabi-gcc'"
Running /home/yao/maverick/home/yao/cvs/src/gdb/testsuite/gdb.base/pending.exp ...

  === gdb Summary ===

# of expected passes 29

This case still fails with gcc-4.5 (Ubuntu 4.5.1-1ubuntu1) 4.5.1, gcc-4.4 (Ubuntu/Linaro 4.4.4-8ubuntu1) 4.4.5 20100728, and gcc-linaro-4.4-2010.08-0.

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

Open bug LP:617384 for linaro gcc 4.4.

Changed in gdb-linaro:
importance: Undecided → Low
Changed in gdb-linaro:
status: New → Confirmed
Revision history for this message
Ulrich Weigand (uweigand) wrote :

The underlying compiler bug is now fixed; closing the GDB bug as Invalid.

Changed in gdb-linaro:
status: Confirmed → Invalid
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.