Re: [PATCH 0/4] Modernize frame unwinders and add disable feature

Luis Machado
2024-03-11T14:57:38Z

Hi,

On 3/6/24 12:51, Guinevere Larsen wrote:
> This patch series started with me trying to make it easier to test GDB's
> ability to unwind using CFI data, to improve a previous patch I sent to
> the list. However, once I finished these changes, I realized there was
> an unrelated bug I should fix before proposing the CFI test. Since these
> changes are significant enough already, and I think would be interesting
> on their own, I figured I shoudl submit this patch series as is right
> now while I figure out the other bug.
>
> The first patch is just a minor change, storing frame unwinders in a
> vector instead of through an unwinder table accessible using the
> registry system. This isn't required (like I originally thought it was),
> but it does make the whole system more readable in my opinion.
>
> Patch 3 has the real meat of the modernization, making GDB use
> polymorphism to handle frame unwinders. This is slightly slower than
> using function pointers, but much more readable in my opinion.
>
> As for the unwinder classes, they were chosen somewhat arbitrarily,
> mostly based on where I found an unwinder and its name. I almost expect
> some unwinders to be mis-categorized, but that should be easy to fix.
>
> The changes up to patch 3 have been tested with a try-branch, no
> regressions as far as I could see.
>
> Guinevere Larsen (4):
> gdb: make gdbarch store a vector of frame unwinders
> gdb: add "unwinder class" to frame unwinders
> gdb: Migrate frame unwinders to use C++ classes
> GDB: introduce ability to disable frame unwinders

I haven't gone through the series in detail, but I thought I'd give it a try on one of the
aarch64 machines I have access to. I didn't look particularly healthy:

# of unexpected core files 47
# of expected passes 116521
# of unexpected failures 581
# of expected failures 77
# of known failures 116
# of untested testcases 128
# of unresolved testcases 1102
# of unsupported tests 458
# of duplicate test names 10

I see a number of internal errors going on. Mostly like these:

../../../repos/binutils-gdb/gdbsupport/errors.cc:58
0xaaaad27e7877 check_ptrace_stopped_lwp_gone
../../../repos/binutils-gdb/gdb/linux-nat.c:1634
0xaaaad27e7877 check_ptrace_stopped_lwp_gone
../../../repos/binutils-gdb/gdb/linux-nat.c:1630
0xaaaad2ae0fa3 linux_resume_one_lwp