* ser-ocd.c: If _WIN32, include <windows.h>.
authorIan Lance Taylor <ian@airs.com>
Sat, 9 Aug 1997 00:21:50 +0000 (00:21 +0000)
committerIan Lance Taylor <ian@airs.com>
Sat, 9 Aug 1997 00:21:50 +0000 (00:21 +0000)
(dll_do_command): New static variable if _WIN32.
(ocd_open): Set dll_do_command if _WIN32.
(ocd_write): Use dll_do_command rather than do_command.
* config/i386/cygwin32.mh (XDEPFILES): Remove libwigglers.a.
(BDM_DLLNAME, BDM_LIBNAME, BDM_DEFFILE): Don't define.
($(BDM_LIBNAME)): Remove target.
* wigglers.def: Remove.

gdb/ChangeLog
gdb/config/i386/cygwin32.mh
gdb/ser-ocd.c
gdb/wigglers.def [deleted file]

index ff2ed7dbddb5e57e8a967373c50ae4b0338c214c..e3d29aeca5c94479c8e6f87be9879b6ee19d6151 100644 (file)
@@ -1,5 +1,23 @@
 Fri Aug  8 15:59:24 1997  Ian Lance Taylor  <ian@cygnus.com>
 
+       * ser-ocd.c: If _WIN32, include <windows.h>.
+       (dll_do_command): New static variable if _WIN32.
+       (ocd_open): Set dll_do_command if _WIN32.
+       (ocd_write): Use dll_do_command rather than do_command.
+       * config/i386/cygwin32.mh (XDEPFILES): Remove libwigglers.a.
+       (BDM_DLLNAME, BDM_LIBNAME, BDM_DEFFILE): Don't define.
+       ($(BDM_LIBNAME)): Remove target.
+       * wigglers.def: Remove.
+
+start-sanitize-gdbtk
+       * gdbtk.c (gdbtk_init): Change gdbtk_lib_tmp and gdbtk_file to be
+       dynamically allocated, rather than fixed size.  Pass "gdbtcl" to
+       ide_initialize_paths to match installed directory name.  If IDE,
+       use auto_path to search for main.tcl.
+       * Makefile.in (install-only): If ENABLE_IDE, install from gdbtcl2
+       rather than gdbtcl.
+
+end-sanitize-gdbtk
        * config/i386/cygwin32.mh ($(BDM_LIBNAME)): Rename target from
        libwigglers.def.
        (libwigglers.a): Remove target.
index ed8abc94a3ff91e297bacd897ae2ef6a079a5753..ed0b46b39a0fe5b29139530827ad98bd9fb41d3d 100644 (file)
@@ -1,17 +1,8 @@
 MH_CFLAGS=
 XM_FILE=xm-cygwin32.h
-XDEPFILES=ser-tcp.o ocd.o ser-ocd.o libwigglers.a
+XDEPFILES=ser-tcp.o ocd.o ser-ocd.o
 TERMCAP= 
 NATDEPFILES= win32-nat.o
 NAT_FILE=../nm-empty.h
 XM_CLIBS=
 MMALLOC_CFLAGS = -I$(MMALLOC_SRC) -DMMCHECK_FORCE=1
-
-# BDM specific definitions for accessing the Wigglers.dll on Win32
-BDM_DLLNAME = Wigglers.dll
-BDM_LIBNAME = libwigglers.a
-BDM_DEFFILE = $(srcdir)/wigglers.def
-
-# Makefile target for making BDM_LIBNAME
-$(BDM_LIBNAME): $(BDM_DEFFILE)
-       $(DLLTOOL) --as=i386-cygwin32-as -k --dllname $(BDM_DLLNAME) --output-lib $(BDM_LIBNAME) --def $(BDM_DEFFILE)
index 1bded76b95478dd205a34499e317b9da0c0cc690..ad9ba0cd213fc9b5c88a20f562cf76c737d5917b 100644 (file)
 #include "defs.h"
 #include "serial.h"
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 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));
@@ -31,11 +35,35 @@ 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));
 
+#ifdef _WIN32
+/* On Windows, this function pointer is initialized to a function in
+   the wiggler DLL.  */
+static int (*dll_do_command) PARAMS ((const char *, char *));
+#endif
+
 static int
 ocd_open (scb, name)
      serial_t scb;
      const char *name;
 {
+#ifdef _WIN32
+  /* Find the wiggler DLL which talks to the board.  */
+  if (dll_do_command == NULL)
+    {
+      HINSTANCE handle;
+
+      /* FIXME: Should the user be able to configure this?  */
+      handle = LoadLibrary ("Wigglers.dll");
+      if (handle == NULL)
+       error ("Can't load Wigglers.dll");
+
+      dll_do_command = ((int (*) PARAMS ((const char *, char *)))
+                       GetProcAddress (handle, "do_command"));
+      if (dll_do_command == NULL)
+       error ("Can't find do_command function in Wigglers.dll");
+    }
+#endif
+
   return 0;
 }
 
@@ -134,7 +162,7 @@ ocd_write (scb, str, len)
 #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_wiggler_buffer);
+  dll_do_command (str, from_wiggler_buffer);
   wiggler_buffer_ptr = from_wiggler_buffer;
 #endif
 
@@ -171,9 +199,3 @@ _initialize_ser_ocd_bdm ()
 {
   serial_add_interface (&ocd_ops);
 }
-
-
-
-
-
-
diff --git a/gdb/wigglers.def b/gdb/wigglers.def
deleted file mode 100644 (file)
index f29a100..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-EXPORTS
-do_command
-test_command
This page took 0.043116 seconds and 4 git commands to generate.