/* Kernel Object Display facility for Cisco
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Written by Tom Tromey <tromey@cygnus.com>.
#include "defs.h"
#include "gdb_string.h"
+#include "kod.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
displaying output (presumably to the user) and the other for
querying the target. */
char *
-cisco_kod_open (char *arg,
- void (*display_func) (char *),
- void (*query_func) (char *, char *, int *))
+cisco_kod_open (kod_display_callback_ftype *display_func,
+ kod_query_callback_ftype *query_func)
{
char buffer[PBUFSIZ];
int bufsiz = PBUFSIZ;
}
if (buffer[i] == '\0')
- error ("Remote returned malformed packet\n");
+ error (_("Remote returned malformed packet."));
if (strcmp (&buffer[i], "0.0.0"))
- error ("Remote returned unknown stub version: %s\n", &buffer[i]);
+ error (_("Remote returned unknown stub version: %s."), &buffer[i]);
/* Return name, version, and description. I hope we have enough
space. */
- return (strdup ("gdbkodcisco v0.0.0 - Cisco Kernel Object Display"));
+ return (xstrdup ("gdbkodcisco v0.0.0 - Cisco Kernel Object Display"));
}
/* Close the connection. */
void
-cisco_kod_close ()
+cisco_kod_close (void)
{
}
/* Print a "bad packet" message. */
static void
-bad_packet ()
+bad_packet (void)
{
(*gdb_kod_display) ("Remote target returned malformed packet.\n");
}
int done = 0, i;
int fail = 0;
- char **sync_ids;
+ char **sync_ids = NULL;
int sync_len = 0;
int sync_next = 0;
char *prev_id = NULL;
buffer[off + 8] = '\0';
off += 9;
- if (sync_len == 0)
- sync_ids = (char **) xmalloc (count * sizeof (char *));
- else
- sync_ids = (char **) xrealloc (sync_ids,
- (sync_len + count) * sizeof (char *));
sync_len += count;
+ sync_ids = (char **) xrealloc (sync_ids, sync_len * sizeof (char *));
for (i = 0; i < count; ++i)
{
/* Free memory. */
for (i = 0; i < sync_next; ++i)
- free (sync_ids[i]);
- free (sync_ids);
+ xfree (sync_ids[i]);
+ xfree (sync_ids);
}