aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-ocd.c
diff options
context:
space:
mode:
authorGeoffrey Noer <noer@cygnus>1997-08-07 06:31:46 +0000
committerGeoffrey Noer <noer@cygnus>1997-08-07 06:31:46 +0000
commit35ce4f08131b8de3b177971297076a3a2609bab5 (patch)
treea10f4618cae75287820133933a6e8486da1df4af /gdb/ser-ocd.c
parent3d18ed7d46260a9b4e7cf4b4d2b0546427a75d10 (diff)
downloadgdb-35ce4f08131b8de3b177971297076a3a2609bab5.zip
gdb-35ce4f08131b8de3b177971297076a3a2609bab5.tar.gz
gdb-35ce4f08131b8de3b177971297076a3a2609bab5.tar.bz2
Wed Aug 6 16:15:31 1997 Geoffrey Noer <noer@cygnus.com>
* Makefile.in: add DLLTOOL = @DLLTOOL@, pass on DLLTOOL to sub makes, change clean rule to also remove *.a to remove libwigglers.a, in dependencies: add ppc-bdm.o ocd.o ser-ocd.o and remove remote-wiggler.o * configure.in: add DLLTOOL support * configure: regenerate * wigglers.def: new file for imports for wigglers.dll * ser-ocd.c: new file which is layer between ocd.c and either the wigglers.dll or the target box, only stub so far * config/powerpc/ppc-eabi.mt: add ppc-bdm.o to TDEPFILES * config/powerpc/ppc-sim.mt: add ppc-bdm.o to TDEPFILES * config/i386/cygwin32.mh: add ocd.o ser-ocd.o libwigglers.a to XDEPFILES, add rules to build libwigglers.a checking in changes of Stu Grossman <grossman@cygnus.com>: * remote-wiggler.c: delete * ocd.c: new, was remote-wiggler.c always include sys/types.h, include ocd.h, move WIGGLER commands and many wiggler prototypes to ocd.h, make wiggler_desc static, stop making local wiggler functions static, define write_mem_command for wiggler_write_bytes (wiggler_start_remote): stop hardcoding the target type, instead set and use a target_type variable. (wiggler_open): add new target_type and ops args (wiggler_wait): now no longer takes pid and target_status as args, stop trying to set target_status struct, remove BGND insn checks (read_bdm_registers): renamed to wiggler_read_bdm_registers (wiggler_read_bdm_registers): numregs arg changed to reglen arg, remove pktlen check, set reglen instead of numregs (dump_all_bdm_regs): delete (wiggler_fetch_registers): delete (wiggler_prepare_to_store): now just an empty function (wiggler_store_registers): delete (wiggler_read_bdm_register): new (wiggler_write_bdm_registers): new (wiggler_write_bdm_register): new (wiggler_write_bytes): use write_mem_command variable instead of WIGGLER_WRITE_MEM (get_packet): renamed to wiggler_get_packet, change refs throughout (put_packet): renamed to wiggler_put_packet, change refs throughout (wiggler_get_packet): add break to default case of switch, change length of WIGGLER_GET_VERSION len to 10 from 4 to match specs (wiggler_mourn): unpush_target with current_ops, not &wiggler_ops (flash_xfer_memory): delete (noop_store_registers): new placeholder replacement for target_store_registers() which prevents generic_load from trying to set up the PC. (bdm_update_flash_command): add store_registers_tmp variable, make handling of wiggler_ops more generic -- define wiggler_ops in a target-specific file instead (such as ppc-bdm.c in the case of the ppc), use current_target to deal with registers again making this file less target-specific. (bdm_read_register_command): new (_initialize_remote_wiggler): stop doing add_target (&wiggler_ops), comment out add_cmd ("read-register", ...) * ocd.h: new, contains common wiggler prototypes, command definitions * ppc-bdm.c: file for ppc-specific OCD code, including target_ops structure for ppc bdm (bdm_ppc_open): new (bdm_ppc_wait): new (bdm_ppc_fetch_registers): new (bdm_ppc_store_registers_: new (_initialize_bdm_ppc): new * config/powerpc/tm-ppc-eabi.h: add necessary CPU32 BDM defines
Diffstat (limited to 'gdb/ser-ocd.c')
-rw-r--r--gdb/ser-ocd.c174
1 files changed, 174 insertions, 0 deletions
diff --git a/gdb/ser-ocd.c b/gdb/ser-ocd.c
new file mode 100644
index 0000000..d3f1c8e
--- /dev/null
+++ b/gdb/ser-ocd.c
@@ -0,0 +1,174 @@
+/* Remote serial interface for Macraigor Systems implementation of
+ On-Chip Debugging using serial target box or serial wiggler
+
+ Copyright 1994, 1997 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. */
+
+#include "defs.h"
+#include "serial.h"
+
+static int ser_ocd_open PARAMS ((serial_t scb, const char *name));
+static void ser_ocd_raw PARAMS ((serial_t scb));
+static int ser_ocd_readchar PARAMS ((serial_t scb, int timeout));
+static int ser_ocd_setbaudrate PARAMS ((serial_t scb, int rate));
+static int ser_ocd_write PARAMS ((serial_t scb, const char *str, int len));
+static void ser_ocd_close PARAMS ((serial_t scb));
+static serial_ttystate ser_ocd_get_tty_state PARAMS ((serial_t scb));
+static int ser_ocd_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
+
+static int
+ocd_open (scb, name)
+ serial_t scb;
+ const char *name;
+{
+ return 0;
+}
+
+static int
+ocd_noop (scb)
+ serial_t scb;
+{
+ return 0;
+}
+
+static void
+ocd_raw (scb)
+ serial_t scb;
+{
+ /* Always in raw mode */
+}
+
+/* We need a buffer to store responses from the Wigglers.dll */
+char * from_wigglers_buffer;
+char * bptr; /* curr spot in buffer */
+
+static void
+ocd_readremote ()
+{
+}
+
+static int
+ocd_readchar (scb, timeout)
+ serial_t scb;
+ int timeout;
+{
+
+}
+
+struct ocd_ttystate {
+ int dummy;
+};
+
+/* ocd_{get set}_tty_state() are both dummys to fill out the function
+ vector. Someday, they may do something real... */
+
+static serial_ttystate
+ocd_get_tty_state (scb)
+ serial_t scb;
+{
+ struct ocd_ttystate *state;
+
+ state = (struct ocd_ttystate *) xmalloc (sizeof *state);
+
+ return (serial_ttystate) state;
+}
+
+static int
+ocd_set_tty_state (scb, ttystate)
+ serial_t scb;
+ serial_ttystate ttystate;
+{
+ return 0;
+}
+
+static int
+ocd_noflush_set_tty_state (scb, new_ttystate, old_ttystate)
+ serial_t scb;
+ serial_ttystate new_ttystate;
+ serial_ttystate old_ttystate;
+{
+ return 0;
+}
+
+static void
+ocd_print_tty_state (scb, ttystate)
+ serial_t scb;
+ serial_ttystate ttystate;
+{
+ /* Nothing to print. */
+ return;
+}
+
+static int
+ocd_setbaudrate (scb, rate)
+ serial_t scb;
+ int rate;
+{
+ return 0;
+}
+
+static int
+ocd_write (scb, str, len)
+ serial_t scb;
+ const char *str;
+ int len;
+{
+ char c;
+
+ ocd_readremote();
+
+#ifdef __CYGWIN32__
+ /* send packet to Wigglers.dll and store response so we can give it to
+ remote-wiggler.c when get_packet is run */
+ do_command (str, from_wigglers_buffer);
+#endif
+
+ return 0;
+}
+
+static void
+ocd_close (scb)
+ serial_t scb;
+{
+ wiggler_close (0);
+}
+
+static struct serial_ops ocd_ops =
+{
+ "ocd",
+ 0,
+ ocd_open,
+ ocd_close,
+ ocd_readchar,
+ ocd_write,
+ ocd_noop, /* flush output */
+ ocd_noop, /* flush input */
+ ocd_noop, /* send break -- currently used only for nindy */
+ ocd_raw,
+ ocd_get_tty_state,
+ ocd_set_tty_state,
+ ocd_print_tty_state,
+ ocd_noflush_set_tty_state,
+ ocd_setbaudrate,
+};
+
+void
+_initialize_ser_ocd_bdm ()
+{
+ serial_add_interface (&ocd_ops);
+}