2003-10-17 Andrew Cagney <cagney@redhat.com>

* target.h (struct target_ops): Add "to_read_partial" and
	"to_write_partial", delete "to_query".
	(target_read_partial, target_write_partial): Declare.
	(target_read, target_write): Declare.
	(target_query): Delete macro.
	* target.c (target_read_partial): New function.
	(target_write_partial, target_read, target_write): New function.
	(update_current_target): Delete inheritance of "to_query".  Add
	comments about "to_read_partial" and "to_write_partial".
	(debug_to_partial_read, debug_to_partial_write): New functions.
	(debug_to_query): Delete function.
	(setup_target_debug): Set "to_read_partial" and "to_write_partial"
	instead of "to_query".
	* remote.c (remote_read_partial): Replace "remote_query".
	(init_remote_ops): Set "to_read_partial" instead of "to_query".
	(init_remote_async_ops): Ditto.
	* kod.c (gdb_kod_query): Make "bufsize" a LONGEST.  Use
	"target_read_partial" instead of "target_query".
	* avr-tdep.c (avr_io_reg_read_command): Make "bufsize" a LONGEST.
	Use "target_read_partial" instead of "target_query".
This commit is contained in:
Andrew Cagney 2003-10-17 18:24:49 +00:00
parent 4b71bec021
commit 1e3ff5ad7f
6 changed files with 280 additions and 70 deletions

View file

@ -87,11 +87,13 @@ gdb_kod_display (char *arg)
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 (&current_target, TARGET_OBJECT_KOD,
NULL, NULL, 0, 0);
if (bufsiz < 0)
{
strcpy (result,
"ERR: Kernel Object Display not supported by current target\n");
@ -99,7 +101,6 @@ gdb_kod_query (char *arg, char *result, int *maxsiz)
}
/* 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)
@ -119,7 +120,8 @@ gdb_kod_query (char *arg, char *result, int *maxsiz)
error ("kod: query argument too long");
/* Send actual request. */
if (target_query ((int) 'K', arg, result, &bufsiz))
if (target_read_partial (&current_target, TARGET_OBJECT_KOD,
arg, result, 0, bufsiz) < 0)
strcpy (result, "ERR: remote query failed");
}