* serial.c (serial_interface_lookup): Take a const char pointer.
(serial_fdopen): Rename to ...
(serial_fdopen_ops): ... this. Add an OPS parameter and use it.
Call the OPS' fdopen function if there is one.
(serial_fdopen): Rewrite as wrapper to serial_fdopen_ops.
(serial_pipe): New.
(struct serial_ops) <fdopen>: New field.
* ser-mingw.c (free_pipe_state):
(free_pipe_state): Close output on non-pex pipes.
(pipe_windows_fdopen): New.
(gdb_pipe): New.
(_initialize_ser_windows): Register pipe_windows_fdopen.
* ser-go32.c (gdb_pipe): New.
* ser-pipe.c (pipe_close): Close file descriptor even if there's
no state pointer.
(pipe_ops): Delete.
(gdb_pipe): New.
* scm-exp.c: White space.
* scm-lang.c: White space.
* scm-valprint.c: White space.
* sentinel-frame.c: White space.
* ser-base.c: White space.
* ser-go32.c: White space.
* serial.c: White space.
* ser-mingw.c: White space.
* ser-pipe.c: White space.
* ser-tcp.c: White space.
* ser-unix.c: White space.
* solib.c: White space.
* solib-darwin.c: White space.
* solib-frv.c: White space.
* solib-irix.c: White space.
* solib-osf.c: White space.
* solib-pa64.c: White space.
* solib-som.c: White space.
* solib-spu.c: White space.
* solib-svr4.c: White space.
* solib-target.c: White space.
* source.c: White space.
* stabsread.c: White space.
* stack.c: White space.
* std-regs.c: White space.
* symfile.c: White space.
* symmisc.c: White space.
* symtab.c: White space.
* ser-tcp.c (ser_tcp_send_break): New function.
(_initialize_ser_tcp): Use ser_tcp_send_break.
* ser-tcp.h (ser_tcp_send_break): New prototype.
2008-09-03 Angela Marie Thomas <angela@releasedominatrix.com>
* gdb.texinfo (Interrupts): Mention TCP interface for
sending BREAK.
via gdb_stderr.
* serial.c (serial_open): Set error_fd to -1.
* serial.h (struct serial): New field error_fd.
(struct serial_opts): New field avail.
* ser-pipe.c (pipe_open): Create another pair
of sockets. Pass stderr to gdb.
* ser-mingw.c (pipe_windows_open): Pass
PEX_STDERR_TO_PIPE to pex_run. Initialize
sd->error_fd.
(pipe_avail): New.
(_initialize_ser_windows): Hook pipe_avail.
* ser-base.c (generic_readchar): Check if there's
anything in stderr channel and route that to gdb_stderr.
Add support for 'target remote |' on MinGW.
* ser-mingw.c (struct pipe_state): New structure.
(make_pipe_state, free_pipe_state, cleanup_pipe_state)
(pipe_windows_open, pipe_windows_close, pipe_windows_read)
(pipe_windows_write, pipe_wait_handle): New functions.
(_initialize_ser_windows): Register a "pipe" interface based on
them.
(struct ser_console_state, struct net_windows_state): Add exit_select,
have_stopped, thread.
(pipe_select_thread, console_select_thread)
(net_windows_select_thread): Don't create a local state copy or
close stop_select. Exit on exit_select instead of stop_select. Set
have_stopped.
(console_select_thread): Don't report control keypresses as pending
input.
(pipe_select_thread): Allow stop_select to interrupt sleeping.
(set_console_wait_handle): Create exit_select and have_stopped.
Save the thread handle. Check _kbhit before starting a thread.
(ser_console_done_wait_handle): New.
(ser_console_close): Close new handles. Wait for the thread to
exit.
(new_windows_select_thread): Assert that an event occurred.
(net_windows_wait_handle): Check for pending input before starting
a thread.
(net_windows_done_wait_handle): New.
(net_windows_open): Create exit_select and have_stopped.
Save the thread handle.
(net_windows_close): Close new handles. Wait for the thread to
exit.
(_intiialize_ser_windows): Register done_wait_handle methods.
* serial.c [USE_WIN32API] (serial_done_wait_handle): New.
* serial.h [USE_WIN32API] (struct serial_ops): Add done_wait_handle.
[USE_WIN32API] (serial_done_wait_handle): New prototype.
* mingw-hdep.c (gdb_select): Use serial_done_wait_handle.
* Makefile.in (gdb_select_h, ser_tcp_h): New.
(ALLDEPFILES): Add ser-mingw.c.
(event-loop.o, inflow.o, mingw-hdep.o, posix-hdep.o, ser-base.o)
(ser-tcp.o, ser-unix.o): Update.
(ser-mingw.o): New rule.
* configure: Regenerated.
* configure.ac: Add ser-mingw.o for mingw32.
* ser-mingw.c: New file.
* event-loop.c: Include "gdb_select.h".
(gdb_select): Remove, moved to mingw-hdep.c and posix-hdep.c.
* ser-base.c: Include "gdb_select.h".
(ser_base_wait_for): Use gdb_select.
* serial.c (serial_for_fd): New function.
(serial_fdopen): Try "terminal" before "hardwire". Initialize
the allocated struct serial.
(serial_wait_handle): New function.
* serial.h (serial_for_fd, serial_wait_handle): New prototypes.
(struct serial_ops) [USE_WIN32API]: Add wait_handle.
* gdb_select.h: New file.
* ser-tcp.c: Include "ser-tcp.h". Remove unused "ser-unix.h" include.
(net_close, net_read_prim, net_write_prim): Make global.
(net_open): Likewise. Pass an exception set to select. Whitespace fix.
Document why we can not use gdb_select.
(_initialize_ser_tcp) [USE_WIN32API]: Do not register TCP support here.
* ser-tcp.h: New file.
* inflow.c (gdb_has_a_terminal): Don't initialize stdin_serial here.
(handle_sigio): Use gdb_select.
(initialize_stdin_serial): New function.
* terminal.h (initialize_stdin_serial): New prototype.
* top.c (gdb_init): Call initialize_stdin_serial.
* mingw-hdep.c (gdb_select): New function, moved from gdb_select in
event-loop.c. Add exception condition support. Use serial_for_fd
and serial_wait_handle. Fix timeout handling.
* posix-hdep.c: Include "gdb_select.h".
(gdb_select): New function.
* remote-st.c (connect_command): Use gdb_select.
* ser-unix.c: Include "gdb_select.h".
(hardwire_send_break, wait_for): Use gdb_select.