[PATCH] Fix PR gdb/17035: "show user" doesn't list user-defined commands that have empty bodies.

Gabriel Krisman Bertazi gabriel@krisman.be
Thu Sep 4 19:26:00 GMT 2014


Pedro Alves <palves@redhat.com> writes:

> Yeah.  Close now.  Only nits on the details.

Guess I fixed all the things you pointed out.

> cli_user_command_p (struct cmd_list_element *cmd)

I implemented that as well.  Thanks.

Updated patch below. :)

gdb/
2014-08-20  Gabriel Krisman Bertazi  <gabriel@krisman.be>

	* cli/cli-cmds.c (show_user): Use cli_user_command_p to
	  decide whether we display the command on "show user".
	* cli/cli-script.c (show_user_1): Only verify cmdlines after
	  printing command name.
	* cli/cli-decode.h (cli_user_command_p): Declare new function.
	* cli/cli-decode.c (cli_user_command_p): Create helper function
	  to verify whether cmd_list_element is a user-defined command.

gdb/testsuite/
2014-08-20  Gabriel Krisman Bertazi  <gabriel@krisman.be>

	* gdb.base/commands.exp: Add tests to verify user-defined
	  commands with empty bodies.
	* gdb.python/py-cmd.exp: Test that we don't show user-defined
	  python commands in `show user command`.
	* gdb.python/scm-cmd.exp: Test that we don't show user-defined
	  scheme commands in `show user command`.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: show_user_v3.patch
Type: text/x-patch
Size: 5744 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20140904/e3b6b223/attachment.bin>
-------------- next part --------------

-- 
Gabriel Krisman Bertazi


More information about the Gdb-patches mailing list