This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 2/2] handle an unspecified return address column
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: brobecker at adacore dot com
- Cc: tromey at redhat dot com, gdb-patches at sourceware dot org
- Date: Tue, 26 Nov 2013 14:48:11 +0100 (CET)
- Subject: Re: [PATCH 2/2] handle an unspecified return address column
- Authentication-results: sourceware.org; auth=none
- References: <1384375873-32160-1-git-send-email-tromey at redhat dot com> <1384375873-32160-3-git-send-email-tromey at redhat dot com> <20131126133446 dot GA28596 at adacore dot com>
> Date: Tue, 26 Nov 2013 17:34:46 +0400
> From: Joel Brobecker <firstname.lastname@example.org>
> Hi Tom,
> On Wed, Nov 13, 2013 at 01:51:13PM -0700, Tom Tromey wrote:
> > Debugging PR 16155 further, I found that the DWARF unwinder found the
> > function in question, but thought it had no registers saved
> > (fs->regs.num_regs == 0).
> > It seems to me that if a frame does not specify the return address
> > column, or if the return address column is explicitly marked as
> > DWARF2_FRAME_REG_UNSPECIFIED, then we should set the
> > "undefined_retaddr" flag and let the DWARF unwinder gracefully stop.
> > This patch implements that idea.
> > With this patch the backtrace works properly:
> > (gdb) bt
> > #0 0x0000007fb7ed485c in nanosleep () from /lib64/libc.so.6
> > #1 0x0000007fb7ed4508 in sleep () from /lib64/libc.so.6
> > #2 0x00000000004008bc in thread_function (arg=0x4) at threadapply.c:73
> > #3 0x0000007fb7fad950 in start_thread () from /lib64/libpthread.so.0
> > #4 0x0000007fb7f0956c in clone () from /lib64/libc.so.6
> > 2013-11-13 Tom Tromey <email@example.com>
> > PR backtrace/16155:
> > * dwarf2-frame.c (dwarf2_frame_cache): Set undefined_retaddr if
> > the return address column is unspecified.
> I just found out that this patch causes some problems on at least
> arm-elf and ppc-elf. Attached is a proposed patch, with associated
> PR backtrace/16155:
> * dwarf2-frame.c (dwarf2_frame_cache): Remove condition that
> sets cache->undefined_retaddr to 1 if there is no column in
> the frame info for the return register.
> Tested on x86_64-linux, no regression. It also fixes all regressions
> observed on arm-elf and ppc-elf.
> Can you tell me what you think?
Please start with backing out the original change.