From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: Hannes Domani <ssbssa@yahoo.de>, Tom Tromey <tom@tromey.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/4] Return true in TuiWindow.is_valid only if TUI is enabled
Date: Sat, 06 Feb 2021 12:38:56 -0700 [thread overview]
Message-ID: <87ft29x9yn.fsf@tromey.com> (raw)
In-Reply-To: <20210123175551.GD265215@embecosm.com> (Andrew Burgess's message of "Sat, 23 Jan 2021 17:55:51 +0000")
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
Andrew> gdb/ChangeLog:
Andrew> * python/py-tui.c (gdbpy_tui_window) <is_valid>: New member
Andrew> function.
Andrew> (REQUIRE_WINDOW): Call is_valid member function.
Andrew> (REQUIRE_WINDOW_FOR_SETTER): New define.
Andrew> (gdbpy_tui_is_valid): Call is_valid member function.
Andrew> (gdbpy_tui_set_title): Remove duplicate error checking, call
Andrew> REQUIRE_WINDOW_FOR_SETTER instead.
Andrew> * tui/tui-data.h (struct tui_win_info) <is_visible>: Check
Andrew> tui_active too.
Andrew> * tui/tui-layout.c (tui_apply_current_layout): Add an assert.
Andrew> * tui/tui.c (tui_enable): Move setting of tui_active earlier in
Andrew> the function.
Hi. Thanks for the patch.
I really thought I had covered this scenario somehow, but I guess not!
Oops, sorry about that. Maybe I was thinking that tui disable would
destory the windows. Or maybe I planned to do that and then never did.
I don't recall any more.
Andrew> - if (win->window == nullptr)
Andrew> - {
Andrew> - PyErr_Format (PyExc_RuntimeError, _("TUI window is invalid."));
Andrew> - return -1;
Andrew> - }
Andrew> -
Andrew> - if (win->window == nullptr)
Andrew> - {
Andrew> - PyErr_Format (PyExc_TypeError, _("Cannot delete \"title\" attribute."));
Andrew> - return -1;
Andrew> - }
This second 'if' has the same condition. It's actually a latent bug, as
the code should read:
if (newvalue == nullptr)
... and then the "if" should remain, rather than being deleted by this
patch.
I think the patch is ok with this tweak.
Tom
next prev parent reply other threads:[~2021-02-06 19:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201229170227.821-1-ssbssa.ref@yahoo.de>
2020-12-29 17:02 ` [PATCH 1/4] Fix wrong method name Hannes Domani
2020-12-29 17:02 ` [PATCH 2/4] Return true in TuiWindow.is_valid only if TUI is enabled Hannes Domani
2020-12-31 4:24 ` Simon Marchi
2021-01-15 16:48 ` Andrew Burgess
2021-01-15 17:22 ` Hannes Domani
2021-01-17 11:31 ` Andrew Burgess
2021-01-17 13:19 ` Hannes Domani
2021-01-18 10:30 ` Andrew Burgess
2021-01-18 11:29 ` Hannes Domani
2021-01-23 17:54 ` Andrew Burgess
2021-01-23 17:55 ` Andrew Burgess
2021-01-24 12:33 ` Hannes Domani
2021-02-06 19:38 ` Tom Tromey [this message]
2021-02-08 11:58 ` Andrew Burgess
2021-02-08 19:19 ` Tom Tromey
2021-01-18 17:19 ` Eli Zaretskii
2020-12-29 17:02 ` [PATCH 3/4] Add optional styled argument to gdb.execute Hannes Domani
2020-12-29 17:19 ` Eli Zaretskii
2020-12-31 4:28 ` Simon Marchi
2020-12-29 17:02 ` [PATCH 4/4] Fix raw-frame-arguments in combination with frame-filters Hannes Domani
2020-12-31 4:53 ` Simon Marchi
2020-12-31 14:01 ` Hannes Domani
2021-01-31 7:13 ` Joel Brobecker
2020-12-29 17:18 ` [PATCH 1/4] Fix wrong method name Eli Zaretskii
2020-12-29 17:39 ` Hannes Domani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ft29x9yn.fsf@tromey.com \
--to=tom@tromey.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=ssbssa@yahoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).