* [PATCH] Simplify get_frame_unwind_table
@ 2025-01-17 19:04 Tom Tromey
2025-01-17 19:14 ` Guinevere Larsen
0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2025-01-17 19:04 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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(-)
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index fab9b3c981a..33b23f91feb 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -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;
}
--
2.47.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Simplify get_frame_unwind_table
2025-01-17 19:04 [PATCH] Simplify get_frame_unwind_table Tom Tromey
@ 2025-01-17 19:14 ` Guinevere Larsen
2025-01-17 20:33 ` Guinevere Larsen
0 siblings, 1 reply; 5+ messages in thread
From: Guinevere Larsen @ 2025-01-17 19:14 UTC (permalink / raw)
To: Tom Tromey, gdb-patches
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>
--
Cheers,
Guinevere Larsen
She/Her/Hers
> ---
> gdb/frame-unwind.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
> index fab9b3c981a..33b23f91feb 100644
> --- a/gdb/frame-unwind.c
> +++ b/gdb/frame-unwind.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Simplify get_frame_unwind_table
2025-01-17 19:14 ` Guinevere Larsen
@ 2025-01-17 20:33 ` Guinevere Larsen
2025-01-17 21:27 ` Tom Tromey
0 siblings, 1 reply; 5+ messages in thread
From: Guinevere Larsen @ 2025-01-17 20:33 UTC (permalink / raw)
To: Tom Tromey, gdb-patches
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
--
Cheers,
Guinevere Larsen
She/Her/Hers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Simplify get_frame_unwind_table
2025-01-17 20:33 ` Guinevere Larsen
@ 2025-01-17 21:27 ` Tom Tromey
2025-01-18 15:25 ` Tom de Vries
0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2025-01-17 21:27 UTC (permalink / raw)
To: Guinevere Larsen; +Cc: Tom Tromey, gdb-patches
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Simplify get_frame_unwind_table
2025-01-17 21:27 ` Tom Tromey
@ 2025-01-18 15:25 ` Tom de Vries
0 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2025-01-18 15:25 UTC (permalink / raw)
To: Tom Tromey, Guinevere Larsen; +Cc: gdb-patches
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-01-18 15:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-17 19:04 [PATCH] Simplify get_frame_unwind_table Tom Tromey
2025-01-17 19:14 ` Guinevere Larsen
2025-01-17 20:33 ` Guinevere Larsen
2025-01-17 21:27 ` Tom Tromey
2025-01-18 15:25 ` Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox