OSDN Git Service

Corrected spelling errors in comments
authordavea <davea>
Mon, 23 Oct 2000 22:49:28 +0000 (22:49 +0000)
committerdavea <davea>
Mon, 23 Oct 2000 22:49:28 +0000 (22:49 +0000)
gdb/ChangeLog
gdb/TODO
gdb/command.c
gdb/config/nm-lynx.h
gdb/corelow.c
gdb/main.c
gdb/mips-tdep.c
gdb/remote.c
gdb/serial.h
gdb/top.c
gdb/utils.c

index a698f1a..ab50cd1 100644 (file)
@@ -1,3 +1,11 @@
+2000-10-23 David B Anderson <davea@sgi.com>
+
+       * TODO: Correct spelling errors
+       * command.c (_initialize_command) corelow.c (core_open)
+       main.c (captured_command_loop) mips-tdep.c (mips32_next_pc)
+       remote.c serial.h top.c utils.c config/nm-lynx.h:
+       Correct spelling errors in comments
+
 2000-10-22  Kevin Buettner  <kevinb@redhat.com>
 
        * sparc-nat.c (fetch_core_registers): Protoize.
@@ -32,6 +40,7 @@ Fri Oct 20 19:08:47 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * remote-utils.c (gr_multi_scan): Protoize.
        * remote-vx.c (vx_xfer_memory, net_get_symbols): Protoize.
 
+>>>>>>> 1.717
 2000-10-13  Fernando Nasser  <fnasser@cygnus.com>
 
        * remote.c (putpkt_binary): Call read_frame, not getpkt. Log message.
@@ -124,6 +133,7 @@ Fri Oct 20 19:08:47 2000  Andrew Cagney  <cagney@b1.cygnus.com>
        * rs6000-tdep.c (skip_prologue): Add new parameter lim_pc.
        Update all callers.
 
+>>>>>>> 1.709
 2000-10-03  Kevin Buettner  <kevinb@redhat.com>
 
        * remote-bug.c (bug_xfer_memory, bug_insert_breakpoint,
index a6247ca..2cf6bc4 100644 (file)
--- a/gdb/TODO
+++ b/gdb/TODO
@@ -71,7 +71,7 @@ Dan Nicolaescu writes:
 > stoping in weak functions. 
 > 
 > It stops in a function that is defined as weak, not in the function
-> that is actualy run... 
+> that is actually run... 
 
 --
 
@@ -314,7 +314,7 @@ determine the default isa/byte-order.
 
 --
 
-Rely on BFD_BIG_ENDIAN and BFD_LITTLE_ENDIAN instead of host dependant
+Rely on BFD_BIG_ENDIAN and BFD_LITTLE_ENDIAN instead of host dependent
 BIG_ENDIAN and LITTLE_ENDIAN.
 
 --
@@ -508,7 +508,7 @@ http://sourceware.cygnus.com/ml/gdb-patches/2000-07/msg00042.html
 Apart from the d30v, are there any sim/common simulators that make use
 of this?
 
-A brief summary of what happended is that sim/common/sim-break.c was
+A brief summary of what happened is that sim/common/sim-break.c was
 created as a good idea.  It turned out a better idea was to use
 SIM_SIGBREAK and have GDB pass back sim_resume (..., SIGBREAK).
 
@@ -604,7 +604,7 @@ Document overlay machinery.
 
 ``(gdb) catch signal SIGNAL''
 
-Overlaps with ``handle SIGNAL'' but the implied behavour is different.
+Overlaps with ``handle SIGNAL'' but the implied behavior is different.
 You can attach commands to a catch but not a handle.  A handle has a
 limited number of hardwired actions.
 
@@ -806,7 +806,7 @@ Rename read_register{,_pid}() to read_unsigned_register{,_pid}().
 
 If / when GDB starts to support the debugging of multi-processor
 (rather than multi-thread) applications the symtab code will need to
-be updated a little so that several independant symbol tables are
+be updated a little so that several independent symbol tables are
 active at a given time.
 
 The other interesting change is a clarification of the exact meaning
@@ -902,7 +902,7 @@ did have a frame pointer register.  Modern architectures typically
 construct a virtual frame-handle from the stack pointer and various
 other bits of string.
 
-Unfortunatly GDB still treats this synthetic FP register as though it
+Unfortunately GDB still treats this synthetic FP register as though it
 is real.  That in turn really confuses users (arm and ``print $fp'' VS
 ``info registers fp'').  The synthetic FP should be separated out of
 the true register set presented to the user.
@@ -956,10 +956,10 @@ How I would like the register file to work is more like:
              |
         map random cache
         bytes to target
-        dependant i-face
+        dependent i-face
             /|\
              |
-       target dependant
+       target dependent
         such as [gG] packet
         or ptrace buffer
 
@@ -990,7 +990,7 @@ The main objectives being:
 
         o       a mechanism that clearly separates the
                 gdb internal register cache from any
-                target (not architecture) dependant
+                target (not architecture) dependent
                 specifics such as [gG] packets.
 
 Of course, like anything, it sounds good in theory.  In reality, it
@@ -1075,7 +1075,7 @@ Fix target_signal_from_host() etc.
 
 The name is wrong for starters.  ``target_signal'' should probably be
 ``gdb_signal''.  ``from_host'' should be ``from_target_signal''.
-After that it needs to be multi-arched and made independant of any
+After that it needs to be multi-arched and made independent of any
 host signal numbering.
 
 --
@@ -1222,7 +1222,7 @@ The serial code already does this.
 
 --
 
-Make MI interface accessable from existing CLI.
+Make MI interface accessible from existing CLI.
 
 --
 
@@ -1337,7 +1337,7 @@ What should happen is that ``target xxxx'' should call a generic
 open an asynchronous target that may need to perform background tasks
 as part of the ``attach'' phase.
 
-Unfortunatly, due to limitations in the old/creaking command.h
+Unfortunately, due to limitations in the old/creaking command.h
 interface, that isn't possible.  The function being called isn't told
 of the ``xxx'' or any other context information.
 
index 56fb85e..4fc9aa1 100644 (file)
@@ -2045,7 +2045,7 @@ _initialize_command (void)
 With no arguments, run an inferior shell.");
 
   /* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
-     be a really useful feature.  Unfortunatly, the below wont do
+     be a really useful feature.  Unfortunately, the below wont do
      this.  Instead it adds support for the form ``(gdb) ! ls''
      (i.e. the space is required).  If the ``!'' command below is
      added the complains about no ``!'' command would be replaced by
index 4a6f6e4..bdb1dfb 100644 (file)
@@ -73,7 +73,7 @@
 extern int child_wait (int pid, struct target_waitstatus *status);
 
 /* Lynx needs a special definition of this so that we can
-   print out the pid and thread number seperatly.  */
+   print out the pid and thread number seperately.  */
 
 
 /* override child_pid_to_str in inftarg.c */
index 4c7ac9f..148f5f4 100644 (file)
@@ -329,7 +329,7 @@ core_open (char *filename, int from_tty)
   siggy = bfd_core_file_failing_signal (core_bfd);
   if (siggy > 0)
     /* NOTE: target_signal_from_host() converts a target signal value
-       into gdb's internal signal value.  Unfortunatly gdb's internal
+       into gdb's internal signal value.  Unfortunately gdb's internal
        value is called ``target_signal'' and this function got the
        name ..._from_host(). */
     printf_filtered ("Program terminated with signal %d, %s.\n", siggy,
index c6b9516..9ed2e2a 100644 (file)
@@ -105,7 +105,7 @@ captured_command_loop (void *data)
   /* FIXME: cagney/1999-11-05: A correct command_loop() implementaton
      would clean things up (restoring the cleanup chain) to the state
      they were just prior to the call.  Technically, this means that
-     the do_cleanups() below is redundant.  Unfortunatly, many FUNC's
+     the do_cleanups() below is redundant.  Unfortunately, many FUNCs
      are not that well behaved.  do_cleanups should either be replaced
      with a do_cleanups call (to cover the problem) or an assertion
      check to detect bad FUNCs code. */
index 20d5446..cf48ced 100644 (file)
@@ -819,7 +819,7 @@ mips32_next_pc (CORE_ADDR pc)
 }                              /* mips32_next_pc */
 
 /* Decoding the next place to set a breakpoint is irregular for the
-   mips 16 variant, but fortunatly, there fewer instructions. We have to cope
+   mips 16 variant, but fortunately, there fewer instructions. We have to cope
    ith extensions for 16 bit instructions and a pair of actual 32 bit instructions.
    We dont want to set a single step instruction on the extend instruction
    either.
index ef2f8b4..61a730e 100644 (file)
@@ -2192,7 +2192,7 @@ serial device is attached to the remote system\n\
 
   /* FIXME: cagney/1999-09-23: During the initial connection it is
      assumed that the target is already ready and able to respond to
-     requests. Unfortunatly remote_start_remote() eventually calls
+     requests. Unfortunately remote_start_remote() eventually calls
      wait_for_inferior() with no timeout.  wait_forever_enabled_p gets
      around this. Eventually a mechanism that allows
      wait_for_inferior() to expect/get timeouts will be
index 04332bc..0fea8ea 100644 (file)
 /* Remote serial support interface definitions for GDB, the GNU Debugger.
-   Copyright 1992, 1993 Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1999, 2000 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   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 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.
+   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.  */
+   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.  */
 
 #ifndef SERIAL_H
 #define SERIAL_H
 
-/* Terminal state pointer.  This is specific to each type of interface. */
-
-typedef PTR serial_ttystate;
+/* For most routines, if a failure is indicated, then errno should be
+   examined.  */
 
-struct _serial_t
-{
-  int fd;                      /* File descriptor */
-  struct serial_ops *ops;      /* Function vector */
-  serial_ttystate ttystate;    /* Not used (yet) */
-  int bufcnt;                  /* Amount of data in receive buffer */
-  unsigned char *bufp;         /* Current byte */
-  unsigned char buf[BUFSIZ];   /* Da buffer itself */
-  int current_timeout;         /* (termio{s} only), last value of VTIME */
-  /* ser-unix.c termio{,s} only, we still need to wait for this many more
-     seconds.  */
-  int timeout_remaining;
-  char *name;                  /* The name of the device or host */
-  struct _serial_t *next;      /* Pointer to the next serial_t */
-  int refcnt;                  /* Number of pointers to this block */
-};
+/* Terminal state pointer.  This is specific to each type of
+   interface. */
 
+typedef void *serial_ttystate;
+struct _serial_t;
 typedef struct _serial_t *serial_t;
 
-struct serial_ops {
-  char *name;
-  struct serial_ops *next;
-  int (*open) PARAMS ((serial_t, const char *name));
-  void (*close) PARAMS ((serial_t));
-  int (*readchar) PARAMS ((serial_t, int timeout));
-  int (*write) PARAMS ((serial_t, const char *str, int len));
-  /* Discard pending output */
-  int (*flush_output) PARAMS ((serial_t));
-  /* Discard pending input */
-  int (*flush_input) PARAMS ((serial_t));
-  int (*send_break) PARAMS ((serial_t));
-  void (*go_raw) PARAMS ((serial_t));
-  serial_ttystate (*get_tty_state) PARAMS ((serial_t));
-  int (*set_tty_state) PARAMS ((serial_t, serial_ttystate));
-  void (*print_tty_state) PARAMS ((serial_t, serial_ttystate));
-  int (*noflush_set_tty_state)
-    PARAMS ((serial_t, serial_ttystate, serial_ttystate));
-  int (*setbaudrate) PARAMS ((serial_t, int rate));
-  int (*setstopbits) PARAMS ((serial_t, int num));
-  /* Wait for output to drain */
-  int (*drain_output) PARAMS ((serial_t));
-};
+/* Try to open NAME.  Returns a new serial_t on success, NULL on
+   failure. */
 
-/* Add a new serial interface to the interface list */
+extern serial_t serial_open (const char *name);
+#define SERIAL_OPEN(NAME) serial_open(NAME)
 
-void serial_add_interface PARAMS ((struct serial_ops *optable));
+/* Open a new serial stream using a file handle.  */
 
-serial_t serial_open PARAMS ((const char *name));
+extern serial_t serial_fdopen (const int fd);
+#define SERIAL_FDOPEN(FD) serial_fdopen(FD)
 
-serial_t serial_fdopen PARAMS ((const int fd));
+/* Push out all buffers, close the device and destroy SERIAL_T. */
 
-/* For most routines, if a failure is indicated, then errno should be
-   examined.  */
+extern void serial_close (serial_t);
+#define SERIAL_CLOSE(SERIAL_T) serial_close ((SERIAL_T))
 
-/* Try to open NAME.  Returns a new serial_t on success, NULL on failure.
- */
+/* Push out all buffers and destroy SERIAL_T without closing the
  device.  */
 
-#define SERIAL_OPEN(NAME) serial_open(NAME)
+extern void serial_un_fdopen (serial_t scb);
+#define SERIAL_UN_FDOPEN(SERIAL_T) serial_un_fdopen ((SERIAL_T))
 
-/* Open a new serial stream using a file handle.  */
+/* Read one char from the serial device with TIMEOUT seconds to wait
+   or -1 to wait forever.  Use timeout of 0 to effect a poll.
+   Infinite waits are not permitted. Returns unsigned char if ok, else
+   one of the following codes.  Note that all error return-codes are
+   guaranteed to be < 0. */
+
+enum serial_rc {
+  SERIAL_ERROR = -1,   /* General error. */
+  SERIAL_TIMEOUT = -2, /* Timeout or data-not-ready during read.
+                          Unfortunately, through ui_loop_hook(), this
+                          can also be a QUIT indication.  */
+  SERIAL_EOF = -3      /* General end-of-file or remote target
+                          connection closed, indication.  Includes
+                          things like the line dropping dead. */
+};
 
-#define SERIAL_FDOPEN(FD) serial_fdopen(FD)
+extern int serial_readchar (serial_t scb, int timeout);
+#define SERIAL_READCHAR(SERIAL_T, TIMEOUT) serial_readchar ((SERIAL_T), (TIMEOUT))
+
+/* Write LEN chars from STRING to the port SERIAL_T.  Returns 0 for
+   success, non-zero for failure.  */
+
+extern int serial_write (serial_t scb, const char *str, int len);
+#define SERIAL_WRITE(SERIAL_T, STRING,LEN)  serial_write (SERIAL_T, STRING, LEN)
+
+/* Write a printf style string onto the serial port. */
+
+extern void serial_printf (serial_t desc, const char *,...) ATTR_FORMAT (printf, 2, 3);
 
 /* Allow pending output to drain. */
 
-#define SERIAL_DRAIN_OUTPUT(SERIAL_T) \
-  ((SERIAL_T)->ops->drain_output((SERIAL_T)))
-  
-/* Flush (discard) pending output.  Might also flush input (if this system can't flush
-   only output).  */
+extern int serial_drain_output (serial_t);
+#define SERIAL_DRAIN_OUTPUT(SERIAL_T) serial_drain_output ((SERIAL_T))
 
-#define SERIAL_FLUSH_OUTPUT(SERIAL_T) \
-  ((SERIAL_T)->ops->flush_output((SERIAL_T)))
+/* Flush (discard) pending output.  Might also flush input (if this
+   system can't flush only output).  */
 
-/* Flush pending input.  Might also flush output (if this system can't flush
-   only input).  */
+extern int serial_flush_output (serial_t);
+#define SERIAL_FLUSH_OUTPUT(SERIAL_T) serial_flush_output ((SERIAL_T))
 
-#define SERIAL_FLUSH_INPUT(SERIAL_T)\
-  ((*(SERIAL_T)->ops->flush_input) ((SERIAL_T)))
+/* Flush pending input.  Might also flush output (if this system can't
+   flush only input).  */
 
-/* Send a break between 0.25 and 0.5 seconds long.  */
+extern int serial_flush_input (serial_t);
+#define SERIAL_FLUSH_INPUT(SERIAL_T) serial_flush_input ((SERIAL_T))
 
-extern int serial_send_break PARAMS ((serial_t scb));
+/* Send a break between 0.25 and 0.5 seconds long.  */
 
+extern int serial_send_break (serial_t scb);
 #define SERIAL_SEND_BREAK(SERIAL_T) serial_send_break (SERIAL_T)
 
 /* Turn the port into raw mode. */
 
-#define SERIAL_RAW(SERIAL_T) (SERIAL_T)->ops->go_raw((SERIAL_T))
+extern void serial_raw (serial_t scb);
+#define SERIAL_RAW(SERIAL_T) serial_raw ((SERIAL_T))
 
 /* Return a pointer to a newly malloc'd ttystate containing the state
    of the tty.  */
-#define SERIAL_GET_TTY_STATE(SERIAL_T) (SERIAL_T)->ops->get_tty_state((SERIAL_T))
+
+extern serial_ttystate serial_get_tty_state (serial_t scb);
+#define SERIAL_GET_TTY_STATE(SERIAL_T) serial_get_tty_state ((SERIAL_T))
 
 /* Set the state of the tty to TTYSTATE.  The change is immediate.
    When changing to or from raw mode, input might be discarded.
-   Returns 0 for success, negative value for error (in which case errno
-   contains the error).  */
-#define SERIAL_SET_TTY_STATE(SERIAL_T, TTYSTATE) (SERIAL_T)->ops->set_tty_state((SERIAL_T), (TTYSTATE))
+   Returns 0 for success, negative value for error (in which case
+   errno contains the error).  */
+
+extern int serial_set_tty_state (serial_t scb, serial_ttystate ttystate);
+#define SERIAL_SET_TTY_STATE(SERIAL_T, TTYSTATE) serial_set_tty_state ((SERIAL_T), (TTYSTATE))
+
+/* printf_filtered a user-comprehensible description of ttystate on
+   the specified STREAM. FIXME: At present this sends output to the
+   default stream - GDB_STDOUT. */
 
-/* printf_filtered a user-comprehensible description of ttystate.  */
-#define SERIAL_PRINT_TTY_STATE(SERIAL_T, TTYSTATE) \
-  ((*((SERIAL_T)->ops->print_tty_state)) ((SERIAL_T), (TTYSTATE)))
+extern void serial_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *);
+#define SERIAL_PRINT_TTY_STATE(SERIAL_T, TTYSTATE, STREAM) serial_print_tty_state ((SERIAL_T), (TTYSTATE), (STREAM))
 
 /* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
    current state (generally obtained from a recent call to
    SERIAL_GET_TTY_STATE), but be careful not to discard any input.
-   This means that we never switch in or out of raw mode, even
-   if NEW_TTYSTATE specifies a switch.  */
+   This means that we never switch in or out of raw mode, even if
+   NEW_TTYSTATE specifies a switch.  */
+
+extern int serial_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
 #define SERIAL_NOFLUSH_SET_TTY_STATE(SERIAL_T, NEW_TTYSTATE, OLD_TTYSTATE) \
