diff options
-rw-r--r-- | gdb/ChangeLog | 19 | ||||
-rw-r--r-- | gdb/ocd.c | 40 | ||||
-rw-r--r-- | gdb/ppc-bdm.c | 2 | ||||
-rw-r--r-- | gdb/ser-ocd.c | 15 |
4 files changed, 50 insertions, 26 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c2c1229..0c1eb20 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,22 @@ +Thu Aug 21 14:56:04 1997 Geoffrey Noer <noer@cygnus.com> + + * ppc-bdm.c (bdm_ppc_wait): stop printfing ecr, der + * ocd.c: initialize remote_timeout + (ocd_wait): while looping, call ocd_do_command with OCD_AYT + (ocd_get_packet): remove find_packet goto. If there isn't + an 0x55 at the start, something is quite wrong so error out + instead of advancing in the packet and trying again. If checksum + is invalid, print error message instead of trying again. + * ser-ocd.c (ocd_readchar): error if we attempt to read past + the end of the from_wiggler_buffer. + +Tue Aug 19 08:41:36 1997 Fred Fish <fnf@cygnus.com> + + * objfiles.c (objfile_relocate): Add call to breakpoint_re_set + after relocations are complete. + * remote-vx.c (vx_add_symbols): Remove call to breakpoint_re_set, + this is now done in objfile_relocate. + Mon Aug 18 17:29:54 1997 Ian Lance Taylor <ian@cygnus.com> * win32-nat.c (handle_exception): Return a value indicating @@ -74,9 +74,10 @@ static int last_run_status; other form of hairy serial connection, I would think 2 seconds would be plenty. */ -/* Changed to allow option to set timeout value. - was static int remote_timeout = 2; */ -extern int remote_timeout; +/* FIXME: Change to allow option to set timeout value on a per target + basis. + +static int remote_timeout = 2; /* Descriptor for I/O to remote machine. Initialize it to NULL so that ocd_open knows that we don't have a file open when the program @@ -196,9 +197,12 @@ ocd_start_remote (dummy) ocd_stop (); #if 1 + /* When using a target box, we want to asynchronously return status when + target stops. The OCD_SET_CTL_FLAGS command is ignored by Wigglers.dll + when using a parallel Wiggler */ buf[0] = OCD_SET_CTL_FLAGS; buf[1] = 0; - buf[2] = 1; /* Asynchronously return status when target stops */ + buf[2] = 1; ocd_put_packet (buf, 3); p = ocd_get_packet (buf[0], &pktlen, remote_timeout); @@ -446,22 +450,23 @@ int ocd_wait () { unsigned char *p; - int error_code, status; + int error_code; int pktlen; + char buf[1]; ocd_interrupt_flag = 0; - /* Target may already be stopped by the time we get here. */ - -/* if (!(last_run_status & OCD_FLAG_BDM)) */ + /* Target might already be stopped by the time we get here. */ + /* If we aren't already stopped, we need to loop until we've dropped + back into BDM mode */ - /* Loop until we've dropped back into BDM mode */ while (!(last_run_status & OCD_FLAG_BDM)) { - ofunc = (void (*)()) signal (SIGINT, ocd_interrupt); - + buf[0] = OCD_AYT; + ocd_put_packet (buf, 1); p = ocd_get_packet (OCD_AYT, &pktlen, -1); + ofunc = (void (*)()) signal (SIGINT, ocd_interrupt); signal (SIGINT, ofunc); if (pktlen < 2) @@ -477,10 +482,6 @@ ocd_wait () error ("OCD device lost VCC at BDM interface."); else if (last_run_status & OCD_FLAG_CABLE_DISC) error ("OCD device cable appears to have been disconnected."); -#if 0 - if (!(last_run_status & OCD_FLAG_BDM)) - error ("OCD device woke up, but wasn't stopped: 0x%x", status); -#endif } if (ocd_interrupt_flag) @@ -1034,15 +1035,13 @@ ocd_get_packet (cmd, lenp, timeout) unsigned char *packet_ptr; unsigned char checksum; - find_packet: - ch = readchar (timeout); if (ch < 0) error ("ocd_get_packet (readchar): %d", ch); if (ch != 0x55) - goto find_packet; + error ("ocd_get_packet (readchar): %d", ch); /* Found the start of a packet */ @@ -1133,8 +1132,7 @@ ocd_get_packet (cmd, lenp, timeout) len = 257; break; default: - fprintf_filtered (gdb_stderr, "Unknown packet type 0x%x\n", ch); - goto find_packet; + error ("ocd_get_packet: unknown packet type 0x%x\n", ch); } } @@ -1162,7 +1160,7 @@ ocd_get_packet (cmd, lenp, timeout) } if (checksum != 0) - goto find_packet; + error ("ocd_get_packet: bad packet checksum"); if (cmd != -1 && cmd != packet[0]) error ("Response phase error. Got 0x%x, expected 0x%x", packet[0], cmd); diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c index 5ca012f..6731e9a 100644 --- a/gdb/ppc-bdm.c +++ b/gdb/ppc-bdm.c @@ -116,6 +116,7 @@ bdm_ppc_wait (pid, target_status) target_status->value.sig = TARGET_SIGNAL_TRAP; /* XXX for now */ +#if 0 { unsigned long ecr, der; @@ -123,6 +124,7 @@ bdm_ppc_wait (pid, target_status) der = ocd_read_bdm_register (149); /* Read the debug enables register */ fprintf_unfiltered (gdb_stdout, "ecr = 0x%x, der = 0x%x\n", ecr, der); } +#endif return inferior_pid; } diff --git a/gdb/ser-ocd.c b/gdb/ser-ocd.c index 4008a87..08239bb 100644 --- a/gdb/ser-ocd.c +++ b/gdb/ser-ocd.c @@ -81,21 +81,26 @@ ocd_raw (scb) /* Always in raw mode */ } -/* We need a buffer to store responses from the Wigglers.dll */ -#define WIGGLER_BUFF_SIZE 512 -unsigned char from_wiggler_buffer[WIGGLER_BUFF_SIZE]; -unsigned char * wiggler_buffer_ptr; /* curr spot in buffer */ - static void ocd_readremote () { } +/* We need a buffer to store responses from the Wigglers.dll */ +#define WIGGLER_BUFF_SIZE 512 +unsigned char from_wiggler_buffer[WIGGLER_BUFF_SIZE]; +unsigned char * wiggler_buffer_ptr; /* curr spot in buffer */ + static int ocd_readchar (scb, timeout) serial_t scb; int timeout; { + /* Catch attempts at reading past the end of the buffer */ + if (wiggler_buffer_ptr > + (from_wiggler_buffer + (sizeof (char *) * WIGGLER_BUFF_SIZE))) + error ("ocd_readchar asked to read past the end of the buffer!"); + return (int) *wiggler_buffer_ptr++; /* return curr char and increment ptr */ } |