Thu Aug 7 19:40:52 1997 Geoffrey Noer <noer@cygnus.com>
Changes to OCD support to support wiggler box as well as target boxes: * ocd.c: change speed in init command to 0 from 80, add (temporary) logging commands to help debugging, (ocd_open): if "target ocd wiggler lpt" then use special ser-ocd.c serial interface which communicates with Wigglers.dll, otherwise do as we did before (ocd_get_packet): add OCD_LOG_FILE and OCD_SET_CONNECTION to switch of known commands of len 0 * ocd.h: add OCD_LOG_FILE * serial.c (serial_open): do serial_interface_lookup on ocd in the case of ocd * ser-ocd.c: add buffer to contain responses from sending a command to the Wigglers.dll. (ocd_readchar): return curr char from buffer and increment ptr (ocd_write): send buffer to Wigglers.dll, storing response in return buffer and initializing curr location ptr to start of buffer.
This commit is contained in:
parent
1154b47ab1
commit
9cf7f520c6
|
@ -320,6 +320,8 @@ ns32k-tdep.c
|
||||||
ns32km3-nat.c
|
ns32km3-nat.c
|
||||||
objfiles.c
|
objfiles.c
|
||||||
objfiles.h
|
objfiles.h
|
||||||
|
ocd.c
|
||||||
|
ocd.h
|
||||||
op50-rom.c
|
op50-rom.c
|
||||||
os9kread.c
|
os9kread.c
|
||||||
osf-share
|
osf-share
|
||||||
|
@ -328,6 +330,7 @@ parse.c
|
||||||
parser-defs.h
|
parser-defs.h
|
||||||
partial-stab.h
|
partial-stab.h
|
||||||
ppcbug-rom.c
|
ppcbug-rom.c
|
||||||
|
ppc-bdm.c
|
||||||
printcmd.c
|
printcmd.c
|
||||||
process_reply.defs
|
process_reply.defs
|
||||||
procfs.c
|
procfs.c
|
||||||
|
@ -359,7 +362,6 @@ remote-vx68.c
|
||||||
remote-vx960.c
|
remote-vx960.c
|
||||||
remote-vxmips.c
|
remote-vxmips.c
|
||||||
remote-vxsparc.c
|
remote-vxsparc.c
|
||||||
remote-wiggler.c
|
|
||||||
remote.c
|
remote.c
|
||||||
reply_mig_hack.awk
|
reply_mig_hack.awk
|
||||||
rs6000-nat.c
|
rs6000-nat.c
|
||||||
|
@ -374,6 +376,7 @@ scm-valprint.c
|
||||||
ser-e7kpc.c
|
ser-e7kpc.c
|
||||||
ser-go32.c
|
ser-go32.c
|
||||||
ser-mac.c
|
ser-mac.c
|
||||||
|
ser-ocd.c
|
||||||
ser-tcp.c
|
ser-tcp.c
|
||||||
ser-unix.c
|
ser-unix.c
|
||||||
serial.c
|
serial.c
|
||||||
|
@ -436,6 +439,7 @@ vax-tdep.c
|
||||||
vx-share
|
vx-share
|
||||||
w65-tdep.c
|
w65-tdep.c
|
||||||
w89k-rom.c
|
w89k-rom.c
|
||||||
|
wigglers.def
|
||||||
win32-nat.c
|
win32-nat.c
|
||||||
xcoffread.c
|
xcoffread.c
|
||||||
xcoffsolib.c
|
xcoffsolib.c
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
|
Thu Aug 7 19:40:52 1997 Geoffrey Noer <noer@cygnus.com>
|
||||||
|
|
||||||
|
Changes to OCD support to support wiggler box as well as
|
||||||
|
target boxes:
|
||||||
|
* ocd.c: change speed in init command to 0 from 80,
|
||||||
|
add (temporary) logging commands to help debugging,
|
||||||
|
(ocd_open): if "target ocd wiggler lpt" then use special
|
||||||
|
ser-ocd.c serial interface which communicates with Wigglers.dll,
|
||||||
|
otherwise do as we did before
|
||||||
|
(ocd_get_packet): add OCD_LOG_FILE and OCD_SET_CONNECTION to
|
||||||
|
switch of known commands of len 0
|
||||||
|
* ocd.h: add OCD_LOG_FILE
|
||||||
|
* serial.c (serial_open): do serial_interface_lookup on ocd
|
||||||
|
in the case of ocd
|
||||||
|
* ser-ocd.c: add buffer to contain responses from sending a
|
||||||
|
command to the Wigglers.dll.
|
||||||
|
(ocd_readchar): return curr char from buffer and increment ptr
|
||||||
|
(ocd_write): send buffer to Wigglers.dll, storing response in
|
||||||
|
return buffer and initializing curr location ptr to start of
|
||||||
|
buffer.
|
||||||
|
|
||||||
Thu Aug 7 14:08:23 1997 Martin M. Hunt <hunt@cygnus.com>
|
Thu Aug 7 14:08:23 1997 Martin M. Hunt <hunt@cygnus.com>
|
||||||
|
|
||||||
* configure.in: Change required Tix version to 4.1.8.0 .
|
* configure.in: Change required Tix version to 4.1.8.0 .
|
||||||
|
|
41
gdb/ocd.c
41
gdb/ocd.c
|
@ -168,7 +168,7 @@ ocd_start_remote (dummy)
|
||||||
p[0], p[1], (p[2] << 16) | p[3]);
|
p[0], p[1], (p[2] << 16) | p[3]);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
speed = 80; /* Divide clock by 4000 */
|
speed = 0; /* 80; /* Divide clock by 4000 */
|
||||||
|
|
||||||
buf[0] = OCD_INIT;
|
buf[0] = OCD_INIT;
|
||||||
buf[1] = speed >> 8;
|
buf[1] = speed >> 8;
|
||||||
|
@ -231,6 +231,11 @@ ocd_start_remote (dummy)
|
||||||
select_frame (get_current_frame (), 0);
|
select_frame (get_current_frame (), 0);
|
||||||
print_stack_frame (selected_frame, -1, 1);
|
print_stack_frame (selected_frame, -1, 1);
|
||||||
|
|
||||||
|
buf[0] = OCD_LOG_FILE;
|
||||||
|
buf[1] = 3; /* close existing WIGGLERS.LOG */
|
||||||
|
ocd_put_packet (buf, 2);
|
||||||
|
p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,6 +251,10 @@ ocd_open (name, from_tty, target_type, ops)
|
||||||
enum ocd_target_type target_type;
|
enum ocd_target_type target_type;
|
||||||
struct target_ops *ops;
|
struct target_ops *ops;
|
||||||
{
|
{
|
||||||
|
unsigned char buf[10], *p;
|
||||||
|
int status;
|
||||||
|
int pktlen;
|
||||||
|
|
||||||
if (name == 0)
|
if (name == 0)
|
||||||
error ("To open an OCD connection, you need to specify the\n\
|
error ("To open an OCD connection, you need to specify the\n\
|
||||||
device the OCD device is attached to (e.g. /dev/ttya).");
|
device the OCD device is attached to (e.g. /dev/ttya).");
|
||||||
|
@ -258,9 +267,28 @@ device the OCD device is attached to (e.g. /dev/ttya).");
|
||||||
|
|
||||||
ocd_dcache = dcache_init (ocd_read_bytes, ocd_write_bytes);
|
ocd_dcache = dcache_init (ocd_read_bytes, ocd_write_bytes);
|
||||||
|
|
||||||
ocd_desc = SERIAL_OPEN (name);
|
if (strncmp(name,"wiggler",7) == 0)
|
||||||
if (!ocd_desc)
|
{
|
||||||
perror_with_name (name);
|
ocd_desc = SERIAL_OPEN ("ocd");
|
||||||
|
if (!ocd_desc)
|
||||||
|
perror_with_name (name);
|
||||||
|
|
||||||
|
buf[0] = OCD_LOG_FILE;
|
||||||
|
buf[1] = 1; /* open new or overwrite existing WIGGLERS.LOG */
|
||||||
|
ocd_put_packet (buf, 2);
|
||||||
|
p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
|
||||||
|
|
||||||
|
buf[0] = OCD_SET_CONNECTION;
|
||||||
|
buf[1] = 0x01; /* atoi (name[11]); */
|
||||||
|
ocd_put_packet (buf, 2);
|
||||||
|
p = ocd_get_packet (buf[0], &pktlen, remote_timeout);
|
||||||
|
}
|
||||||
|
else /* not using Wigglers.dll */
|
||||||
|
{
|
||||||
|
ocd_desc = SERIAL_OPEN (name);
|
||||||
|
if (!ocd_desc)
|
||||||
|
perror_with_name (name);
|
||||||
|
}
|
||||||
|
|
||||||
if (baud_rate != -1)
|
if (baud_rate != -1)
|
||||||
{
|
{
|
||||||
|
@ -297,7 +325,8 @@ device the OCD device is attached to (e.g. /dev/ttya).");
|
||||||
In particular, if the user quits, be sure to discard it
|
In particular, if the user quits, be sure to discard it
|
||||||
(we'd be in an inconsistent state otherwise). */
|
(we'd be in an inconsistent state otherwise). */
|
||||||
if (!catch_errors (ocd_start_remote, (char *)target_type,
|
if (!catch_errors (ocd_start_remote, (char *)target_type,
|
||||||
"Couldn't establish connection to remote target\n", RETURN_MASK_ALL))
|
"Couldn't establish connection to remote target\n",
|
||||||
|
RETURN_MASK_ALL))
|
||||||
pop_target();
|
pop_target();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1082,6 +1111,8 @@ ocd_get_packet (cmd, lenp, timeout)
|
||||||
case OCD_PROGRAM_FLASH: /* Write flash memory */
|
case OCD_PROGRAM_FLASH: /* Write flash memory */
|
||||||
case OCD_EXIT_MON: /* Exit the flash programming monitor */
|
case OCD_EXIT_MON: /* Exit the flash programming monitor */
|
||||||
case OCD_ENTER_MON: /* Enter the flash programming monitor */
|
case OCD_ENTER_MON: /* Enter the flash programming monitor */
|
||||||
|
case OCD_LOG_FILE: /* Make Wigglers.dll save Wigglers.log */
|
||||||
|
case OCD_SET_CONNECTION: /* Set type of connection in Wigglers.dll */
|
||||||
len = 0;
|
len = 0;
|
||||||
break;
|
break;
|
||||||
case OCD_GET_VERSION: /* Get Version */
|
case OCD_GET_VERSION: /* Get Version */
|
||||||
|
|
|
@ -70,6 +70,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#define OCD_SET_STATUS 0x0a /* Set status */
|
#define OCD_SET_STATUS 0x0a /* Set status */
|
||||||
#define OCD_SET_CONNECTION 0xf0 /* Set connection (init Wigglers.dll) */
|
#define OCD_SET_CONNECTION 0xf0 /* Set connection (init Wigglers.dll) */
|
||||||
|
#define OCD_LOG_FILE 0xf1 /* Cmd to get Wigglers.dll to log cmds */
|
||||||
#define OCD_FLAG_STOP 0x0 /* Stop the target, enter BDM */
|
#define OCD_FLAG_STOP 0x0 /* Stop the target, enter BDM */
|
||||||
#define OCD_FLAG_START 0x01 /* Start the target at PC */
|
#define OCD_FLAG_START 0x01 /* Start the target at PC */
|
||||||
#define OCD_FLAG_RETURN_STATUS 0x04 /* Return async status */
|
#define OCD_FLAG_RETURN_STATUS 0x04 /* Return async status */
|
||||||
|
|
|
@ -54,8 +54,9 @@ ocd_raw (scb)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We need a buffer to store responses from the Wigglers.dll */
|
/* We need a buffer to store responses from the Wigglers.dll */
|
||||||
char * from_wigglers_buffer;
|
#define WIGGLER_BUFF_SIZE 512
|
||||||
char * bptr; /* curr spot in buffer */
|
unsigned char from_wiggler_buffer[WIGGLER_BUFF_SIZE];
|
||||||
|
unsigned char * wiggler_buffer_ptr; /* curr spot in buffer */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ocd_readremote ()
|
ocd_readremote ()
|
||||||
|
@ -67,7 +68,7 @@ ocd_readchar (scb, timeout)
|
||||||
serial_t scb;
|
serial_t scb;
|
||||||
int timeout;
|
int timeout;
|
||||||
{
|
{
|
||||||
|
return (int) *wiggler_buffer_ptr++; /* return curr char and increment ptr */
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ocd_ttystate {
|
struct ocd_ttystate {
|
||||||
|
@ -130,12 +131,11 @@ ocd_write (scb, str, len)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
ocd_readremote();
|
|
||||||
|
|
||||||
#ifdef __CYGWIN32__
|
#ifdef __CYGWIN32__
|
||||||
/* send packet to Wigglers.dll and store response so we can give it to
|
/* send packet to Wigglers.dll and store response so we can give it to
|
||||||
remote-wiggler.c when get_packet is run */
|
remote-wiggler.c when get_packet is run */
|
||||||
do_command (str, from_wigglers_buffer);
|
do_command (str, from_wiggler_buffer);
|
||||||
|
wiggler_buffer_ptr = from_wiggler_buffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -145,7 +145,6 @@ static void
|
||||||
ocd_close (scb)
|
ocd_close (scb)
|
||||||
serial_t scb;
|
serial_t scb;
|
||||||
{
|
{
|
||||||
ocd_close (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct serial_ops ocd_ops =
|
static struct serial_ops ocd_ops =
|
||||||
|
@ -172,3 +171,9 @@ _initialize_ser_ocd_bdm ()
|
||||||
{
|
{
|
||||||
serial_add_interface (&ocd_ops);
|
serial_add_interface (&ocd_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,9 @@ serial_open (name)
|
||||||
return scb;
|
return scb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp (name, "pc") == 0)
|
if (strcmp (name, "ocd") == 0)
|
||||||
|
ops = serial_interface_lookup ("ocd");
|
||||||
|
else if (strcmp (name, "pc") == 0)
|
||||||
ops = serial_interface_lookup ("pc");
|
ops = serial_interface_lookup ("pc");
|
||||||
else if (strchr (name, ':'))
|
else if (strchr (name, ':'))
|
||||||
ops = serial_interface_lookup ("tcp");
|
ops = serial_interface_lookup ("tcp");
|
||||||
|
|
Loading…
Reference in New Issue