1993-04-06 10:13:03 +00:00
|
|
|
/* Remote serial interface for local (hardwired) serial ports for GO32.
|
|
|
|
Copyright 1992, 1993 Free Software Foundation, Inc.
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
This file is part of GDB.
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
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.
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
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.
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "serial.h"
|
* tm-hppa.h: New file, architectural definition of HP PA.
* tm-hppabsd.h, tm-hppahpux.h: Shrink to deltas from tm-hppa.h.
* am29k-pinsn.c, am29k-tdep.c, copying.awk, copying.c,
hppa-coredep.c, hppa-pinsn.c, hppabsd-core.c, hppabsd-tdep.c,
hppabsd-xdep.c, hppahpux-tdep.c, hppahpux-xdep.c, remote-udi.c,
ser-go32.c, xcoffsolib.c: Remove <stdio.h> which is already in
"defs.h".
* hppa-coredep.c, hppa-pinsn.c, hppabsd-core.c, hppabsd-tdep.c,
hppabsd-xdep.c, hppahpux-tdep.c, hppahpux-xdep.c, xcoffsolib.c,
xcoffsolib.h, xm-go32.h, xm-hppabsd.h, xm-hppahpux.h: Copyrights.
1992-06-25 11:15:47 +00:00
|
|
|
#include <sys/dos.h>
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
#define disable() asm("cli")
|
|
|
|
#define enable() asm("sti")
|
|
|
|
|
1994-08-22 17:58:47 +00:00
|
|
|
|
1993-05-29 01:33:36 +00:00
|
|
|
struct go32_ttystate
|
1993-12-12 00:00:53 +00:00
|
|
|
{
|
|
|
|
int bogus;
|
|
|
|
};
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
short jmp_op;
|
|
|
|
short signature;
|
|
|
|
short version;
|
|
|
|
short buffer_start;
|
|
|
|
short buffer_end;
|
|
|
|
short getp;
|
|
|
|
short putp;
|
|
|
|
short iov;
|
1994-06-28 00:52:59 +00:00
|
|
|
short count;
|
|
|
|
short overflow;
|
|
|
|
short buffer_size;
|
|
|
|
short ovflushes;
|
1993-12-12 00:00:53 +00:00
|
|
|
}
|
|
|
|
ASYNC_STRUCT;
|
1993-06-04 00:38:04 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
#define AOFF_JMP_OP 0
|
|
|
|
#define AOFF_SIGNATURE 2
|
|
|
|
#define AOFF_VERSION 4
|
|
|
|
#define AOFF_BUFFER_START 6
|
|
|
|
#define AOFF_BUFFER_END 8
|
|
|
|
#define AOFF_GETP 10
|
|
|
|
#define AOFF_PUTP 12
|
|
|
|
#define AOFF_IOV 14
|
|
|
|
#define AOFF_COUNT 16
|
|
|
|
#define AOFF_OVERFLOW 18
|
|
|
|
#define AOFF_BUFFER_SIZE 20
|
|
|
|
#define AOFF_OVFLUSHES 22
|
|
|
|
|
|
|
|
|
|
|
|
static ASYNC_STRUCT a; /* Copy in our mem of the struct */
|
|
|
|
static long aindex; /* index into dos space of struct */
|
|
|
|
|
1993-05-29 01:33:36 +00:00
|
|
|
static int go32_open PARAMS ((serial_t scb, const char *name));
|
|
|
|
static void go32_raw PARAMS ((serial_t scb));
|
|
|
|
static int go32_readchar PARAMS ((serial_t scb, int timeout));
|
|
|
|
static int go32_setbaudrate PARAMS ((serial_t scb, int rate));
|
|
|
|
static int go32_write PARAMS ((serial_t scb, const char *str, int len));
|
|
|
|
static void go32_close PARAMS ((serial_t scb));
|
1993-06-04 00:38:04 +00:00
|
|
|
static serial_ttystate go32_get_tty_state PARAMS ((serial_t scb));
|
1993-05-29 01:33:36 +00:00
|
|
|
static int go32_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
|
1994-06-28 00:52:59 +00:00
|
|
|
static unsigned char aptr PARAMS ((short p));
|
|
|
|
static unsigned long getivec PARAMS ((int which));
|
1993-05-29 01:33:36 +00:00
|
|
|
static int dos_async_init PARAMS ((int port));
|
|
|
|
static void dos_async_tx PARAMS ((const char c));
|
|
|
|
static int dos_async_rx PARAMS (());
|
|
|
|
static int dosasync_read PARAMS ((int fd, char *buf, int len, int timeout));
|
1993-06-04 00:38:04 +00:00
|
|
|
static int dosasync_write PARAMS ((int fd, const char *buf, int len));
|
1993-05-29 01:33:36 +00:00
|
|
|
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
#define SIGNATURE 0x4154
|
|
|
|
#define VERSION 1
|
|
|
|
#define OFFSET 0x104
|
|
|
|
|
1994-08-22 17:58:47 +00:00
|
|
|
char packet[50];
|
|
|
|
int packet_len;
|
|
|
|
int packet_idx;
|
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
unsigned char bb;
|
|
|
|
unsigned short sb;
|
|
|
|
unsigned long sl;
|
|
|
|
|
|
|
|
#define SET_BYTE(x,y) { char _buf = y;dosmemput(&_buf,1, x);}
|
|
|
|
#define SET_WORD(x,y) { short _buf = y;dosmemput(&_buf,2, x);}
|
|
|
|
#define GET_BYTE(x) ( dosmemget((x),1,&bb), bb)
|
|
|
|
|
|
|
|
|
|
|
|
#define GET_LONG(x) ( dosmemget((x),4,&sl), sl)
|
|
|
|
|
|
|
|
static
|
1994-08-22 17:58:47 +00:00
|
|
|
unsigned short
|
1994-06-28 00:52:59 +00:00
|
|
|
GET_WORD (x)
|
|
|
|
{
|
|
|
|
unsigned short sb;
|
|
|
|
dosmemget ((x), 2, &sb);
|
|
|
|
return sb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int iov[2];
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
#define com_rb(n) iov[n]
|
|
|
|
#define com_tb(n) iov[n]
|
|
|
|
#define com_ier(n) iov[n]+1
|
|
|
|
#define com_ifr(n) iov[n]+2
|
|
|
|
#define com_bfr(n) iov[n]+3
|
|
|
|
#define com_mcr(n) iov[n]+4
|
|
|
|
#define com_lsr(n) iov[n]+5
|
|
|
|
#define com_msr(n) iov[n]+6
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
static unsigned char
|
1993-12-12 00:00:53 +00:00
|
|
|
aptr (p)
|
1993-04-06 10:13:03 +00:00
|
|
|
short p;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1994-06-28 00:52:59 +00:00
|
|
|
return GET_BYTE (aindex - OFFSET + p);
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
static unsigned long
|
1993-12-12 00:00:53 +00:00
|
|
|
getivec (int which)
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1994-06-28 00:52:59 +00:00
|
|
|
long tryaindex;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
if (GET_WORD (which * 4) != OFFSET)
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
return 0;
|
1993-04-08 04:12:56 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
/* Find out where in memory this lives */
|
|
|
|
tryaindex = GET_WORD (which * 4 + 2) * 16 + GET_WORD (which * 4);
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
if (GET_WORD (tryaindex + 2) != SIGNATURE)
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
return 0;
|
1994-06-28 00:52:59 +00:00
|
|
|
if (GET_WORD (tryaindex + 4) != VERSION)
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
return 0;
|
1994-06-28 00:52:59 +00:00
|
|
|
return tryaindex;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
1993-12-12 00:00:53 +00:00
|
|
|
dos_async_init (port)
|
1993-04-08 04:12:56 +00:00
|
|
|
int port;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1993-04-08 04:12:56 +00:00
|
|
|
switch (port)
|
1993-04-07 04:43:48 +00:00
|
|
|
{
|
1993-04-08 04:12:56 +00:00
|
|
|
case 1:
|
1994-06-28 00:52:59 +00:00
|
|
|
aindex = getivec (12);
|
1993-04-08 04:12:56 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
1994-06-28 00:52:59 +00:00
|
|
|
aindex = getivec (11);
|
1993-04-08 04:12:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 0;
|
1993-04-07 04:43:48 +00:00
|
|
|
}
|
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
if (!aindex)
|
1993-04-07 04:43:48 +00:00
|
|
|
{
|
1993-12-12 00:00:53 +00:00
|
|
|
error ("GDB cannot connect to asynctsr program, check that it is installed\n\
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
and that serial I/O is not being redirected (perhaps by NFS)\n\n\
|
|
|
|
example configuration:\n\
|
1993-06-26 00:22:30 +00:00
|
|
|
C> mode com%d:9600,n,8,1,p\n\
|
|
|
|
C> asynctsr %d\n\
|
|
|
|
C> gdb \n", port, port);
|
1993-04-07 04:43:48 +00:00
|
|
|
}
|
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
iov[0] = GET_WORD (aindex + AOFF_IOV);
|
|
|
|
outportb (com_ier (0), 0x0f);
|
|
|
|
outportb (com_bfr (0), 0x03);
|
|
|
|
outportb (com_mcr (0), 0x0b);
|
1993-04-08 04:12:56 +00:00
|
|
|
return 1;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static void
|
1993-12-12 00:00:53 +00:00
|
|
|
dos_async_tx (c)
|
1993-04-06 10:13:03 +00:00
|
|
|
const char c;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1994-06-28 00:52:59 +00:00
|
|
|
while (~inportb (com_lsr (0)) & 0x20)
|
1993-12-12 00:00:53 +00:00
|
|
|
;
|
1994-06-28 00:52:59 +00:00
|
|
|
outportb (com_tb (0), c);
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
static int
|
|
|
|
dos_async_ready ()
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
1994-08-22 17:58:47 +00:00
|
|
|
if (packet_idx < packet_len)
|
|
|
|
return 1;
|
|
|
|
|
1994-06-28 00:52:59 +00:00
|
|
|
disable ();
|
|
|
|
#if RDY_CNT
|
|
|
|
ret = GET_WORD (aindex + AOFF_COUNT);
|
|
|
|
#else
|
|
|
|
ret = GET_WORD (aindex + AOFF_GETP) != GET_WORD (aindex + AOFF_PUTP);
|
|
|
|
#endif
|
|
|
|
enable ();
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
1993-12-12 00:00:53 +00:00
|
|
|
dos_async_rx ()
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
|
|
|
char rv;
|
1994-06-28 00:52:59 +00:00
|
|
|
short idx;
|
1993-04-06 10:13:03 +00:00
|
|
|
|
1994-08-22 17:58:47 +00:00
|
|
|
while (1)
|
1993-12-12 00:00:53 +00:00
|
|
|
{
|
1994-08-22 17:58:47 +00:00
|
|
|
if (packet_idx < packet_len)
|
|
|
|
{
|
|
|
|
char x = packet[packet_idx++];
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
while (!dos_async_ready ())
|
1993-12-12 00:00:53 +00:00
|
|
|
{
|
1994-08-22 17:58:47 +00:00
|
|
|
if (kbhit ())
|
|
|
|
{
|
|
|
|
printf_unfiltered ("abort!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
1993-12-12 00:00:53 +00:00
|
|
|
}
|
1994-08-22 17:58:47 +00:00
|
|
|
disable ();
|
|
|
|
{
|
|
|
|
/* Sometimes we can read more than one char at a time
|
|
|
|
from the buffer, which is good, cause it'll mean
|
|
|
|
less time with interrupts turned off, which means
|
|
|
|
less dropped characters */
|
|
|
|
|
|
|
|
/* We only do the simplest case here - not bothering with
|
|
|
|
wrap around */
|
|
|
|
int len;
|
|
|
|
|
|
|
|
int getp = GET_WORD (aindex + AOFF_GETP);
|
|
|
|
int putp = GET_WORD (aindex + AOFF_PUTP);
|
|
|
|
int endb = GET_WORD (aindex + AOFF_BUFFER_END);
|
|
|
|
int startb = GET_WORD (aindex + AOFF_BUFFER_START);
|
|
|
|
|
|
|
|
/* We'd like to grab to the end of the the input,
|
|
|
|
but it may have wrapped, so max is to the end
|
|
|
|
of the buffer */
|
|
|
|
|
|
|
|
if (putp > endb || putp < getp)
|
|
|
|
putp = endb;
|
|
|
|
|
|
|
|
/* Work out the length of the suck */
|
|
|
|
len = putp - getp;
|
|
|
|
|
|
|
|
/* But only suck as many as we can hold in one go */
|
|
|
|
if (len > sizeof (packet))
|
|
|
|
len = sizeof (packet);
|
|
|
|
|
|
|
|
dosmemget (aindex - OFFSET + getp, len, packet);
|
|
|
|
|
|
|
|
packet_len = len;
|
|
|
|
packet_idx = 0;
|
|
|
|
|
|
|
|
if (getp + len >= endb)
|
|
|
|
{
|
|
|
|
getp = startb;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
getp = getp + len;
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_WORD (aindex + AOFF_GETP, getp);
|
|
|
|
SET_WORD (aindex + AOFF_COUNT, GET_WORD (aindex + AOFF_COUNT) - len);
|
|
|
|
}
|
|
|
|
enable ();
|
1993-12-12 00:00:53 +00:00
|
|
|
}
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1994-04-15 18:43:07 +00:00
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
|
|
|
dosasync_read (fd, buf, len, timeout)
|
|
|
|
int fd;
|
|
|
|
char *buf;
|
|
|
|
int len;
|
|
|
|
int timeout;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
|
|
|
long now, then;
|
1993-12-12 00:00:53 +00:00
|
|
|
int i;
|
1994-08-22 17:58:47 +00:00
|
|
|
int its = 0;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
time (&now);
|
1993-04-06 10:13:03 +00:00
|
|
|
then = now + timeout;
|
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
for (i = 0; i < len; i++)
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1993-04-06 10:13:03 +00:00
|
|
|
if (timeout)
|
|
|
|
{
|
1993-12-12 00:00:53 +00:00
|
|
|
while (!dos_async_ready ())
|
1993-04-06 10:13:03 +00:00
|
|
|
{
|
|
|
|
time (&now);
|
1994-08-22 17:58:47 +00:00
|
|
|
if (now >= then && timeout > 0 && its > 1000)
|
1993-12-12 00:00:53 +00:00
|
|
|
return i;
|
1994-08-22 17:58:47 +00:00
|
|
|
its++;
|
1993-04-06 10:13:03 +00:00
|
|
|
}
|
|
|
|
}
|
1993-12-12 00:00:53 +00:00
|
|
|
*buf++ = dos_async_rx ();
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
1993-04-06 10:13:03 +00:00
|
|
|
return len;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
1993-12-12 00:00:53 +00:00
|
|
|
dosasync_write (fd, buf, len)
|
1993-04-06 10:13:03 +00:00
|
|
|
int fd;
|
|
|
|
const char *buf;
|
|
|
|
int len;
|
|
|
|
{
|
1993-12-12 00:00:53 +00:00
|
|
|
int l;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
for (l = 0; l < len; l++)
|
1993-04-06 10:13:03 +00:00
|
|
|
dos_async_tx (*buf++);
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
return len;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
|
|
|
go32_open (scb, name)
|
|
|
|
serial_t scb;
|
|
|
|
const char *name;
|
* ser-termios.c, ser-go32.c: Remove DEFUN crap, clean up.
* serial.h (EXFUN): Remove all uses, convert to PARAMS.
* config/sun4os4.mh: Include ser-termios.o. FIXME, all .mh files
should include a ser-XXX.o module.
* dbxread.c (elfstab_build_psymtabs): Remove DEFUN crap.
* defs.h, i960-pinsn.c, remote-hms.c: Replace CONST with simple const.
* configure.in: Map unrecognized sun 68k's, sun sparcs, into
known suns in configure.in, rather than mapping them to unique
config files that happen to duplicate other config files.
* config/sun3.{mh,mt}: Remove (use identical sun3os4.*).
* config/sun4.{mh,mt}: Remove (use identical sun4os4.*).
1992-09-02 08:51:17 +00:00
|
|
|
{
|
1993-04-08 04:12:56 +00:00
|
|
|
int port;
|
|
|
|
|
|
|
|
if (strncasecmp (name, "com", 3) != 0)
|
|
|
|
{
|
|
|
|
errno = ENOENT;
|
1993-04-09 22:14:04 +00:00
|
|
|
return -1;
|
1993-04-08 04:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
port = name[3] - '0';
|
|
|
|
|
|
|
|
if ((port != 1) && (port != 2))
|
|
|
|
{
|
|
|
|
errno = ENOENT;
|
1993-04-09 22:14:04 +00:00
|
|
|
return -11;
|
1993-04-08 04:12:56 +00:00
|
|
|
}
|
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
scb->fd = dos_async_init (port);
|
1993-04-07 04:43:48 +00:00
|
|
|
if (!scb->fd)
|
1993-04-09 22:14:04 +00:00
|
|
|
return -1;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
return 0;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
* inftarg.c: Remove unused include of terminal.h.
* signals.h: Don't undefine signals anymore.
* main.c: Use job_control from serial.h.
* fork-child.c (fork_inferior): Use gdb_setpgid.
* serial.h, ser-unix.c, ser-go32.c: Provide gdb_setpgid.
* utils.c (quit): Use current_target->to_terminal_ours to figure
out whether we care about lack of job control, rather than __GO32__.
* utils.c: Include serial.h not terminal.h
(quit): Use job_control not TIOCGPGRP.
* terminal.h: Don't undefine TIOCGPGRP.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c: Add SERIAL_FLUSH_OUTPUT.
* utils.c (quit): Use it.
* serial.h: Add SERIAL_UN_FDOPEN.
* utils.c (quit): Use it.
* ser-unix.c: Add process group to ttystate.
[HAVE_SGTTY]: Add tchars, ltchars, and lmode to ttystate.
* inflow.c: Include serial.h not terminal.h.
Use serial.h stuff to replace most of the maze of #ifdef's.
* inflow.c, main.c, inferior.h: make gdb_has_a_terminal a function.
* serial.h: Document SERIAL_SET_TTY_STATE as being immediate.
* ser-unix.c: Use TIOCSETN not TIOCSETP so it is true.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c:
Add SERIAL_PRINT_TTY_STATE, SERIAL_NOFLUSH_SET_TTY_STATE, and
SERIAL_SET_PROCESS_GROUP.
* inflow.c: Use them.
* config/xm-svr4.h, config/rs6000/xm-rs6000.h, config/sparc/sun4os4.h:
Define HAVE_TERMIOS.
* Various: Remove all use of TIOC*_BROKEN.
1993-06-30 22:20:53 +00:00
|
|
|
static int
|
1993-07-28 06:45:35 +00:00
|
|
|
go32_noop (scb)
|
* inftarg.c: Remove unused include of terminal.h.
* signals.h: Don't undefine signals anymore.
* main.c: Use job_control from serial.h.
* fork-child.c (fork_inferior): Use gdb_setpgid.
* serial.h, ser-unix.c, ser-go32.c: Provide gdb_setpgid.
* utils.c (quit): Use current_target->to_terminal_ours to figure
out whether we care about lack of job control, rather than __GO32__.
* utils.c: Include serial.h not terminal.h
(quit): Use job_control not TIOCGPGRP.
* terminal.h: Don't undefine TIOCGPGRP.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c: Add SERIAL_FLUSH_OUTPUT.
* utils.c (quit): Use it.
* serial.h: Add SERIAL_UN_FDOPEN.
* utils.c (quit): Use it.
* ser-unix.c: Add process group to ttystate.
[HAVE_SGTTY]: Add tchars, ltchars, and lmode to ttystate.
* inflow.c: Include serial.h not terminal.h.
Use serial.h stuff to replace most of the maze of #ifdef's.
* inflow.c, main.c, inferior.h: make gdb_has_a_terminal a function.
* serial.h: Document SERIAL_SET_TTY_STATE as being immediate.
* ser-unix.c: Use TIOCSETN not TIOCSETP so it is true.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c:
Add SERIAL_PRINT_TTY_STATE, SERIAL_NOFLUSH_SET_TTY_STATE, and
SERIAL_SET_PROCESS_GROUP.
* inflow.c: Use them.
* config/xm-svr4.h, config/rs6000/xm-rs6000.h, config/sparc/sun4os4.h:
Define HAVE_TERMIOS.
* Various: Remove all use of TIOC*_BROKEN.
1993-06-30 22:20:53 +00:00
|
|
|
serial_t scb;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static void
|
|
|
|
go32_raw (scb)
|
|
|
|
serial_t scb;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1993-04-06 10:13:03 +00:00
|
|
|
/* Always in raw mode */
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
|
|
|
go32_readchar (scb, timeout)
|
|
|
|
serial_t scb;
|
|
|
|
int timeout;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
|
|
|
char buf;
|
1993-04-06 10:13:03 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
/* Shortcut for polling */
|
|
|
|
if (timeout == 0)
|
|
|
|
{
|
|
|
|
if (dos_async_ready ())
|
|
|
|
{
|
|
|
|
return dos_async_rx ();
|
|
|
|
}
|
|
|
|
return SERIAL_TIMEOUT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dosasync_read (scb->fd, &buf, 1, timeout))
|
1992-10-19 23:40:36 +00:00
|
|
|
return buf;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
else
|
1993-04-09 22:14:04 +00:00
|
|
|
return SERIAL_TIMEOUT;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|
|
|
|
|
1993-05-29 01:33:36 +00:00
|
|
|
/* go32_{get set}_tty_state() are both dummys to fill out the function
|
|
|
|
vector. Someday, they may do something real... */
|
|
|
|
|
|
|
|
static serial_ttystate
|
1993-12-12 00:00:53 +00:00
|
|
|
go32_get_tty_state (scb)
|
1993-05-29 01:33:36 +00:00
|
|
|
serial_t scb;
|
|
|
|
{
|
|
|
|
struct go32_ttystate *state;
|
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
state = (struct go32_ttystate *) xmalloc (sizeof *state);
|
1993-05-29 01:33:36 +00:00
|
|
|
|
1993-12-12 00:00:53 +00:00
|
|
|
return (serial_ttystate) state;
|
1993-05-29 01:33:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
1993-12-12 00:00:53 +00:00
|
|
|
go32_set_tty_state (scb, ttystate)
|
1993-05-29 01:33:36 +00:00
|
|
|
serial_t scb;
|
|
|
|
serial_ttystate ttystate;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
* inftarg.c: Remove unused include of terminal.h.
* signals.h: Don't undefine signals anymore.
* main.c: Use job_control from serial.h.
* fork-child.c (fork_inferior): Use gdb_setpgid.
* serial.h, ser-unix.c, ser-go32.c: Provide gdb_setpgid.
* utils.c (quit): Use current_target->to_terminal_ours to figure
out whether we care about lack of job control, rather than __GO32__.
* utils.c: Include serial.h not terminal.h
(quit): Use job_control not TIOCGPGRP.
* terminal.h: Don't undefine TIOCGPGRP.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c: Add SERIAL_FLUSH_OUTPUT.
* utils.c (quit): Use it.
* serial.h: Add SERIAL_UN_FDOPEN.
* utils.c (quit): Use it.
* ser-unix.c: Add process group to ttystate.
[HAVE_SGTTY]: Add tchars, ltchars, and lmode to ttystate.
* inflow.c: Include serial.h not terminal.h.
Use serial.h stuff to replace most of the maze of #ifdef's.
* inflow.c, main.c, inferior.h: make gdb_has_a_terminal a function.
* serial.h: Document SERIAL_SET_TTY_STATE as being immediate.
* ser-unix.c: Use TIOCSETN not TIOCSETP so it is true.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c:
Add SERIAL_PRINT_TTY_STATE, SERIAL_NOFLUSH_SET_TTY_STATE, and
SERIAL_SET_PROCESS_GROUP.
* inflow.c: Use them.
* config/xm-svr4.h, config/rs6000/xm-rs6000.h, config/sparc/sun4os4.h:
Define HAVE_TERMIOS.
* Various: Remove all use of TIOC*_BROKEN.
1993-06-30 22:20:53 +00:00
|
|
|
static int
|
|
|
|
go32_noflush_set_tty_state (scb, new_ttystate, old_ttystate)
|
|
|
|
serial_t scb;
|
|
|
|
serial_ttystate new_ttystate;
|
|
|
|
serial_ttystate old_ttystate;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
go32_print_tty_state (scb, ttystate)
|
|
|
|
serial_t scb;
|
|
|
|
serial_ttystate ttystate;
|
|
|
|
{
|
|
|
|
/* Nothing to print. */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
|
|
|
go32_setbaudrate (scb, rate)
|
|
|
|
serial_t scb;
|
|
|
|
int rate;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static int
|
|
|
|
go32_write (scb, str, len)
|
|
|
|
serial_t scb;
|
|
|
|
const char *str;
|
|
|
|
int len;
|
|
|
|
{
|
1993-12-12 00:00:53 +00:00
|
|
|
dosasync_write (scb->fd, str, len);
|
1993-04-09 22:14:04 +00:00
|
|
|
|
|
|
|
return 0;
|
1993-04-06 10:13:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1993-06-04 00:38:04 +00:00
|
|
|
go32_close (scb)
|
|
|
|
serial_t scb;
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1993-04-06 10:13:03 +00:00
|
|
|
static struct serial_ops go32_ops =
|
|
|
|
{
|
|
|
|
"hardwire",
|
|
|
|
0,
|
|
|
|
go32_open,
|
|
|
|
go32_close,
|
|
|
|
go32_readchar,
|
|
|
|
go32_write,
|
1993-12-12 00:00:53 +00:00
|
|
|
go32_noop, /* flush output */
|
|
|
|
go32_noop, /* flush input */
|
|
|
|
go32_noop, /* send break -- currently used only for nindy */
|
1993-04-06 10:13:03 +00:00
|
|
|
go32_raw,
|
1993-05-29 01:33:36 +00:00
|
|
|
go32_get_tty_state,
|
|
|
|
go32_set_tty_state,
|
* inftarg.c: Remove unused include of terminal.h.
* signals.h: Don't undefine signals anymore.
* main.c: Use job_control from serial.h.
* fork-child.c (fork_inferior): Use gdb_setpgid.
* serial.h, ser-unix.c, ser-go32.c: Provide gdb_setpgid.
* utils.c (quit): Use current_target->to_terminal_ours to figure
out whether we care about lack of job control, rather than __GO32__.
* utils.c: Include serial.h not terminal.h
(quit): Use job_control not TIOCGPGRP.
* terminal.h: Don't undefine TIOCGPGRP.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c: Add SERIAL_FLUSH_OUTPUT.
* utils.c (quit): Use it.
* serial.h: Add SERIAL_UN_FDOPEN.
* utils.c (quit): Use it.
* ser-unix.c: Add process group to ttystate.
[HAVE_SGTTY]: Add tchars, ltchars, and lmode to ttystate.
* inflow.c: Include serial.h not terminal.h.
Use serial.h stuff to replace most of the maze of #ifdef's.
* inflow.c, main.c, inferior.h: make gdb_has_a_terminal a function.
* serial.h: Document SERIAL_SET_TTY_STATE as being immediate.
* ser-unix.c: Use TIOCSETN not TIOCSETP so it is true.
* serial.h, ser-unix.c, ser-go32.c, ser-tcp.c:
Add SERIAL_PRINT_TTY_STATE, SERIAL_NOFLUSH_SET_TTY_STATE, and
SERIAL_SET_PROCESS_GROUP.
* inflow.c: Use them.
* config/xm-svr4.h, config/rs6000/xm-rs6000.h, config/sparc/sun4os4.h:
Define HAVE_TERMIOS.
* Various: Remove all use of TIOC*_BROKEN.
1993-06-30 22:20:53 +00:00
|
|
|
go32_print_tty_state,
|
|
|
|
go32_noflush_set_tty_state,
|
|
|
|
go32_setbaudrate,
|
1993-04-06 10:13:03 +00:00
|
|
|
};
|
|
|
|
|
* Makefile.in (init.c): Generate using the source, not munch. This
cleans up all kinds of hassles (which nm to use in munch, etc). The
new formatting conventions (mostly already followed) are that
the name of the _initialize_* routines must start in column zero,
and must not be inside #if.
* munch: Removed.
* Makefile.in: Remove references to munch.
* serial.c, remote.c, infptrace.c, maint.c, convex-tdep.c,
alpha-tdep.c, hp300ux-nat.c, hppab-nat.c, osfsolib.c, remote-es.c,
procfs.c, remote-udi.c, ser-go32.c, ultra3-xdep.c, sh-tdep.c,
i960-tdep.c, hppa-tdep.c, h8500-tdep.c, dpx2-nat.c, delta68-nat.c,
z8k-tdep.c: Make sure the above conventions are followed. Make
sure they are all declared as returning void. Clean up
miscellaneous comments and such.
1993-10-22 05:55:58 +00:00
|
|
|
void
|
1993-04-06 10:13:03 +00:00
|
|
|
_initialize_ser_go32 ()
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
{
|
1993-04-06 10:13:03 +00:00
|
|
|
serial_add_interface (&go32_ops);
|
Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
allowing hosts with different text and binary file formats to
work.
* coffread.c (read_coff_symtab): changed calling convention and
operation - now it opens its own file with FOPEN_RB rather than
duping and fdopening the provided handle.
* dbxread.c, cplus-dem.c: #include mangling.
* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
binary files oring in the right bit.
* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
* remote-hms.c: cleanup to use the new remote serial stuff
* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
independent remote terminal I/O.
* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
* source.c (openp): fix off by one problem removing / - can now
open a source file in the root directory with DOS.
* values.c (value_as_pointer): remove bogus address bits from
long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
|
|
|
}
|