Re: [rfc/rfa] Use ARM exception tables as GDB unwinder

Daniel Jacobowitz
2010-10-21T18:42:40Z

On Thu, Oct 21, 2010 at 08:26:09PM +0200, Ulrich Weigand wrote:
> One issue with this just occurred to me: comparing personality routines
> by *name* relies on symbol information being present. Since we're doing
> the whole ARM unwinder support primarily to better cope with the case
> where symbol information is absent, this may be counter-productive ...
>
> Is there some other way to recognize those particular unwinders?

Yes, it's true that this requires names. Fortunately, in the usual
case they are in the dynamic symbol table. So, I think you'll have
the names - or do we not see dynamic symbols here?

> Another, related topic: Running the GDB testsuite on a system without
> debug/symbol info, I'm still seeing failures in unwinding from interrupted
> system calls. This is because the assembler code to do the syscall
> clobbers r7 without generating appropriate unwind records, and thus
> unwinding fails somewhere higher up the stack.
>
> Now, this is exactly the problem you fixed by moving the actual syscall
> into a separate routine __libc_do_syscall. However, this routine is
> only called from C code built for -mthumb. C code built for -marm,
> as well as code originally in (ARM) assembler, will continue to use
> inline sequences clobbering r7.

This should work... the problem with r7 was that it's the hard frame
pointer for Thumb (even Thumb-2 - although it shouldn't be, most
likely, it's a wasteful choice). So we couldn't mark it as
clobbered. Does GCC not mark r7 as saved on the stack for the ARM
code? It should know perfectly well that r7 is not unchanged.

--
Daniel Jacobowitz
CodeSourcery