-  ((*((SERIAL_T)->ops->noflush_set_tty_state)) \
-    ((SERIAL_T), (NEW_TTYSTATE), (OLD_TTYSTATE)))
+serial_noflush_set_tty_state ((SERIAL_T), (NEW_TTYSTATE), (OLD_TTYSTATE))
 
-/* Read one char from the serial device with TIMEOUT seconds to wait
-   or -1 to wait forever.  Use timeout of 0 to effect a poll. Returns
-   char if ok, else one of the following codes.  Note that all error
-   codes are guaranteed to be < 0.  */
+/* Set the baudrate to the decimal value supplied.  Returns 0 for
+   success, -1 for failure.  */
 
-#define SERIAL_ERROR -1                /* General error, see errno for details */
-#define SERIAL_TIMEOUT -2
-#define SERIAL_EOF -3
+extern int serial_setbaudrate (serial_t scb, int rate);
+#define SERIAL_SETBAUDRATE(SERIAL_T, RATE) serial_setbaudrate ((SERIAL_T), (RATE))
 
-extern int serial_readchar PARAMS ((serial_t scb, int timeout));
+/* Set the number of stop bits to the value specified.  Returns 0 for
+   success, -1 for failure.  */
 
-#define SERIAL_READCHAR(SERIAL_T, TIMEOUT)  serial_readchar (SERIAL_T, TIMEOUT)
+#define SERIAL_1_STOPBITS 1
+#define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
+#define SERIAL_2_STOPBITS 3
 
