static void
gdb_kod_query (char *arg, char *result, int *maxsiz)
{
- int bufsiz = 0;
+ LONGEST bufsiz = 0;
- /* Check if current target has remote_query capabilities.
- If not, it does not have kod either. */
- if (! current_target.to_query)
+ /* Check if current target has remote_query capabilities. If not,
+ it does not have kod either. */
+ bufsiz = target_read_partial (¤t_target, TARGET_OBJECT_KOD,
+ NULL, NULL, 0, 0);
+ if (bufsiz < 0)
{
strcpy (result,
"ERR: Kernel Object Display not supported by current target\n");
}
/* Just get the maximum buffer size. */
- target_query ((int) 'K', 0, 0, &bufsiz);
/* Check if *we* were called just for getting the buffer size. */
if (*maxsiz == 0)
error ("kod: query argument too long");
/* Send actual request. */
- if (target_query ((int) 'K', arg, result, &bufsiz))
+ if (target_read_partial (¤t_target, TARGET_OBJECT_KOD,
+ arg, result, 0, bufsiz) < 0)
strcpy (result, "ERR: remote query failed");
}
{
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 deprecated_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. Unfortunately, for ``show'' commands cloned
+ from ``set'', this includes callbacks belonging to ``set''
+ commands. Making this worse, this only occures if
+ deprecated_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. */
"Set operating system",
&setlist);
set_cmd_sfunc (c, kod_set_os);
- add_show_from_set (c, &showlist);
+ deprecated_add_show_from_set (c, &showlist);
}