/* Remote debugging interface for AMD 29k interfaced via UDI, for GDB.
- Copyright 1990, 1992, 1995, 2000 Free Software Foundation, Inc.
+ Copyright 1990, 1992, 1995, 2000, 2001 Free Software Foundation, Inc.
Written by Daniel Mann. Contributed by AMD.
This file is part of GDB.
extern int stop_soon_quietly; /* for wait_for_inferior */
extern struct value *call_function_by_hand ();
-static void udi_resume PARAMS ((int pid, int step, enum target_signal sig));
-static void udi_fetch_registers PARAMS ((int regno));
-static void udi_load PARAMS ((char *args, int from_tty));
-static void fetch_register PARAMS ((int regno));
-static void udi_store_registers PARAMS ((int regno));
-static int store_register PARAMS ((int regno));
-static int regnum_to_srnum PARAMS ((int regno));
-static void udi_close PARAMS ((int quitting));
-static CPUSpace udi_memory_space PARAMS ((CORE_ADDR addr));
-static int udi_write_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
- int len));
-static int udi_read_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
- int len));
-static void download PARAMS ((char *load_arg_string, int from_tty));
+static void udi_resume (int pid, int step, enum target_signal sig);
+static void udi_fetch_registers (int regno);
+static void udi_load (char *args, int from_tty);
+static void fetch_register (int regno);
+static void udi_store_registers (int regno);
+static int store_register (int regno);
+static int regnum_to_srnum (int regno);
+static void udi_close (int quitting);
+static CPUSpace udi_memory_space (CORE_ADDR addr);
+static int udi_write_inferior_memory (CORE_ADDR memaddr, char *myaddr,
+ int len);
+static int udi_read_inferior_memory (CORE_ADDR memaddr, char *myaddr,
+ int len);
+static void download (char *load_arg_string, int from_tty);
char CoffFileName[100] = "";
#define FREEZE_MODE (read_register(CPS_REGNUM) & 0x400)
user types "run" after having attached. */
static void
-udi_create_inferior (execfile, args, env)
- char *execfile;
- char *args;
- char **env;
+udi_create_inferior (char *execfile, char *args, char **env)
{
char *args1;
if (execfile)
{
if (prog_name != NULL)
- free (prog_name);
+ xfree (prog_name);
prog_name = savestring (execfile, strlen (execfile));
}
else if (entry.Offset)
}
static void
-udi_mourn ()
+udi_mourn (void)
{
#if 0
/* Requiring "target udi" each time you run is a major pain. I suspect
/* XXX - need cleanups for udiconnect for various failures!!! */
static void
-udi_open (name, from_tty)
- char *name;
- int from_tty;
+udi_open (char *name, int from_tty)
{
unsigned int prl;
char *p;
bkpt_table[cnt].Type = 0;
if (udi_config_id)
- free (udi_config_id);
+ xfree (udi_config_id);
if (!name)
error ("Usage: target udi config_id, where config_id appears in udi_soc file");
Use this when you want to detach and do something else
with your gdb. */
static void
-udi_close (quitting) /*FIXME: how is quitting used */
- int quitting;
+udi_close ( /*FIXME: how is quitting used */
+ int quitting)
{
if (udi_session_id < 0)
return;
* Upon exiting the process's execution is stopped.
*/
static void
-udi_attach (args, from_tty)
- char *args;
- int from_tty;
+udi_attach (char *args, int from_tty)
{
UDIResource From;
UDIInt32 PC_adds;
Use this when you want to detach and do something else
with your gdb. Leave remote process running (with no breakpoints set). */
static void
-udi_detach (args, from_tty)
- char *args;
- int from_tty;
+udi_detach (char *args, int from_tty)
{
remove_breakpoints (); /* Just in case there were any left in */
** Tell the remote machine to resume. */
static void
-udi_resume (pid, step, sig)
- int pid, step;
- enum target_signal sig;
+udi_resume (int pid, int step, enum target_signal sig)
{
UDIError tip_error;
UDIUInt32 Steps = 1;
storing status in STATUS just as `wait' would. */
static int
-udi_wait (pid, status)
- int pid;
- struct target_waitstatus *status;
+udi_wait (int pid, struct target_waitstatus *status)
{
UDIInt32 MaxTime;
UDIPId PId;
#if 0
/* Handy for debugging */
-udi_pc ()
+udi_pc (void)
{
UDIResource From;
UDIUInt32 *To;
* If regno==-1 then read all the registers.
*/
static void
-udi_fetch_registers (regno)
- int regno;
+udi_fetch_registers (int regno)
{
UDIResource From;
UDIUInt32 *To;
*/
static void
-udi_store_registers (regno)
- int regno;
+udi_store_registers (int regno)
{
UDIUInt32 *From;
UDIResource To;
debugged. */
static void
-udi_prepare_to_store ()
+udi_prepare_to_store (void)
{
/* Do nothing, since we can store individual regs */
}
/********************************************************** TRANSLATE_ADDR */
static CORE_ADDR
-translate_addr (addr)
- CORE_ADDR addr;
+translate_addr (CORE_ADDR addr)
{
#if defined(ULTRA3) && defined(KERNEL_DEBUGGING)
/* Check for a virtual address in the kernel */
/************************************************* UDI_XFER_INFERIOR_MEMORY */
/* FIXME! Merge these two. */
static int
-udi_xfer_inferior_memory (memaddr, myaddr, len, write)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
- int write;
+udi_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+ struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+ struct target_ops *target ATTRIBUTE_UNUSED)
{
memaddr = translate_addr (memaddr);
/********************************************************** UDI_FILES_INFO */
static void
-udi_files_info ()
+udi_files_info (struct target_ops *target)
{
printf_unfiltered ("\tAttached to UDI socket to %s", udi_config_id);
if (prog_name != NULL)
/**************************************************** UDI_INSERT_BREAKPOINT */
static int
-udi_insert_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+udi_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int cnt;
UDIError err;
/**************************************************** UDI_REMOVE_BREAKPOINT */
static int
-udi_remove_breakpoint (addr, contents_cache)
- CORE_ADDR addr;
- char *contents_cache;
+udi_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int cnt;
UDIError err;
}
static void
-udi_kill (arg, from_tty)
- char *arg;
- int from_tty;
+udi_kill (void)
{
#if 0
*/
static void
-download (load_arg_string, from_tty)
- char *load_arg_string;
- int from_tty;
+download (char *load_arg_string, int from_tty)
{
#define DEFAULT_MEM_STACK_SIZE 0x6000
#define DEFAULT_REG_STACK_SIZE 0x2000
error ("Must specify at least a file name with the load command");
filename = tilde_expand (filename);
- make_cleanup (free, filename);
+ make_cleanup (xfree, filename);
while (token = strtok (NULL, " \t"))
{
/* Function to download an image into the remote target. */
static void
-udi_load (args, from_tty)
- char *args;
- int from_tty;
+udi_load (char *args, int from_tty)
{
download (args, from_tty);
** Copy LEN bytes of data from debugger memory at MYADDR
to inferior's memory at MEMADDR. Returns number of bytes written. */
static int
-udi_write_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+udi_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
int nwritten = 0;
UDIUInt32 *From;
** Read LEN bytes from inferior memory at MEMADDR. Put the result
at debugger address MYADDR. Returns number of bytes read. */
static int
-udi_read_inferior_memory (memaddr, myaddr, len)
- CORE_ADDR memaddr;
- char *myaddr;
- int len;
+udi_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
int nread = 0;
UDIResource From;
/********************************************************************* WARNING
*/
-udi_warning (num)
- int num;
+udi_warning (int num)
{
error ("ERROR while loading program into remote TIP: $d\n", num);
}
* Returns 0/-1 on success/failure.
*/
static void
-fetch_register (regno)
- int regno;
+fetch_register (int regno)
{
UDIResource From;
UDIUInt32 To;
* Returns 0/-1 on success/failure.
*/
static int
-store_register (regno)
- int regno;
+store_register (int regno)
{
int result;
UDIUInt32 From;
* Convert a gdb special register number to a 29000 special register number.
*/
static int
-regnum_to_srnum (regno)
- int regno;
+regnum_to_srnum (int regno)
{
switch (regno)
{
* FIXME: Doesn't know anything about I_CACHE/D_CACHE.
*/
static CPUSpace
-udi_memory_space (addr)
- CORE_ADDR addr;
+udi_memory_space (CORE_ADDR addr)
{
UDIUInt32 tstart = IMemStart;
UDIUInt32 tend = tstart + IMemSize;
*/
void
-convert16 ()
+convert16 (void)
{;
}
void
-convert32 ()
+convert32 (void)
{;
}
struct ui_file *EchoFile = 0; /* used for debugging */
int QuietMode = 0; /* used for debugging */
\f
#ifdef NO_HIF_SUPPORT
-service_HIF (msg)
- union msg_t *msg;
+service_HIF (union msg_t *msg)
{
return (0); /* Emulate a failure */
}
};
void
-_initialize_remote_udi ()
+_initialize_remote_udi (void)
{
init_udi_ops ();
add_target (&udi_ops);