-/* Set the baudrate to the decimal value supplied.  Returns 0 for success,
-   -1 for failure.  */
+extern int serial_setstopbits (serial_t scb, int num);
+#define SERIAL_SETSTOPBITS(SERIAL_T, NUM) serial_setstopbits ((SERIAL_T), (NUM))
 
-#define SERIAL_SETBAUDRATE(SERIAL_T, RATE) ((SERIAL_T)->ops->setbaudrate((SERIAL_T), RATE))
+/* Asynchronous serial interface: */
 
-/* Set the number of stop bits to the value specified.  Returns 0 for success,
-   -1 for failure.  */
+/* Can the serial device support asynchronous mode? */
 
-#define SERIAL_1_STOPBITS 1
-#define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
-#define SERIAL_2_STOPBITS 3
+extern int serial_can_async_p (serial_t scb);
+#define SERIAL_CAN_ASYNC_P(SERIAL_T) serial_can_async_p ((SERIAL_T))
 
-#define SERIAL_SETSTOPBITS(SERIAL_T, NUM) ((SERIAL_T)->ops->setstopbits((SERIAL_T), NUM))
+/* Has the serial device been put in asynchronous mode? */
 
-/* Write LEN chars from STRING to the port SERIAL_T.  Returns 0 for
-   success, non-zero for failure.  */
+extern int serial_is_async_p (serial_t scb);
+#define SERIAL_IS_ASYNC_P(SERIAL_T) serial_is_async_p ((SERIAL_T))
 
