Regression on PowerPC (Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3)

Ulrich Weigand
2012-01-03T14:45:35Z

Jan Kratochvil wrote:
> On Mon, 02 Jan 2012 03:45:32 +0100, Joel Brobecker wrote:
> > and maybe this one. For yours, there's been enough
> > scrutiny I think that it can go in I think that it can go in already.
>
> Checked in:
> http://sourceware.org/ml/gdb-cvs/2012-01/msg00013.html
> Checked in 7.4:
> http://sourceware.org/ml/gdb-cvs/2012-01/msg00014.html

This seems to have caused

FAIL: gdb.cp/gdb2495.exp: Call a function that raises an exception without a handler. (timeout)
FAIL: gdb.cp/gdb2495.exp: bt after returning from a popped frame (timeout)
FAIL: gdb.cp/gdb2495.exp: info breakpoints (timeout)
FAIL: gdb.cp/gdb2495.exp: (timeout) set unwind-on-terminating-exception off
FAIL: gdb.cp/gdb2495.exp: Turn off unwind on terminating exception flag (timeout)
FAIL: gdb.cp/gdb2495.exp: Call a function that raises an exception with unwinding off.. (timeout)
ERROR: Delete all breakpoints in delete_breakpoints (timeout)
UNRESOLVED: gdb.cp/gdb2495.exp: setting breakpoint at main (timeout)

on powerpc-linux and powerpc64-linux.

I think the problem is that your statement as of here:

"_start at least on GNU/Linux does not have .eh_frame FDE for itself."
(http://sourceware.org/ml/gdb-patches/2011-12/msg00873.html)

is actually not true on PowerPC (at least on my RHEL5 system):

[uweigand@cellntc3 ~]$ readelf -wf /usr/lib64/crt1.o
The section .eh_frame contains:

00000000 00000010 00000000 CIE
Version: 1
Augmentation: "zR"
Code alignment factor: 4
Data alignment factor: -8
Return address column: 65
Augmentation data: 1b

DW_CFA_def_cfa: r1 ofs 0

00000014 00000010 00000018 FDE cie=00000000 pc=00000000..00000024
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop

When the unwinder runs into this FDE and assumes it is valid for the
dummy frame, it goes into an endless loop ...

Switching to the ON_STACK method fixes this for me. But I'm not sure
if there are other platforms beside PowerPC that have the same problem ...
Maybe we ought to default to ON_STACK (at least on Linux?)?

Note that it's a bit annoying that we need to provide a push_dummy_code
routine in order to be able to use ON_STACK. Maybe there should be a
default implementation based on gdbarch_inner_than/gdbarch_frame_align_p
and the breakpoint length?

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com