-/*
- - Remote debugging interface for Am290*0 running MiniMON monitor, for GDB.
- This is like remote.c but expects MiniMON to be running on the Am29000
- target hardware.
- - Originally written by Daniel Mann at AMD for gdb 3.91.6.
- - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
- file to gdb 3.95. I was unable to get this working on sun3os4
- with termio, only with sgtty. Because we are only attempting to
- use this module to debug our kernel, which is already loaded when
- gdb is started up, I did not code up the file downloading facilities.
- As a result this module has only the stubs to download files.
- You should get tagged at compile time if you need to make any
- changes/additions.
-*- Daniel Mann at AMD took the 3.95 adaptions above and replaced
- MiniMON interface with UDI-p interface.
-
- Copyright (C) 1990 Free Software Foundation, Inc.
+/* Remote debugging interface for AMD 29k interfaced via UDI, for GDB.
+ Copyright 1990, 1992 Free Software Foundation, Inc.
+ Written by Daniel Mann. Contributed by AMD.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* This is like remote.c but uses the Universal Debug Interface (UDI) to
+ talk to the target hardware (or simulator). UDI is a TCP/IP based
+ protocol; for hardware that doesn't run TCP, an interface adapter
+ daemon talks UDI on one side, and talks to the hardware (typically
+ over a serial port) on the other side.
-#include <stdio.h>
+ - Originally written by Daniel Mann at AMD for MiniMON and gdb 3.91.6.
+ - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
+ file to gdb 3.95. I was unable to get this working on sun3os4
+ with termio, only with sgtty. Because we are only attempting to
+ use this module to debug our kernel, which is already loaded when
+ gdb is started up, I did not code up the file downloading facilities.
+ As a result this module has only the stubs to download files.
+ You should get tagged at compile time if you need to make any
+ changes/additions.
+ - Daniel Mann at AMD took the 3.95 adaptions above and replaced
+ MiniMON interface with UDI-p interface. */
+
#include "defs.h"
#include "inferior.h"
#include "wait.h"
#include "29k-share/udi/udiproc.h"
/* access the register store directly, without going through
- the normal handler functions. This avoids an extra data copy
-*/
-
-/* #define DEBUG 1 /* */
-#ifdef DEBUG
-# define DENTER(NAME) (printf("Entering %s\n",NAME), fflush(stdout))
-# define DEXIT(NAME) (printf("Exiting %s\n",NAME), fflush(stdout))
-#else
-# define DENTER(NAME)
-# define DEXIT(NAME)
-#endif
+ the normal handler functions. This avoids an extra data copy. */
-
-extern char register_valid[];
extern int stop_soon_quietly; /* for wait_for_inferior */
extern struct value *call_function_by_hand();
static void udi_resume();
char *args;
char **env;
{
- DENTER("udi_create_inferior()");
if (execfile)
{ if (prog_name != NULL)
udi_load(args, 0);
#endif /* !ULTRA3 */
- /* We will get a task spawn event immediately. */
-#ifdef NOTDEF /* start_remote() now does a wait without a resume
- so don't use it*/
- start_remote ();
-#else
init_wait_for_inferior ();
clear_proceed_status ();
proceed(-1,-1,0);
-#endif
- DEXIT("udi_create_inferior()");
}
/******************************************************* UDI_MOURN_INFERIOR */
static void
udi_mourn()
{
- DENTER("udi_mourn()");
pop_target (); /* Pop back to no-child state */
generic_mourn_inferior ();
- DEXIT("udi_mourn()");
}
/******************************************************************** UDI_OPEN
UDIPId PId;
UDIUInt32 TIPId, TargetId, DFEId, DFE, TIP, DFEIPCId, TIPIPCId;
- DENTER("udi_open()");
-
target_preopen(from_tty);
/* Find the first whitespace character, it separates udi_config_id
int quitting;
{
int Terminate = -1;
- DENTER("udi_close()");
if (udi_session_id < 0)
error ("Can't close udi connection: not debugging remotely.");
#endif
printf_filtered (" Ending remote debugging\n");
-
- DEXIT("udi_close()");
}
/**************************************************************** UDI_ATACH */
UDISizeT Size = 4;
UDICount CountDone;
UDIBool HostEndian = 0;
- DENTER("udi_attach()");
if (udi_session_id < 0)
- printf ("UDI connection not opened yet, use the 'target udi' command.\n");
+ error ("UDI connection not opened yet, use the 'target udi' command.\n");
if (from_tty)
printf ("Attaching to remote program %s...\n", prog_name);
- mark_breakpoints_out ();
UDIStop();
From.Space = 11;
From.Offset = UDI29KSpecialRegs;
if(UDIRead(From, &PC_adds, Count, Size, &CountDone, HostEndian))
error ("UDIRead failed in udi_attach");
printf ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds);
-
- DEXIT("udi_attach()");
}
/************************************************************* UDI_DETACH */
/* Terminate the open connection to the TIP process.
char *args;
int from_tty;
{
- DENTER("udi_dettach()");
remove_breakpoints(); /* Just in case there were any left in */
if(UDIDisconnect(udi_session_id))
error ("UDIDisconnect() failed in udi_detach");
pop_target(); /* calls udi_close to do the real work */
if (from_tty)
printf ("Ending remote debugging\n");
- DEXIT("udi_dettach()");
}
UDIUInt32 Steps = 1;
UDIStepType StepType = UDIStepNatural;
UDIRange Range;
- DENTER("udi_resume()");
+
if (step) /* step 1 instruction */
{ tip_error = tip_error = UDIStep(Steps, StepType, Range);
if(tip_error)fprintf(stderr, "UDIStep() error = %d\n", tip_error);
{ if(UDIExecute())
error ("UDIExecute() failed in udi_resume");
}
-
- DEXIT("udi_resume()");
}
/******************************************************************** UDI_WAIT
int old_immediate_quit = immediate_quit;
int i;
- DENTER("udi_wait()");
WSETEXIT ((*status), 0);
/* wait for message to arrive. It should be:
timeout = old_timeout; /* Restore original timeout value */
immediate_quit = old_immediate_quit;
- DEXIT("udi_wait()");
return 0;
}
{
char buf[4];
- DENTER("udi_kill()");
#if defined(ULTRA3) && defined(KERNEL_DEBUGGING)
/* We don't ever kill the kernel */
if (from_tty) {
}
pop_target();
#endif
- DEXIT("udi_kill()");
}
UDICount CountDone = 0;
UDIBool HostEndian = 0;
-
- /* DENTER("udi_write_inferior_memory()"); */
To.Space = udi_memory_space(memaddr);
From = (UDIUInt32*)myaddr;
From += CountDone;
}
}
- /* DEXIT("udi_write_inferior_memory()"); */
return(nwritten);
}
UDICount CountDone = 0;
UDIBool HostEndian = 0;
-
- /* DENTER("udi_read_inferior_memory()"); */
From.Space = udi_memory_space(memaddr);
To = (UDIUInt32*)myaddr;
UDICount CountDone;
UDIBool HostEndian = 0;
- DENTER("store_register()");
From = read_register (regno); /* get data value */
if (regno == GR1_REGNUM)
result = UDIWrite(&From, To, Count, Size, &CountDone, HostEndian);
}
- DEXIT("store_register()");
if(result)
{ result = -1;
error("UDIWrite() failed in store_registers");
*/
static struct target_ops udi_ops = {
"udi", "Remote UDI connected TIP",
- "Remote debug an Am290*0 using socket connection to TIP process ",
+ "Remote debug an AMD 29k using UDI socket connection to TIP process",
udi_open, udi_close,
udi_attach, udi_detach, udi_resume, udi_wait,
udi_fetch_registers, udi_store_registers,
- udi_prepare_to_store, 0, 0, /* conv_to, conv_from */
+ udi_prepare_to_store,
udi_xfer_inferior_memory,
udi_files_info,
udi_insert_breakpoint, udi_remove_breakpoint, /* Breakpoints */
0, /* lookup_symbol */
udi_create_inferior, /* create_inferior */
udi_mourn, /* mourn_inferior FIXME */
+ 0, /* can_run */
process_stratum, 0, /* next */
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */
0, 0, /* Section pointers */