-extern int serial_write PARAMS ((serial_t scb, const char *str, int len));
+/* For ASYNC enabled devices, register a callback and enable
+   asynchronous mode.  To disable asynchronous mode, register a NULL
+   callback. */
 
-#define SERIAL_WRITE(SERIAL_T, STRING,LEN)  serial_write (SERIAL_T, STRING, LEN)
+typedef void (serial_event_ftype) (serial_t scb, void *context);
+extern void serial_async (serial_t scb, serial_event_ftype *handler, void *context);
+#define SERIAL_ASYNC(SERIAL_T, HANDLER, CONTEXT) serial_async ((SERIAL_T), (HANDLER), (CONTEXT)) 
 
-/* Push out all buffers, close the device and destroy SERIAL_T. */
+/* Provide direct access to the underlying FD (if any) used to
+   implement the serial device.  This interface is clearly
+   deprecated. Will call internal_error() if the operation isn't
+   applicable to the current serial device. */
+
+extern int deprecated_serial_fd (serial_t scb);
+#define DEPRECATED_SERIAL_FD(SERIAL_T) deprecated_serial_fd ((SERIAL_T))
+
+/* Trace/debug mechanism.
 
-extern void serial_close PARAMS ((serial_t, int));
+   SERIAL_DEBUG() enables/disables internal debugging.
+   SERIAL_DEBUG_P() indicates the current debug state. */
 
