summaryrefslogtreecommitdiff
path: root/gdb/kod.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-03-18 02:26:32 +0000
committerAndrew Cagney <cagney@redhat.com>2002-03-18 02:26:32 +0000
commit9986998ef2616860c9e7b56c01a6a0d606623015 (patch)
treeaa0dd3439b807d139f50035ca75ba30002ae0d79 /gdb/kod.c
parent4d51f8300844d119b99c942e59285a8a16f3ab1f (diff)
downloadgdb-9986998ef2616860c9e7b56c01a6a0d606623015.tar.gz
* cli/cli-decode.c (cmd_type): New function.
* command.h (cmd_type): Declare. * infrun.c (set_schedlock_func): Call function cmd_type. * kod.c (kod_set_os): Call cmd_type. * cris-tdep.c (cris_version_update): Use function cmd_type. (cris_mode_update, cris_abi_update): Ditto.
Diffstat (limited to 'gdb/kod.c')
-rw-r--r--gdb/kod.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/kod.c b/gdb/kod.c
index 8e8a716914d..8f565bb8c36 100644
--- a/gdb/kod.c
+++ b/gdb/kod.c
@@ -132,13 +132,16 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
{
char *p;
- /* NOTE: cagney/2002-03-17: This function gets called by the command
- ``info set'' with COMMAND pointing to a show_cmd rather than a
- set command. This the test below is removed, a core dump results
- (think about what happens when OPERATING_SYSTEM is NULL). The
- wiered thing is that all other ``set'' handlers don't need this
- test. */
- if (command->type != set_cmd)
+ /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present.
+ Commands like ``info set'' call all the ``show'' command
+ callbacks. Unfortunatly, for ``show'' commands cloned from
+ ``set'', this includes callbacks belonging to ``set'' commands.
+ Making this worse, this only occures if add_show_from_set() is
+ called after add_cmd_sfunc() (BUG?). */
+
+ if (cmd_type (command) != set_cmd)
return;
/* If we had already had an open OS, close it. */