From 180fd370b16504faa5de1995e89494b75218acb6 Mon Sep 17 00:00:00 2001 From: Jackie Smith Cashion Date: Fri, 1 Sep 1995 15:33:14 +0000 Subject: [PATCH] Ideally the "remote-mips.c" prompt spotting code should be updated to spot different prompts at run-time, so as to avoid having target specific versions of gdb. This is a pending TODO. Fri Sep 1 08:25:50 1995 James G. Smith * configure (mips64*vr4300*-*-elf): Support added. * remote-mips.c (mips_readchar): Change to allow build-time prompt string. * config/mips/tm-mips.h: Added TARGET_MONITOR_PROMPT. * config/mips/{vr4300.mt, vr4300el.mt, tm-vr4300.h, tm-vr4300el.h}: Added. --- gdb/ChangeLog | 9 +++++++++ gdb/config/mips/.Sanitize | 3 +++ gdb/config/mips/tm-mips.h | 6 ++++++ gdb/config/mips/tm-vr4300.h | 25 +++++++++++++++++++++++++ gdb/config/mips/tm-vr4300el.h | 25 +++++++++++++++++++++++++ gdb/config/mips/vr4300.mt | 3 +++ gdb/config/mips/vr4300el.mt | 3 +++ gdb/configure | 4 ++++ gdb/remote-mips.c | 12 +++++++++--- 9 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 gdb/config/mips/tm-vr4300.h create mode 100644 gdb/config/mips/tm-vr4300el.h create mode 100644 gdb/config/mips/vr4300.mt create mode 100644 gdb/config/mips/vr4300el.mt diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5ba6254b6c..b48c6a2b03 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +Fri Sep 1 08:25:50 1995 James G. Smith + + * configure (mips64*vr4300*-*-elf): Support added. + * remote-mips.c (mips_readchar): Change to allow build-time prompt + string. + * config/mips/tm-mips.h: Added TARGET_MONITOR_PROMPT. + * config/mips/{vr4300.mt, vr4300el.mt, tm-vr4300.h, + tm-vr4300el.h}: Added. + Thu Aug 31 12:48:04 1995 Jim Wilson * config/sh/sh.mt (SIM): Add -lm. diff --git a/gdb/config/mips/.Sanitize b/gdb/config/mips/.Sanitize index 111e422ac0..63cc74b641 100644 --- a/gdb/config/mips/.Sanitize +++ b/gdb/config/mips/.Sanitize @@ -65,6 +65,9 @@ tm-mips.h tm-mips64.h tm-mipsm3.h tm-mipsv4.h +tm-vr4300.h +tm-vr4300el.h +vr4300.mt xm-irix3.h xm-irix4.h xm-irix5.h diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 4f2256ffd2..200cc8816a 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -32,6 +32,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define GDB_TARGET_IS_MIPS64 0 #endif +/* CYGNUS LOCAL jsmith */ +#if !defined (TARGET_MONITOR_PROMPT) +#define TARGET_MONITOR_PROMPT { '<', 'I', 'D', 'T', '>' } +#endif +/* END CYGNUS LOCAL */ + /* Floating point is IEEE compliant */ #define IEEE_FLOAT diff --git a/gdb/config/mips/tm-vr4300.h b/gdb/config/mips/tm-vr4300.h new file mode 100644 index 0000000000..60cffbf265 --- /dev/null +++ b/gdb/config/mips/tm-vr4300.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +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 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 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE +#define TARGET_MONITOR_PROMPT { '<', 'R', 'I', 'S', 'Q', '>', ' ' } + +/* Hack to allow 64bit register reads, from 32bit BFD world */ +#define CC_HAS_LONG_LONG 1 + +#include "mips/tm-bigmips64.h" diff --git a/gdb/config/mips/tm-vr4300el.h b/gdb/config/mips/tm-vr4300el.h new file mode 100644 index 0000000000..53a1b58fcb --- /dev/null +++ b/gdb/config/mips/tm-vr4300el.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + +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 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 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define TARGET_BYTE_ORDER_SELECTABLE +#define TARGET_MONITOR_PROMPT { '<', 'R', 'I', 'S', 'Q', '>', ' ' } + +/* Hack to allow 64bit register reads, from 32bit BFD world */ +#define CC_HAS_LONG_LONG 1 + +#include "mips/tm-mips64.h" diff --git a/gdb/config/mips/vr4300.mt b/gdb/config/mips/vr4300.mt new file mode 100644 index 0000000000..b5977e8bf8 --- /dev/null +++ b/gdb/config/mips/vr4300.mt @@ -0,0 +1,3 @@ +# Target: Big-endian SIM monitor board. +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-vr4300.h diff --git a/gdb/config/mips/vr4300el.mt b/gdb/config/mips/vr4300el.mt new file mode 100644 index 0000000000..9ba2a24d46 --- /dev/null +++ b/gdb/config/mips/vr4300el.mt @@ -0,0 +1,3 @@ +# Target: Little-endian SIM monitor board. +TDEPFILES= mips-tdep.o remote-mips.o +TM_FILE= tm-vr4300el.h diff --git a/gdb/configure b/gdb/configure index c8721d3da5..528ee649bd 100755 --- a/gdb/configure +++ b/gdb/configure @@ -2105,6 +2105,10 @@ mips*-dec-mach3*) gdb_target=mach3 ;; mips*-dec-*) gdb_target=decstation ;; mips64*el-*-ecoff*) gdb_target=idtl64 ;; mips64*-idt-ecoff*) gdb_target=idt64 ;; +# CYGNUS LOCAL jsmith +mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;; +mips64*vr4300*-*-elf*) gdb_target=vr4300 ;; +# END CYGNUS LOCAL mips64*el-*-elf*) gdb_target=idtl64 ;; mips64*-*-elf*) gdb_target=idt64 ;; mips*el-*-ecoff*) gdb_target=idtl ;; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 9129498353..bfbfc53f55 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -327,13 +327,19 @@ mips_error (va_alist) convenient for DejaGnu when you only have one connected serial port. */ +/* CYGNUS LOCAL jsmith */ +/* The old code assumed a 5 character identification string, making it + a chore to change the string value. However, we need to ensure + that the method of ascertaining the length of the string is + completely portable, without resorting to calling strlen(). */ + static int mips_readchar (timeout) int timeout; { int ch; static int state = 0; - static char nextstate[5] = { '<', 'I', 'D', 'T', '>' }; + static char nextstate[] = TARGET_MONITOR_PROMPT; /* CYGNUS LOCAL jsmith */ #ifdef MAINTENANCE_CMDS int i; @@ -342,7 +348,7 @@ mips_readchar (timeout) i = watchdog; #endif - if (state == 5) + if (state == (sizeof(nextstate) / sizeof(char))) /* CYGNUS LOCAL jsmith */ timeout = 1; ch = SERIAL_READCHAR (mips_desc, timeout); #ifdef MAINTENANCE_CMDS @@ -372,7 +378,7 @@ mips_readchar (timeout) (which is not echoed) is always an @ unless the packet is more than 64 characters long, which ours never are. */ if ((ch == SERIAL_TIMEOUT || ch == '@') - && state == 5 + && state == (sizeof(nextstate) / sizeof(char)) /* CYGNUS LOCAL jsmith */ && ! mips_initializing) { if (sr_get_debug () > 0)