-#define SERIAL_CLOSE(SERIAL_T) serial_close(SERIAL_T, 1)
+extern void serial_debug (serial_t scb, int debug_p);
+#define SERIAL_DEBUG(SERIAL_T, DEBUG_P) serial_debug ((SERIAL_T), (DEBUG_P))
 
-/* Push out all buffers and destroy SERIAL_T without closing the device.  */
+extern int serial_debug_p (serial_t scb);
+#define SERIAL_DEBUG_P(SERIAL_T) serial_debug_p ((SERIAL_T))
 
-#define SERIAL_UN_FDOPEN(SERIAL_T) serial_close(SERIAL_T, 0)
 
-extern void serial_printf PARAMS ((serial_t desc, const char *, ...))
-     ATTR_FORMAT(printf, 2, 3);
+/* Details of an instance of a serial object */
+
+struct _serial_t
+  {
+    int fd;                    /* File descriptor */
+    struct serial_ops *ops;    /* Function vector */
+    void *state;                       /* Local context info for open FD */
+    serial_ttystate ttystate;  /* Not used (yet) */
+    int bufcnt;                        /* Amount of data remaining in receive
+                                  buffer.  -ve for sticky errors. */
+    unsigned char *bufp;       /* Current byte */
+    unsigned char buf[BUFSIZ]; /* Da buffer itself */
+    int current_timeout;       /* (ser-unix.c termio{,s} only), last
+                                  value of VTIME */
+    int timeout_remaining;     /* (ser-unix.c termio{,s} only), we
+                                  still need to wait for this many
+                                  more seconds.  */
+    char *name;                        /* The name of the device or host */
+    struct _serial_t *next;    /* Pointer to the next serial_t */
+    int refcnt;                        /* Number of pointers to this block */
+    int debug_p;               /* Trace this serial devices operation. */
+    int async_state;           /* Async internal state. */
+    void *async_context;       /* Async event thread's context */
+    serial_event_ftype *async_handler;/* Async event handler */
+  };
+
+struct serial_ops
+  {
+    char *name;
+    struct serial_ops *next;
+    int (*open) (serial_t, const char *name);
+    void (*close) (serial_t);
+    int (*readchar) (serial_t, int timeout);
+    int (*write) (serial_t, const char *str, int len);
+    /* Discard pending output */
+    int (*flush_output) (serial_t);
+    /* Discard pending input */
+    int (*flush_input) (serial_t);
+    int (*send_break) (serial_t);
+    void (*go_raw) (serial_t);
+    serial_ttystate (*get_tty_state) (serial_t);
+    int (*set_tty_state) (serial_t, serial_ttystate);
+    void (*print_tty_state) (serial_t, serial_ttystate, struct ui_file *);
+    int (*noflush_set_tty_state) (serial_t, serial_ttystate, serial_ttystate);
+    int (*setbaudrate) (serial_t, int rate);
+    int (*setstopbits) (serial_t, int num);
+    /* Wait for output to drain */
+    int (*drain_output) (serial_t);
+    /* Change the serial device into/out of asynchronous mode, call
+       the specified function when ever there is something
+       interesting. */
+    void (*async) (serial_t scb, int async_p);
+  };
+
+/* Add a new serial interface to the interface list */
+
+extern void serial_add_interface (struct serial_ops * optable);
 
 /* File in which to record the remote debugging session */
 
