Simplify get_frame_unwind_table
Checks
Commit Message
This simplifies get_frame_unwind_table, changing it to use the
registry 'emplace' method and to pass the initialization iterators to
the constructor. This fixes a build problem on x86 -- reported by the
auto-builder -- as a side effect.
---
gdb/frame-unwind.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
Comments
On 1/17/25 4:04 PM, Tom Tromey wrote:
> This simplifies get_frame_unwind_table, changing it to use the
> registry 'emplace' method and to pass the initialization iterators to
> the constructor. This fixes a build problem on x86 -- reported by the
> auto-builder -- as a side effect.
I've tested this on buildbot and it fix the build. I encourage you to
push it!
Tested-By: Guinevere Larsen <guinevere@redhat.com>
On 1/17/25 4:14 PM, Guinevere Larsen wrote:
> On 1/17/25 4:04 PM, Tom Tromey wrote:
>> This simplifies get_frame_unwind_table, changing it to use the
>> registry 'emplace' method and to pass the initialization iterators to
>> the constructor. This fixes a build problem on x86 -- reported by the
>> auto-builder -- as a side effect.
>
> I've tested this on buildbot and it fix the build. I encourage you to
> push it!
>
> Tested-By: Guinevere Larsen <guinevere@redhat.com>
>
Oh, seems like I replied this too early. Build fails on debian-armhf,
see log here:
https://builder.sourceware.org/buildbot/#/builders/72/builds/5614/steps/4/logs/stdio
>> Tested-By: Guinevere Larsen <guinevere@redhat.com>
Guinevere> Oh, seems like I replied this too early. Build fails on debian-armhf,
Guinevere> see log here:
Guinevere> https://builder.sourceware.org/buildbot/#/builders/72/builds/5614/steps/4/logs/stdio
Ah well. I already pushed it.
My only theory for what's going wrong there is compiler bug.
I think the code looks ok.
Tom
On 1/17/25 22:27, Tom Tromey wrote:
>>> Tested-By: Guinevere Larsen <guinevere@redhat.com>
>
> Guinevere> Oh, seems like I replied this too early. Build fails on debian-armhf,
> Guinevere> see log here:
> Guinevere> https://builder.sourceware.org/buildbot/#/builders/72/builds/5614/steps/4/logs/stdio
>
> Ah well. I already pushed it.
>
> My only theory for what's going wrong there is compiler bug.
> I think the code looks ok.
FWIW, I've build gdb with gcc 12.4.0 on debian testing, and didn't
manage to reproduce this problem.
Thanks,
- Tom
@@ -73,15 +73,10 @@ static std::vector<const frame_unwind *> &
get_frame_unwind_table (struct gdbarch *gdbarch)
{
std::vector<const frame_unwind *> *table = frame_unwind_data.get (gdbarch);
- if (table != nullptr)
- return *table;
-
- table = new std::vector<const frame_unwind *>;
- table->insert (table->begin (), standard_unwinders.begin (),
- standard_unwinders.end ());
-
- frame_unwind_data.set (gdbarch, table);
-
+ if (table == nullptr)
+ table = frame_unwind_data.emplace (gdbarch,
+ standard_unwinders.begin (),
+ standard_unwinders.end ());
return *table;
}