This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Use -fno-asynchronous-unwind-tables if C program is compiled without debug info on x86
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 22 Apr 2016 15:35:55 +0100
- Subject: Re: [PATCH 1/2] Use -fno-asynchronous-unwind-tables if C program is compiled without debug info on x86
- Authentication-results: sourceware.org; auth=none
- References: <1461052220-10149-1-git-send-email-yao dot qi at linaro dot org> <1461052220-10149-2-git-send-email-yao dot qi at linaro dot org> <57163425 dot 1070505 at redhat dot com> <86wpnsiskw dot fsf at gmail dot com> <571A197A dot 5030201 at redhat dot com> <86y485hgdx dot fsf at gmail dot com>
On 04/22/2016 03:23 PM, Yao Qi wrote:
> I want to focus on handling unavailable memory in frame unwinder, so I
> cannot do all of them above. What I can do are:
>
> 1. Name some unwinders, such as dwarf unwinders, prologue unwinders,
> sigtramp unwinders, stub unwinders, etc. Other unwinders are nameless.
> 2. Add a new maint command "maint set/show preferred-unwinder". This
> command tell GDB to prefer a unwinder during frame unwinding. If the
> unwinder can't be applied to the frame (sniffer fails), it is not chosen.
Instead of a name, maybe a frame-unwinder-class enum, based on
https://sourceware.org/bugzilla/show_bug.cgi?id=19288#c13
~~~~~~~~~~~~~~~
- The "Accurate unwinders"
These would be the DWARF / x64 SEH based ones.
- JIT unwinders
Python/Guile unwind API unwinders, and also the C JIT-reader
API unwinder, in jit.c.
- Fallback prologue unwinders
~~~~~~~~~~~~~~~
Then it could be "required" instead of "preferred", which would
catch problems with the unwinder's sniffer as well.
> 3. Prefer different unwinders (dwarf vs. prologue) in the different
> runs of gdb.trace tests, like
>
> foreach_with_prefix unwinder { "dwarf" "prologue" } {
> gdb_test "maint set preferred-unwinder $unwinder"
> gdb_test "tfind start"
> .....
> gdb_test "tfind stop"
> }
>
> so that the PR 19947 can be reproduced. I'll stop here.
>
> What I don't plan to do in the short term are:
>
> - Write a case, let GDB single-step through its body, including
> prologue, epilogue and its callees, and check "bt" can show the
> frames correctly with different unwinders.
> - Single-step through dynamic symbol resolution / plt, prefer "dwarf"
> unwinder, and check "bt" can show the frames correctly.
>
> Is it OK to you?
>
Yes, that sounds good to me.
Thanks,
Pedro Alves