public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/python: Fix --disable-tui build
@ 2023-02-24 12:06 Kévin Le Gouguec
  2023-03-06 16:47 ` Kévin Le Gouguec
  0 siblings, 1 reply; 2+ messages in thread
From: Kévin Le Gouguec @ 2023-02-24 12:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: aburgess, Kévin Le Gouguec

As of 2023-02-13 "gdb/python: deallocate tui window factories at Python
shut down" (9ae4519da90), a TUI-less build fails with:

$src/gdb/python/py-tui.c: In function ‘void gdbpy_finalize_tui()’:
$src/gdb/python/py-tui.c:621:3: error: ‘gdbpy_tui_window_maker’ has not been declared
  621 |   gdbpy_tui_window_maker::invalidate_all ();
      |   ^~~~~~~~~~~~~~~~~~~~~~

Since gdbpy_tui_window_maker is only defined under #ifdef TUI, add an
#ifdef guard in gdbpy_finalize_tui as well.
---

Assuming I have not missed something, this might have been an "obvious
fix"?  Since no-one has complained about this so far, I figure it does
not hurt to post the patch first before pushing.

 gdb/python/py-tui.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
index 9ce76659052..92fa0591e5c 100644
--- a/gdb/python/py-tui.c
+++ b/gdb/python/py-tui.c
@@ -618,5 +618,7 @@ gdbpy_initialize_tui ()
 void
 gdbpy_finalize_tui ()
 {
+#ifdef TUI
   gdbpy_tui_window_maker::invalidate_all ();
+#endif	/* TUI */
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdb/python: Fix --disable-tui build
  2023-02-24 12:06 [PATCH] gdb/python: Fix --disable-tui build Kévin Le Gouguec
@ 2023-03-06 16:47 ` Kévin Le Gouguec
  0 siblings, 0 replies; 2+ messages in thread
From: Kévin Le Gouguec @ 2023-03-06 16:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: aburgess, tromey

Kévin Le Gouguec <legouguec@adacore.com> writes:

> Assuming I have not missed something, this might have been an "obvious
> fix"?  Since no-one has complained about this so far, I figure it does
> not hurt to post the patch first before pushing.

I pushed this today (1d6653fd3f4), after confirming the obviousness with
Tom out-of-band.

>  gdb/python/py-tui.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
> index 9ce76659052..92fa0591e5c 100644
> --- a/gdb/python/py-tui.c
> +++ b/gdb/python/py-tui.c
> @@ -618,5 +618,7 @@ gdbpy_initialize_tui ()
>  void
>  gdbpy_finalize_tui ()
>  {
> +#ifdef TUI
>    gdbpy_tui_window_maker::invalidate_all ();
> +#endif	/* TUI */
>  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-06 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24 12:06 [PATCH] gdb/python: Fix --disable-tui build Kévin Le Gouguec
2023-03-06 16:47 ` Kévin Le Gouguec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).