From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] python: Make gdb.execute("show commands") work (PR 23669)
Date: Mon, 17 Sep 2018 06:37:00 -0000 [thread overview]
Message-ID: <87zhwgmxy1.fsf@tromey.com> (raw)
In-Reply-To: <20180917012350.10194-1-simon.marchi@polymtl.ca> (Simon Marchi's message of "Sun, 16 Sep 2018 21:23:50 -0400")
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Simon> Since commit
Simon> 56bcdbea2bed ("Let gdb.execute handle multi-line commands")
Simon> trying to use a command like gdb.execute("show commands") in Python
Simon> fails. GDB ends up trying to run the "commands" command.
Simon> The reason is that GDB gets confused with the special "commands"
Simon> command. In process_next_line, the lookup_cmd_1 function returns the
Simon> cmd_list_element representing the "commands" sub-command of "show".
Simon> Lower, we check the cmd_list_element to see if it matches various
Simon> control commands by name, including the "commands" command. This is
Simon> where we wrongfully conclude that the executed command must be
Simon> "commands", when in reality it was "show commands".
Simon> The fix proposed in this patch removes the comparisons by name, instead
Simon> comparing the cmd_list_element object by pointer with the objects
Simon> created at initialization time.
Thanks for doing this. I think getting rid of command_name_equals is a
nice cleanup. The patch looks good to me.
Tom
next prev parent reply other threads:[~2018-09-17 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 1:24 Simon Marchi
2018-09-17 6:37 ` Tom Tromey [this message]
2018-09-17 12:28 ` Simon Marchi
2018-09-17 17:02 ` Joel Brobecker
2018-09-17 18:18 ` Simon Marchi
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=87zhwgmxy1.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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