From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH] python: Make gdb.execute("show commands") work (PR 23669)
Date: Mon, 17 Sep 2018 12:28:00 -0000 [thread overview]
Message-ID: <3ccd2f0300762e59e5b160cf6a2f24dd@polymtl.ca> (raw)
In-Reply-To: <87zhwgmxy1.fsf@tromey.com>
On 2018-09-17 02:37, Tom Tromey wrote:
>>>>>> "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
Thanks I pushed it. I forgot to mention, but I intend to push this to
the 8.2 branch. Any concerns about this?
Simon
next prev parent reply other threads:[~2018-09-17 12:28 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
2018-09-17 12:28 ` Simon Marchi [this message]
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=3ccd2f0300762e59e5b160cf6a2f24dd@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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