* sparc64-tdep.h (sparc64_regnum): Fix comment.
[deliverable/binutils-gdb.git] / gdb / kod.c
index 2641c38e0094b11cadfb5a42eae0f2be020f3cf5..8f565bb8c36ed7599fe031d6c65a7061504e6ab6 100644 (file)
--- a/gdb/kod.c
+++ b/gdb/kod.c
@@ -132,7 +132,16 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
 {
   char *p;
 
-  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.  */
@@ -145,7 +154,6 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
       delete_cmd (old_operating_system, &infolist);
       xfree (old_operating_system);
     }
-  old_operating_system = xstrdup (operating_system);
 
   if (! operating_system || ! *operating_system)
     {
@@ -160,6 +168,8 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
     {
       char *kodlib;
 
+      old_operating_system = xstrdup (operating_system);
+
       load_kod_library (operating_system);
 
       kodlib = (*gdb_kod_open) (gdb_kod_display, gdb_kod_query);
This page took 0.026103 seconds and 4 git commands to generate.