-extern void serial_log_command PARAMS ((const char *));
+extern void serial_log_command (const char *);
 
 #endif /* SERIAL_H */
index ccb6aec..813a5ba 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -564,7 +564,7 @@ return_to_top_level (enum return_reason reason)
    code also randomly used a SET_TOP_LEVEL macro that directly
    initialize the longjmp buffers. */
 
-/* MAYBE: cagney/1999-11-05: Should the catch_erros and cleanups code
+/* MAYBE: cagney/1999-11-05: Should the catch_errors and cleanups code
    be consolidated into a single file instead of being distributed
    between utils.c and top.c? */
 
@@ -607,9 +607,9 @@ catch_errors (catch_errors_ftype *func, PTR args, char *errstring,
     val = (*func) (args);
   catch_return = saved_catch;
 
-  /* FIXME: cagney/1999-11-05: A correct FUNC implementaton will
+  /* FIXME: cagney/1999-11-05: A correct FUNC implementation will
      clean things up (restoring the cleanup chain) to the state they
-     were just prior to the call.  Unfortunatly, many FUNC's are not
+     were just prior to the call.  Unfortunately, many FUNC's are not
      that well behaved.  This could be fixed by adding either a
      do_cleanups call (to cover the problem) or an assertion check to
      detect bad FUNCs code. */
@@ -672,7 +672,7 @@ do_captured_command (void *data)
   /* FIXME: cagney/1999-11-07: Technically this do_cleanups() call
      isn't needed.  Instead an assertion check could be made that
      simply confirmed that the called function correctly cleaned up
-     after its self.  Unfortunatly, old code (prior to 1999-11-04) in
+     after itself.  Unfortunately, old code (prior to 1999-11-04) in
      main.c was calling SET_TOP_LEVEL(), calling the command function,
      and then *always* calling do_cleanups().  For the moment we
      remain ``bug compatible'' with that old code..  */
index e3e88df..0046e09 100644 (file)
@@ -607,7 +607,7 @@ verror (const char *string, va_list args)
   char *err_string;
   struct cleanup *err_string_cleanup;
   /* FIXME: cagney/1999-11-10: All error calls should come here.
-     Unfortunatly some code uses the sequence: error_begin(); print
+     Unfortunately some code uses the sequence: error_begin(); print
      error message; return_to_top_level.  That code should be
      flushed. */
   error_begin ();