2005-06-13 23:32:01 +02:00
|
|
|
/* Serial interface for raw TCP connections on Un*x like systems.
|
|
|
|
|
2014-01-01 04:54:24 +01:00
|
|
|
Copyright (C) 1992-2014 Free Software Foundation, Inc.
|
1999-04-16 03:35:26 +02:00
|
|
|
|
1999-07-07 22:19:36 +02:00
|
|
|
This file is part of GDB.
|
1999-04-16 03:35:26 +02:00
|
|
|
|
1999-07-07 22:19:36 +02: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
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-07-07 22:19:36 +02:00
|
|
|
(at your option) any later version.
|
1999-04-16 03:35:26 +02:00
|
|
|
|
1999-07-07 22:19:36 +02: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.
|
1999-04-16 03:35:26 +02:00
|
|
|
|
1999-07-07 22:19:36 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "serial.h"
|
2005-03-25 20:47:23 +01:00
|
|
|
#include "ser-base.h"
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
#include "ser-tcp.h"
|
2009-01-06 18:07:08 +01:00
|
|
|
#include "gdbcmd.h"
|
|
|
|
#include "cli/cli-decode.h"
|
|
|
|
#include "cli/cli-setshow.h"
|
PR gdb/7912:
* Makefile.in (SFILES): Add filestuff.c
(COMMON_OBS): Add filestuff.o.
(filestuff.o): New target.
* auto-load.c (auto_load_objfile_script_1): Use
gdb_fopen_cloexec.
* auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec.
* cli/cli-cmds.c (shell_escape): Call close_most_fds.
* cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec.
* common/agent.c (gdb_connect_sync_socket): Use
gdb_socket_cloexec.
* common/filestuff.c: New file.
* common/filestuff.h: New file.
* common/linux-osdata.c (linux_common_core_of_thread)
(command_from_pid, commandline_from_pid, print_source_lines)
(linux_xfer_osdata_shm, linux_xfer_osdata_sem)
(linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use
gdb_fopen_cloexec.
* common/linux-procfs.c (linux_proc_get_int)
(linux_proc_pid_has_state): Use gdb_fopen_cloexec.
* config.in, configure: Rebuild.
* configure.ac: Don't check for sys/socket.h. Check for
fdwalk, pipe2.
* corelow.c (core_open): Use gdb_open_cloexec.
* dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec.
* fork-child.c (fork_inferior): Call close_most_fds.
* gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec.
* inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec.
* linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals):
Use gdb_fopen_cloexec.
(linux_proc_xfer_partial, linux_proc_xfer_spu): Use
gdb_open_cloexec.
(linux_async_pipe): Use gdb_pipe_cloexec.
* remote-fileio.c (remote_fileio_func_open): Use
gdb_open_cloexec.
* remote.c (remote_file_put, remote_file_get): Use
gdb_fopen_cloexec.
* ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec,
close_most_fds.
* ser-tcp.c (net_open): Use gdb_socket_cloexec.
* ser-unix.c (hardwire_open): Use gdb_open_cloexec.
* solib.c (solib_find): Use gdb_open_cloexec.
* source.c (openp, find_and_open_source): Use gdb_open_cloexec.
* tracepoint.c (tfile_start): Use gdb_fopen_cloexec.
(tfile_open): Use gdb_open_cloexec.
* tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec.
* ui-file.c (gdb_fopen): Use gdb_fopen_cloexec.
* xml-support.c (xml_fetch_content_from_file): Use
gdb_fopen_cloexec.
* main.c (captured_main): Call notice_open_fds.
gdbserver
* Makefile.in (SFILES): Add filestuff.c.
(OBS): Add filestuff.o.
(filestuff.o): New target.
* config.in, configure: Rebuild.
* configure.ac: Check for fdwalk, pipe2.
2013-04-22 18:46:15 +02:00
|
|
|
#include "filestuff.h"
|
1999-09-22 05:28:34 +02:00
|
|
|
|
1999-04-16 03:35:26 +02:00
|
|
|
#include <sys/types.h>
|
2001-12-07 18:57:05 +01:00
|
|
|
|
|
|
|
#ifdef HAVE_SYS_FILIO_H
|
2011-01-11 22:53:25 +01:00
|
|
|
#include <sys/filio.h> /* For FIONBIO. */
|
2001-12-07 18:57:05 +01:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_IOCTL_H
|
2011-01-11 22:53:25 +01:00
|
|
|
#include <sys/ioctl.h> /* For FIONBIO. */
|
2001-12-07 18:57:05 +01:00
|
|
|
#endif
|
|
|
|
|
1999-04-16 03:35:26 +02:00
|
|
|
#include <sys/time.h>
|
2005-04-21 07:34:33 +02:00
|
|
|
|
|
|
|
#ifdef USE_WIN32API
|
|
|
|
#include <winsock2.h>
|
2011-10-28 15:32:05 +02:00
|
|
|
#ifndef ETIMEDOUT
|
2005-04-21 07:34:33 +02:00
|
|
|
#define ETIMEDOUT WSAETIMEDOUT
|
2011-10-28 15:32:05 +02:00
|
|
|
#endif
|
2005-07-25 01:02:41 +02:00
|
|
|
#define close(fd) closesocket (fd)
|
2005-04-21 07:34:33 +02:00
|
|
|
#define ioctl ioctlsocket
|
|
|
|
#else
|
1999-04-16 03:35:26 +02:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/tcp.h>
|
2005-04-21 07:34:33 +02:00
|
|
|
#endif
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2001-02-06 05:17:03 +01:00
|
|
|
#include <signal.h>
|
remove gdb_string.h
This removes gdb_string.h. This patch is purely mechanical. I
created it by running the two commands:
git rm common/gdb_string.h
perl -pi -e's/"gdb_string.h"/<string.h>/;' *.[chyl] */*.[chyl]
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_string.h: Remove.
* aarch64-tdep.c: Use string.h, not gdb_string.h.
* ada-exp.y: Use string.h, not gdb_string.h.
* ada-lang.c: Use string.h, not gdb_string.h.
* ada-lex.l: Use string.h, not gdb_string.h.
* ada-typeprint.c: Use string.h, not gdb_string.h.
* ada-valprint.c: Use string.h, not gdb_string.h.
* aix-thread.c: Use string.h, not gdb_string.h.
* alpha-linux-tdep.c: Use string.h, not gdb_string.h.
* alpha-mdebug-tdep.c: Use string.h, not gdb_string.h.
* alpha-nat.c: Use string.h, not gdb_string.h.
* alpha-osf1-tdep.c: Use string.h, not gdb_string.h.
* alpha-tdep.c: Use string.h, not gdb_string.h.
* alphanbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64-dicos-tdep.c: Use string.h, not gdb_string.h.
* amd64-linux-nat.c: Use string.h, not gdb_string.h.
* amd64-linux-tdep.c: Use string.h, not gdb_string.h.
* amd64-nat.c: Use string.h, not gdb_string.h.
* amd64-sol2-tdep.c: Use string.h, not gdb_string.h.
* amd64fbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64obsd-tdep.c: Use string.h, not gdb_string.h.
* arch-utils.c: Use string.h, not gdb_string.h.
* arm-linux-nat.c: Use string.h, not gdb_string.h.
* arm-linux-tdep.c: Use string.h, not gdb_string.h.
* arm-tdep.c: Use string.h, not gdb_string.h.
* arm-wince-tdep.c: Use string.h, not gdb_string.h.
* armbsd-tdep.c: Use string.h, not gdb_string.h.
* armnbsd-nat.c: Use string.h, not gdb_string.h.
* armnbsd-tdep.c: Use string.h, not gdb_string.h.
* armobsd-tdep.c: Use string.h, not gdb_string.h.
* avr-tdep.c: Use string.h, not gdb_string.h.
* ax-gdb.c: Use string.h, not gdb_string.h.
* ax-general.c: Use string.h, not gdb_string.h.
* bcache.c: Use string.h, not gdb_string.h.
* bfin-tdep.c: Use string.h, not gdb_string.h.
* breakpoint.c: Use string.h, not gdb_string.h.
* build-id.c: Use string.h, not gdb_string.h.
* buildsym.c: Use string.h, not gdb_string.h.
* c-exp.y: Use string.h, not gdb_string.h.
* c-lang.c: Use string.h, not gdb_string.h.
* c-typeprint.c: Use string.h, not gdb_string.h.
* c-valprint.c: Use string.h, not gdb_string.h.
* charset.c: Use string.h, not gdb_string.h.
* cli-out.c: Use string.h, not gdb_string.h.
* cli/cli-cmds.c: Use string.h, not gdb_string.h.
* cli/cli-decode.c: Use string.h, not gdb_string.h.
* cli/cli-dump.c: Use string.h, not gdb_string.h.
* cli/cli-interp.c: Use string.h, not gdb_string.h.
* cli/cli-logging.c: Use string.h, not gdb_string.h.
* cli/cli-script.c: Use string.h, not gdb_string.h.
* cli/cli-setshow.c: Use string.h, not gdb_string.h.
* cli/cli-utils.c: Use string.h, not gdb_string.h.
* coffread.c: Use string.h, not gdb_string.h.
* common/common-utils.c: Use string.h, not gdb_string.h.
* common/filestuff.c: Use string.h, not gdb_string.h.
* common/linux-procfs.c: Use string.h, not gdb_string.h.
* common/linux-ptrace.c: Use string.h, not gdb_string.h.
* common/signals.c: Use string.h, not gdb_string.h.
* common/vec.h: Use string.h, not gdb_string.h.
* core-regset.c: Use string.h, not gdb_string.h.
* corefile.c: Use string.h, not gdb_string.h.
* corelow.c: Use string.h, not gdb_string.h.
* cp-abi.c: Use string.h, not gdb_string.h.
* cp-support.c: Use string.h, not gdb_string.h.
* cp-valprint.c: Use string.h, not gdb_string.h.
* cris-tdep.c: Use string.h, not gdb_string.h.
* d-lang.c: Use string.h, not gdb_string.h.
* dbxread.c: Use string.h, not gdb_string.h.
* dcache.c: Use string.h, not gdb_string.h.
* demangle.c: Use string.h, not gdb_string.h.
* dicos-tdep.c: Use string.h, not gdb_string.h.
* disasm.c: Use string.h, not gdb_string.h.
* doublest.c: Use string.h, not gdb_string.h.
* dsrec.c: Use string.h, not gdb_string.h.
* dummy-frame.c: Use string.h, not gdb_string.h.
* dwarf2-frame.c: Use string.h, not gdb_string.h.
* dwarf2loc.c: Use string.h, not gdb_string.h.
* dwarf2read.c: Use string.h, not gdb_string.h.
* elfread.c: Use string.h, not gdb_string.h.
* environ.c: Use string.h, not gdb_string.h.
* eval.c: Use string.h, not gdb_string.h.
* event-loop.c: Use string.h, not gdb_string.h.
* exceptions.c: Use string.h, not gdb_string.h.
* exec.c: Use string.h, not gdb_string.h.
* expprint.c: Use string.h, not gdb_string.h.
* f-exp.y: Use string.h, not gdb_string.h.
* f-lang.c: Use string.h, not gdb_string.h.
* f-typeprint.c: Use string.h, not gdb_string.h.
* f-valprint.c: Use string.h, not gdb_string.h.
* fbsd-nat.c: Use string.h, not gdb_string.h.
* findcmd.c: Use string.h, not gdb_string.h.
* findvar.c: Use string.h, not gdb_string.h.
* fork-child.c: Use string.h, not gdb_string.h.
* frame.c: Use string.h, not gdb_string.h.
* frv-linux-tdep.c: Use string.h, not gdb_string.h.
* frv-tdep.c: Use string.h, not gdb_string.h.
* gdb.c: Use string.h, not gdb_string.h.
* gdb_bfd.c: Use string.h, not gdb_string.h.
* gdbarch.c: Use string.h, not gdb_string.h.
* gdbtypes.c: Use string.h, not gdb_string.h.
* gnu-nat.c: Use string.h, not gdb_string.h.
* gnu-v2-abi.c: Use string.h, not gdb_string.h.
* gnu-v3-abi.c: Use string.h, not gdb_string.h.
* go-exp.y: Use string.h, not gdb_string.h.
* go-lang.c: Use string.h, not gdb_string.h.
* go32-nat.c: Use string.h, not gdb_string.h.
* hppa-hpux-tdep.c: Use string.h, not gdb_string.h.
* hppa-linux-nat.c: Use string.h, not gdb_string.h.
* hppanbsd-tdep.c: Use string.h, not gdb_string.h.
* hppaobsd-tdep.c: Use string.h, not gdb_string.h.
* i386-cygwin-tdep.c: Use string.h, not gdb_string.h.
* i386-dicos-tdep.c: Use string.h, not gdb_string.h.
* i386-linux-nat.c: Use string.h, not gdb_string.h.
* i386-linux-tdep.c: Use string.h, not gdb_string.h.
* i386-nto-tdep.c: Use string.h, not gdb_string.h.
* i386-sol2-tdep.c: Use string.h, not gdb_string.h.
* i386-tdep.c: Use string.h, not gdb_string.h.
* i386bsd-tdep.c: Use string.h, not gdb_string.h.
* i386gnu-nat.c: Use string.h, not gdb_string.h.
* i386nbsd-tdep.c: Use string.h, not gdb_string.h.
* i386obsd-tdep.c: Use string.h, not gdb_string.h.
* i387-tdep.c: Use string.h, not gdb_string.h.
* ia64-libunwind-tdep.c: Use string.h, not gdb_string.h.
* ia64-linux-nat.c: Use string.h, not gdb_string.h.
* inf-child.c: Use string.h, not gdb_string.h.
* inf-ptrace.c: Use string.h, not gdb_string.h.
* inf-ttrace.c: Use string.h, not gdb_string.h.
* infcall.c: Use string.h, not gdb_string.h.
* infcmd.c: Use string.h, not gdb_string.h.
* inflow.c: Use string.h, not gdb_string.h.
* infrun.c: Use string.h, not gdb_string.h.
* interps.c: Use string.h, not gdb_string.h.
* iq2000-tdep.c: Use string.h, not gdb_string.h.
* irix5-nat.c: Use string.h, not gdb_string.h.
* jv-exp.y: Use string.h, not gdb_string.h.
* jv-lang.c: Use string.h, not gdb_string.h.
* jv-typeprint.c: Use string.h, not gdb_string.h.
* jv-valprint.c: Use string.h, not gdb_string.h.
* language.c: Use string.h, not gdb_string.h.
* linux-fork.c: Use string.h, not gdb_string.h.
* linux-nat.c: Use string.h, not gdb_string.h.
* lm32-tdep.c: Use string.h, not gdb_string.h.
* m2-exp.y: Use string.h, not gdb_string.h.
* m2-typeprint.c: Use string.h, not gdb_string.h.
* m32c-tdep.c: Use string.h, not gdb_string.h.
* m32r-linux-nat.c: Use string.h, not gdb_string.h.
* m32r-linux-tdep.c: Use string.h, not gdb_string.h.
* m32r-rom.c: Use string.h, not gdb_string.h.
* m32r-tdep.c: Use string.h, not gdb_string.h.
* m68hc11-tdep.c: Use string.h, not gdb_string.h.
* m68k-tdep.c: Use string.h, not gdb_string.h.
* m68kbsd-tdep.c: Use string.h, not gdb_string.h.
* m68klinux-nat.c: Use string.h, not gdb_string.h.
* m68klinux-tdep.c: Use string.h, not gdb_string.h.
* m88k-tdep.c: Use string.h, not gdb_string.h.
* macrocmd.c: Use string.h, not gdb_string.h.
* main.c: Use string.h, not gdb_string.h.
* mdebugread.c: Use string.h, not gdb_string.h.
* mem-break.c: Use string.h, not gdb_string.h.
* memattr.c: Use string.h, not gdb_string.h.
* memory-map.c: Use string.h, not gdb_string.h.
* mep-tdep.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-break.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-disas.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-env.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-stack.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-var.c: Use string.h, not gdb_string.h.
* mi/mi-cmds.c: Use string.h, not gdb_string.h.
* mi/mi-console.c: Use string.h, not gdb_string.h.
* mi/mi-getopt.c: Use string.h, not gdb_string.h.
* mi/mi-interp.c: Use string.h, not gdb_string.h.
* mi/mi-main.c: Use string.h, not gdb_string.h.
* mi/mi-parse.c: Use string.h, not gdb_string.h.
* microblaze-rom.c: Use string.h, not gdb_string.h.
* microblaze-tdep.c: Use string.h, not gdb_string.h.
* mingw-hdep.c: Use string.h, not gdb_string.h.
* minidebug.c: Use string.h, not gdb_string.h.
* minsyms.c: Use string.h, not gdb_string.h.
* mips-irix-tdep.c: Use string.h, not gdb_string.h.
* mips-linux-tdep.c: Use string.h, not gdb_string.h.
* mips-tdep.c: Use string.h, not gdb_string.h.
* mips64obsd-tdep.c: Use string.h, not gdb_string.h.
* mipsnbsd-tdep.c: Use string.h, not gdb_string.h.
* mipsread.c: Use string.h, not gdb_string.h.
* mn10300-linux-tdep.c: Use string.h, not gdb_string.h.
* mn10300-tdep.c: Use string.h, not gdb_string.h.
* monitor.c: Use string.h, not gdb_string.h.
* moxie-tdep.c: Use string.h, not gdb_string.h.
* mt-tdep.c: Use string.h, not gdb_string.h.
* nbsd-tdep.c: Use string.h, not gdb_string.h.
* nios2-linux-tdep.c: Use string.h, not gdb_string.h.
* nto-procfs.c: Use string.h, not gdb_string.h.
* nto-tdep.c: Use string.h, not gdb_string.h.
* objc-lang.c: Use string.h, not gdb_string.h.
* objfiles.c: Use string.h, not gdb_string.h.
* opencl-lang.c: Use string.h, not gdb_string.h.
* osabi.c: Use string.h, not gdb_string.h.
* osdata.c: Use string.h, not gdb_string.h.
* p-exp.y: Use string.h, not gdb_string.h.
* p-lang.c: Use string.h, not gdb_string.h.
* p-typeprint.c: Use string.h, not gdb_string.h.
* parse.c: Use string.h, not gdb_string.h.
* posix-hdep.c: Use string.h, not gdb_string.h.
* ppc-linux-nat.c: Use string.h, not gdb_string.h.
* ppc-sysv-tdep.c: Use string.h, not gdb_string.h.
* ppcfbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcnbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcobsd-tdep.c: Use string.h, not gdb_string.h.
* printcmd.c: Use string.h, not gdb_string.h.
* procfs.c: Use string.h, not gdb_string.h.
* prologue-value.c: Use string.h, not gdb_string.h.
* python/py-auto-load.c: Use string.h, not gdb_string.h.
* python/py-gdb-readline.c: Use string.h, not gdb_string.h.
* ravenscar-thread.c: Use string.h, not gdb_string.h.
* regcache.c: Use string.h, not gdb_string.h.
* registry.c: Use string.h, not gdb_string.h.
* remote-fileio.c: Use string.h, not gdb_string.h.
* remote-m32r-sdi.c: Use string.h, not gdb_string.h.
* remote-mips.c: Use string.h, not gdb_string.h.
* remote-sim.c: Use string.h, not gdb_string.h.
* remote.c: Use string.h, not gdb_string.h.
* reverse.c: Use string.h, not gdb_string.h.
* rs6000-aix-tdep.c: Use string.h, not gdb_string.h.
* ser-base.c: Use string.h, not gdb_string.h.
* ser-go32.c: Use string.h, not gdb_string.h.
* ser-mingw.c: Use string.h, not gdb_string.h.
* ser-pipe.c: Use string.h, not gdb_string.h.
* ser-tcp.c: Use string.h, not gdb_string.h.
* ser-unix.c: Use string.h, not gdb_string.h.
* serial.c: Use string.h, not gdb_string.h.
* sh-tdep.c: Use string.h, not gdb_string.h.
* sh64-tdep.c: Use string.h, not gdb_string.h.
* shnbsd-tdep.c: Use string.h, not gdb_string.h.
* skip.c: Use string.h, not gdb_string.h.
* sol-thread.c: Use string.h, not gdb_string.h.
* solib-dsbt.c: Use string.h, not gdb_string.h.
* solib-frv.c: Use string.h, not gdb_string.h.
* solib-osf.c: Use string.h, not gdb_string.h.
* solib-spu.c: Use string.h, not gdb_string.h.
* solib-target.c: Use string.h, not gdb_string.h.
* solib.c: Use string.h, not gdb_string.h.
* somread.c: Use string.h, not gdb_string.h.
* source.c: Use string.h, not gdb_string.h.
* sparc-nat.c: Use string.h, not gdb_string.h.
* sparc-sol2-tdep.c: Use string.h, not gdb_string.h.
* sparc-tdep.c: Use string.h, not gdb_string.h.
* sparc64-tdep.c: Use string.h, not gdb_string.h.
* sparc64fbsd-tdep.c: Use string.h, not gdb_string.h.
* sparc64nbsd-tdep.c: Use string.h, not gdb_string.h.
* sparcnbsd-tdep.c: Use string.h, not gdb_string.h.
* spu-linux-nat.c: Use string.h, not gdb_string.h.
* spu-multiarch.c: Use string.h, not gdb_string.h.
* spu-tdep.c: Use string.h, not gdb_string.h.
* stabsread.c: Use string.h, not gdb_string.h.
* stack.c: Use string.h, not gdb_string.h.
* std-regs.c: Use string.h, not gdb_string.h.
* symfile.c: Use string.h, not gdb_string.h.
* symmisc.c: Use string.h, not gdb_string.h.
* symtab.c: Use string.h, not gdb_string.h.
* target.c: Use string.h, not gdb_string.h.
* thread.c: Use string.h, not gdb_string.h.
* tilegx-linux-nat.c: Use string.h, not gdb_string.h.
* tilegx-tdep.c: Use string.h, not gdb_string.h.
* top.c: Use string.h, not gdb_string.h.
* tracepoint.c: Use string.h, not gdb_string.h.
* tui/tui-command.c: Use string.h, not gdb_string.h.
* tui/tui-data.c: Use string.h, not gdb_string.h.
* tui/tui-disasm.c: Use string.h, not gdb_string.h.
* tui/tui-file.c: Use string.h, not gdb_string.h.
* tui/tui-layout.c: Use string.h, not gdb_string.h.
* tui/tui-out.c: Use string.h, not gdb_string.h.
* tui/tui-regs.c: Use string.h, not gdb_string.h.
* tui/tui-source.c: Use string.h, not gdb_string.h.
* tui/tui-stack.c: Use string.h, not gdb_string.h.
* tui/tui-win.c: Use string.h, not gdb_string.h.
* tui/tui-windata.c: Use string.h, not gdb_string.h.
* tui/tui-winsource.c: Use string.h, not gdb_string.h.
* typeprint.c: Use string.h, not gdb_string.h.
* ui-file.c: Use string.h, not gdb_string.h.
* ui-out.c: Use string.h, not gdb_string.h.
* user-regs.c: Use string.h, not gdb_string.h.
* utils.c: Use string.h, not gdb_string.h.
* v850-tdep.c: Use string.h, not gdb_string.h.
* valarith.c: Use string.h, not gdb_string.h.
* valops.c: Use string.h, not gdb_string.h.
* valprint.c: Use string.h, not gdb_string.h.
* value.c: Use string.h, not gdb_string.h.
* varobj.c: Use string.h, not gdb_string.h.
* vax-tdep.c: Use string.h, not gdb_string.h.
* vaxnbsd-tdep.c: Use string.h, not gdb_string.h.
* vaxobsd-tdep.c: Use string.h, not gdb_string.h.
* windows-nat.c: Use string.h, not gdb_string.h.
* xcoffread.c: Use string.h, not gdb_string.h.
* xml-support.c: Use string.h, not gdb_string.h.
* xstormy16-tdep.c: Use string.h, not gdb_string.h.
* xtensa-linux-nat.c: Use string.h, not gdb_string.h.
2013-11-06 15:14:23 +01:00
|
|
|
#include <string.h>
|
2009-01-06 18:07:08 +01:00
|
|
|
#include "gdb_select.h"
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2005-06-13 23:32:01 +02:00
|
|
|
#ifndef HAVE_SOCKLEN_T
|
|
|
|
typedef int socklen_t;
|
|
|
|
#endif
|
|
|
|
|
1999-09-22 05:28:34 +02:00
|
|
|
void _initialize_ser_tcp (void);
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2009-01-06 18:07:08 +01:00
|
|
|
/* For "set tcp" and "show tcp". */
|
|
|
|
|
|
|
|
static struct cmd_list_element *tcp_set_cmdlist;
|
|
|
|
static struct cmd_list_element *tcp_show_cmdlist;
|
|
|
|
|
|
|
|
/* Whether to auto-retry refused connections. */
|
|
|
|
|
|
|
|
static int tcp_auto_retry = 1;
|
|
|
|
|
|
|
|
/* Timeout period for connections, in seconds. */
|
|
|
|
|
2013-03-07 18:36:25 +01:00
|
|
|
static unsigned int tcp_retry_limit = 15;
|
2009-01-06 18:07:08 +01:00
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* How many times per second to poll deprecated_ui_loop_hook. */
|
2009-01-06 18:07:08 +01:00
|
|
|
|
|
|
|
#define POLL_INTERVAL 5
|
|
|
|
|
|
|
|
/* Helper function to wait a while. If SCB is non-null, wait on its
|
|
|
|
file descriptor. Otherwise just wait on a timeout, updating *POLLS.
|
|
|
|
Returns -1 on timeout or interrupt, otherwise the value of select. */
|
|
|
|
|
|
|
|
static int
|
2013-03-26 21:29:47 +01:00
|
|
|
wait_for_connect (struct serial *scb, unsigned int *polls)
|
2009-01-06 18:07:08 +01:00
|
|
|
{
|
|
|
|
struct timeval t;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
/* While we wait for the connect to complete,
|
|
|
|
poll the UI so it can update or the user can
|
|
|
|
interrupt. */
|
|
|
|
if (deprecated_ui_loop_hook && deprecated_ui_loop_hook (0))
|
|
|
|
{
|
|
|
|
errno = EINTR;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for timeout. */
|
|
|
|
if (*polls > tcp_retry_limit * POLL_INTERVAL)
|
|
|
|
{
|
|
|
|
errno = ETIMEDOUT;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Back off to polling once per second after the first POLL_INTERVAL
|
|
|
|
polls. */
|
|
|
|
if (*polls < POLL_INTERVAL)
|
|
|
|
{
|
|
|
|
t.tv_sec = 0;
|
|
|
|
t.tv_usec = 1000000 / POLL_INTERVAL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
t.tv_sec = 1;
|
|
|
|
t.tv_usec = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (scb)
|
|
|
|
{
|
|
|
|
fd_set rset, wset, eset;
|
2010-05-17 01:49:58 +02:00
|
|
|
|
2009-01-06 18:07:08 +01:00
|
|
|
FD_ZERO (&rset);
|
|
|
|
FD_SET (scb->fd, &rset);
|
|
|
|
wset = rset;
|
|
|
|
eset = rset;
|
|
|
|
|
|
|
|
/* POSIX systems return connection success or failure by signalling
|
|
|
|
wset. Windows systems return success in wset and failure in
|
|
|
|
eset.
|
|
|
|
|
|
|
|
We must call select here, rather than gdb_select, because
|
|
|
|
the serial structure has not yet been initialized - the
|
|
|
|
MinGW select wrapper will not know that this FD refers
|
|
|
|
to a socket. */
|
|
|
|
n = select (scb->fd + 1, &rset, &wset, &eset, &t);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* Use gdb_select here, since we have no file descriptors, and on
|
|
|
|
Windows, plain select doesn't work in that case. */
|
|
|
|
n = gdb_select (0, NULL, NULL, NULL, &t);
|
|
|
|
|
|
|
|
/* If we didn't time out, only count it as one poll. */
|
|
|
|
if (n > 0 || *polls < POLL_INTERVAL)
|
|
|
|
(*polls)++;
|
|
|
|
else
|
|
|
|
(*polls) += POLL_INTERVAL;
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|
2001-12-04 07:12:56 +01:00
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Open a tcp socket. */
|
1999-04-16 03:35:26 +02:00
|
|
|
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
int
|
2002-05-14 06:26:25 +02:00
|
|
|
net_open (struct serial *scb, const char *name)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
2001-12-04 07:12:56 +01:00
|
|
|
char *port_str, hostname[100];
|
|
|
|
int n, port, tmp;
|
2002-05-14 06:26:25 +02:00
|
|
|
int use_udp;
|
1999-04-16 03:35:26 +02:00
|
|
|
struct hostent *hostent;
|
|
|
|
struct sockaddr_in sockaddr;
|
2005-04-21 07:34:33 +02:00
|
|
|
#ifdef USE_WIN32API
|
|
|
|
u_long ioarg;
|
|
|
|
#else
|
|
|
|
int ioarg;
|
|
|
|
#endif
|
2013-03-26 21:29:47 +01:00
|
|
|
unsigned int polls = 0;
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2002-05-14 06:26:25 +02:00
|
|
|
use_udp = 0;
|
|
|
|
if (strncmp (name, "udp:", 4) == 0)
|
|
|
|
{
|
|
|
|
use_udp = 1;
|
|
|
|
name = name + 4;
|
|
|
|
}
|
|
|
|
else if (strncmp (name, "tcp:", 4) == 0)
|
|
|
|
name = name + 4;
|
|
|
|
|
1999-04-16 03:35:26 +02:00
|
|
|
port_str = strchr (name, ':');
|
|
|
|
|
|
|
|
if (!port_str)
|
2011-01-11 22:53:25 +01:00
|
|
|
error (_("net_open: No colon in host name!")); /* Shouldn't ever
|
|
|
|
happen. */
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
|
|
tmp = min (port_str - name, (int) sizeof hostname - 1);
|
2011-01-11 22:53:25 +01:00
|
|
|
strncpy (hostname, name, tmp); /* Don't want colon. */
|
|
|
|
hostname[tmp] = '\000'; /* Tie off host name. */
|
1999-04-16 03:35:26 +02:00
|
|
|
port = atoi (port_str + 1);
|
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Default hostname is localhost. */
|
2001-08-02 11:08:03 +02:00
|
|
|
if (!hostname[0])
|
|
|
|
strcpy (hostname, "localhost");
|
|
|
|
|
1999-04-16 03:35:26 +02:00
|
|
|
hostent = gethostbyname (hostname);
|
|
|
|
if (!hostent)
|
|
|
|
{
|
|
|
|
fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname);
|
|
|
|
errno = ENOENT;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-01-06 18:07:08 +01:00
|
|
|
sockaddr.sin_family = PF_INET;
|
|
|
|
sockaddr.sin_port = htons (port);
|
|
|
|
memcpy (&sockaddr.sin_addr.s_addr, hostent->h_addr,
|
|
|
|
sizeof (struct in_addr));
|
|
|
|
|
|
|
|
retry:
|
|
|
|
|
2002-05-14 06:26:25 +02:00
|
|
|
if (use_udp)
|
PR gdb/7912:
* Makefile.in (SFILES): Add filestuff.c
(COMMON_OBS): Add filestuff.o.
(filestuff.o): New target.
* auto-load.c (auto_load_objfile_script_1): Use
gdb_fopen_cloexec.
* auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec.
* cli/cli-cmds.c (shell_escape): Call close_most_fds.
* cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec.
* common/agent.c (gdb_connect_sync_socket): Use
gdb_socket_cloexec.
* common/filestuff.c: New file.
* common/filestuff.h: New file.
* common/linux-osdata.c (linux_common_core_of_thread)
(command_from_pid, commandline_from_pid, print_source_lines)
(linux_xfer_osdata_shm, linux_xfer_osdata_sem)
(linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use
gdb_fopen_cloexec.
* common/linux-procfs.c (linux_proc_get_int)
(linux_proc_pid_has_state): Use gdb_fopen_cloexec.
* config.in, configure: Rebuild.
* configure.ac: Don't check for sys/socket.h. Check for
fdwalk, pipe2.
* corelow.c (core_open): Use gdb_open_cloexec.
* dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec.
* fork-child.c (fork_inferior): Call close_most_fds.
* gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec.
* inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec.
* linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals):
Use gdb_fopen_cloexec.
(linux_proc_xfer_partial, linux_proc_xfer_spu): Use
gdb_open_cloexec.
(linux_async_pipe): Use gdb_pipe_cloexec.
* remote-fileio.c (remote_fileio_func_open): Use
gdb_open_cloexec.
* remote.c (remote_file_put, remote_file_get): Use
gdb_fopen_cloexec.
* ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec,
close_most_fds.
* ser-tcp.c (net_open): Use gdb_socket_cloexec.
* ser-unix.c (hardwire_open): Use gdb_open_cloexec.
* solib.c (solib_find): Use gdb_open_cloexec.
* source.c (openp, find_and_open_source): Use gdb_open_cloexec.
* tracepoint.c (tfile_start): Use gdb_fopen_cloexec.
(tfile_open): Use gdb_open_cloexec.
* tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec.
* ui-file.c (gdb_fopen): Use gdb_fopen_cloexec.
* xml-support.c (xml_fetch_content_from_file): Use
gdb_fopen_cloexec.
* main.c (captured_main): Call notice_open_fds.
gdbserver
* Makefile.in (SFILES): Add filestuff.c.
(OBS): Add filestuff.o.
(filestuff.o): New target.
* config.in, configure: Rebuild.
* configure.ac: Check for fdwalk, pipe2.
2013-04-22 18:46:15 +02:00
|
|
|
scb->fd = gdb_socket_cloexec (PF_INET, SOCK_DGRAM, 0);
|
2002-05-14 06:26:25 +02:00
|
|
|
else
|
PR gdb/7912:
* Makefile.in (SFILES): Add filestuff.c
(COMMON_OBS): Add filestuff.o.
(filestuff.o): New target.
* auto-load.c (auto_load_objfile_script_1): Use
gdb_fopen_cloexec.
* auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec.
* cli/cli-cmds.c (shell_escape): Call close_most_fds.
* cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec.
* common/agent.c (gdb_connect_sync_socket): Use
gdb_socket_cloexec.
* common/filestuff.c: New file.
* common/filestuff.h: New file.
* common/linux-osdata.c (linux_common_core_of_thread)
(command_from_pid, commandline_from_pid, print_source_lines)
(linux_xfer_osdata_shm, linux_xfer_osdata_sem)
(linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use
gdb_fopen_cloexec.
* common/linux-procfs.c (linux_proc_get_int)
(linux_proc_pid_has_state): Use gdb_fopen_cloexec.
* config.in, configure: Rebuild.
* configure.ac: Don't check for sys/socket.h. Check for
fdwalk, pipe2.
* corelow.c (core_open): Use gdb_open_cloexec.
* dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec.
* fork-child.c (fork_inferior): Call close_most_fds.
* gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec.
* inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec.
* linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals):
Use gdb_fopen_cloexec.
(linux_proc_xfer_partial, linux_proc_xfer_spu): Use
gdb_open_cloexec.
(linux_async_pipe): Use gdb_pipe_cloexec.
* remote-fileio.c (remote_fileio_func_open): Use
gdb_open_cloexec.
* remote.c (remote_file_put, remote_file_get): Use
gdb_fopen_cloexec.
* ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec,
close_most_fds.
* ser-tcp.c (net_open): Use gdb_socket_cloexec.
* ser-unix.c (hardwire_open): Use gdb_open_cloexec.
* solib.c (solib_find): Use gdb_open_cloexec.
* source.c (openp, find_and_open_source): Use gdb_open_cloexec.
* tracepoint.c (tfile_start): Use gdb_fopen_cloexec.
(tfile_open): Use gdb_open_cloexec.
* tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec.
* ui-file.c (gdb_fopen): Use gdb_fopen_cloexec.
* xml-support.c (xml_fetch_content_from_file): Use
gdb_fopen_cloexec.
* main.c (captured_main): Call notice_open_fds.
gdbserver
* Makefile.in (SFILES): Add filestuff.c.
(OBS): Add filestuff.o.
(filestuff.o): New target.
* config.in, configure: Rebuild.
* configure.ac: Check for fdwalk, pipe2.
2013-04-22 18:46:15 +02:00
|
|
|
scb->fd = gdb_socket_cloexec (PF_INET, SOCK_STREAM, 0);
|
2002-05-14 06:26:25 +02:00
|
|
|
|
2010-05-27 00:40:24 +02:00
|
|
|
if (scb->fd == -1)
|
2001-12-04 07:12:56 +01:00
|
|
|
return -1;
|
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Set socket nonblocking. */
|
2005-04-21 07:34:33 +02:00
|
|
|
ioarg = 1;
|
|
|
|
ioctl (scb->fd, FIONBIO, &ioarg);
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2011-01-05 23:22:53 +01:00
|
|
|
/* Use Non-blocking connect. connect() will return 0 if connected
|
2011-01-11 22:53:25 +01:00
|
|
|
already. */
|
2001-12-04 07:12:56 +01:00
|
|
|
n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr));
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2009-01-06 18:07:08 +01:00
|
|
|
if (n < 0)
|
|
|
|
{
|
2005-04-21 07:34:33 +02:00
|
|
|
#ifdef USE_WIN32API
|
2009-01-06 18:07:08 +01:00
|
|
|
int err = WSAGetLastError();
|
2005-04-21 07:34:33 +02:00
|
|
|
#else
|
2009-01-06 18:07:08 +01:00
|
|
|
int err = errno;
|
2005-04-21 07:34:33 +02:00
|
|
|
#endif
|
2009-01-06 18:07:08 +01:00
|
|
|
|
|
|
|
/* Maybe we're waiting for the remote target to become ready to
|
|
|
|
accept connections. */
|
|
|
|
if (tcp_auto_retry
|
2005-04-21 07:34:33 +02:00
|
|
|
#ifdef USE_WIN32API
|
2009-01-06 18:07:08 +01:00
|
|
|
&& err == WSAECONNREFUSED
|
|
|
|
#else
|
|
|
|
&& err == ECONNREFUSED
|
2005-04-21 07:34:33 +02:00
|
|
|
#endif
|
2009-01-06 18:07:08 +01:00
|
|
|
&& wait_for_connect (NULL, &polls) >= 0)
|
|
|
|
{
|
|
|
|
close (scb->fd);
|
|
|
|
goto retry;
|
|
|
|
}
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2009-01-06 18:07:08 +01:00
|
|
|
if (
|
|
|
|
#ifdef USE_WIN32API
|
|
|
|
/* Under Windows, calling "connect" with a non-blocking socket
|
|
|
|
results in WSAEWOULDBLOCK, not WSAEINPROGRESS. */
|
|
|
|
err != WSAEWOULDBLOCK
|
|
|
|
#else
|
|
|
|
err != EINPROGRESS
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
|
|
|
errno = err;
|
|
|
|
net_close (scb);
|
|
|
|
return -1;
|
|
|
|
}
|
2001-12-04 07:12:56 +01:00
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Looks like we need to wait for the connect. */
|
2001-12-04 07:12:56 +01:00
|
|
|
do
|
|
|
|
{
|
2009-01-06 18:07:08 +01:00
|
|
|
n = wait_for_connect (scb, &polls);
|
2001-12-04 07:12:56 +01:00
|
|
|
}
|
2009-01-06 18:07:08 +01:00
|
|
|
while (n == 0);
|
|
|
|
if (n < 0)
|
2001-12-04 07:12:56 +01:00
|
|
|
{
|
2002-05-14 06:26:25 +02:00
|
|
|
net_close (scb);
|
2001-12-04 07:12:56 +01:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
1999-04-16 03:35:26 +02:00
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Got something. Is it an error? */
|
2001-12-04 07:12:56 +01:00
|
|
|
{
|
2005-05-26 22:49:03 +02:00
|
|
|
int res, err;
|
|
|
|
socklen_t len;
|
2010-05-17 01:49:58 +02:00
|
|
|
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
len = sizeof (err);
|
2005-04-21 07:34:33 +02:00
|
|
|
/* On Windows, the fourth parameter to getsockopt is a "char *";
|
|
|
|
on UNIX systems it is generally "void *". The cast to "void *"
|
|
|
|
is OK everywhere, since in C "void *" can be implicitly
|
|
|
|
converted to any pointer type. */
|
|
|
|
res = getsockopt (scb->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len);
|
2001-12-04 07:12:56 +01:00
|
|
|
if (res < 0 || err)
|
|
|
|
{
|
2009-01-06 18:07:08 +01:00
|
|
|
/* Maybe the target still isn't ready to accept the connection. */
|
|
|
|
if (tcp_auto_retry
|
|
|
|
#ifdef USE_WIN32API
|
|
|
|
&& err == WSAECONNREFUSED
|
|
|
|
#else
|
|
|
|
&& err == ECONNREFUSED
|
|
|
|
#endif
|
|
|
|
&& wait_for_connect (NULL, &polls) >= 0)
|
|
|
|
{
|
|
|
|
close (scb->fd);
|
|
|
|
goto retry;
|
|
|
|
}
|
2001-12-04 07:12:56 +01:00
|
|
|
if (err)
|
|
|
|
errno = err;
|
2002-05-14 06:26:25 +02:00
|
|
|
net_close (scb);
|
2001-12-04 07:12:56 +01:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
2002-05-14 06:26:25 +02:00
|
|
|
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Turn off nonblocking. */
|
2005-04-21 07:34:33 +02:00
|
|
|
ioarg = 0;
|
|
|
|
ioctl (scb->fd, FIONBIO, &ioarg);
|
2001-12-04 07:12:56 +01:00
|
|
|
|
2002-05-14 06:26:25 +02:00
|
|
|
if (use_udp == 0)
|
|
|
|
{
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Disable Nagle algorithm. Needed in some cases. */
|
2002-05-14 06:26:25 +02:00
|
|
|
tmp = 1;
|
|
|
|
setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY,
|
|
|
|
(char *)&tmp, sizeof (tmp));
|
|
|
|
}
|
|
|
|
|
2005-03-16 18:05:31 +01:00
|
|
|
#ifdef SIGPIPE
|
2001-12-04 07:12:56 +01:00
|
|
|
/* If we don't do this, then GDB simply exits
|
|
|
|
when the remote side dies. */
|
|
|
|
signal (SIGPIPE, SIG_IGN);
|
2005-03-16 18:05:31 +01:00
|
|
|
#endif
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
void
|
2002-05-14 06:26:25 +02:00
|
|
|
net_close (struct serial *scb)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
2010-05-27 00:40:24 +02:00
|
|
|
if (scb->fd == -1)
|
1999-04-16 03:35:26 +02:00
|
|
|
return;
|
|
|
|
|
1999-07-07 22:19:36 +02:00
|
|
|
close (scb->fd);
|
1999-04-16 03:35:26 +02:00
|
|
|
scb->fd = -1;
|
|
|
|
}
|
|
|
|
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
int
|
2005-04-21 07:34:33 +02:00
|
|
|
net_read_prim (struct serial *scb, size_t count)
|
|
|
|
{
|
2013-04-19 19:48:10 +02:00
|
|
|
/* Need to cast to silence -Wpointer-sign on MinGW, as Winsock's
|
|
|
|
'recv' takes 'char *' as second argument, while 'scb->buf' is
|
|
|
|
'unsigned char *'. */
|
|
|
|
return recv (scb->fd, (void *) scb->buf, count, 0);
|
2005-04-21 07:34:33 +02:00
|
|
|
}
|
|
|
|
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
int
|
2005-04-21 07:34:33 +02:00
|
|
|
net_write_prim (struct serial *scb, const void *buf, size_t count)
|
|
|
|
{
|
|
|
|
return send (scb->fd, buf, count, 0);
|
|
|
|
}
|
|
|
|
|
2008-09-04 01:54:19 +02:00
|
|
|
int
|
|
|
|
ser_tcp_send_break (struct serial *scb)
|
|
|
|
{
|
2011-01-11 22:53:25 +01:00
|
|
|
/* Send telnet IAC and BREAK characters. */
|
2008-09-04 01:54:19 +02:00
|
|
|
return (serial_write (scb, "\377\363", 2));
|
|
|
|
}
|
|
|
|
|
2009-01-06 18:07:08 +01:00
|
|
|
/* Support for "set tcp" and "show tcp" commands. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_tcp_cmd (char *args, int from_tty)
|
|
|
|
{
|
|
|
|
help_list (tcp_set_cmdlist, "set tcp ", -1, gdb_stdout);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
show_tcp_cmd (char *args, int from_tty)
|
|
|
|
{
|
|
|
|
help_list (tcp_show_cmdlist, "show tcp ", -1, gdb_stdout);
|
|
|
|
}
|
|
|
|
|
2013-12-06 19:34:49 +01:00
|
|
|
#ifndef USE_WIN32API
|
|
|
|
|
|
|
|
/* The TCP ops. */
|
|
|
|
|
|
|
|
static const struct serial_ops tcp_ops =
|
|
|
|
{
|
|
|
|
"tcp",
|
|
|
|
net_open,
|
|
|
|
net_close,
|
|
|
|
NULL,
|
|
|
|
ser_base_readchar,
|
|
|
|
ser_base_write,
|
|
|
|
ser_base_flush_output,
|
|
|
|
ser_base_flush_input,
|
|
|
|
ser_tcp_send_break,
|
|
|
|
ser_base_raw,
|
|
|
|
ser_base_get_tty_state,
|
|
|
|
ser_base_copy_tty_state,
|
|
|
|
ser_base_set_tty_state,
|
|
|
|
ser_base_print_tty_state,
|
|
|
|
ser_base_noflush_set_tty_state,
|
|
|
|
ser_base_setbaudrate,
|
|
|
|
ser_base_setstopbits,
|
|
|
|
ser_base_drain_output,
|
|
|
|
ser_base_async,
|
|
|
|
net_read_prim,
|
|
|
|
net_write_prim
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* USE_WIN32API */
|
2009-01-06 18:07:08 +01:00
|
|
|
|
1999-04-16 03:35:26 +02:00
|
|
|
void
|
1999-09-22 05:28:34 +02:00
|
|
|
_initialize_ser_tcp (void)
|
1999-04-16 03:35:26 +02:00
|
|
|
{
|
2005-04-21 07:34:33 +02:00
|
|
|
#ifdef USE_WIN32API
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
/* Do nothing; the TCP serial operations will be initialized in
|
|
|
|
ser-mingw.c. */
|
|
|
|
#else
|
2013-12-06 19:34:49 +01:00
|
|
|
serial_add_interface (&tcp_ops);
|
* NEWS: Mention native Windows support.
* 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.
2006-02-10 23:01:43 +01:00
|
|
|
#endif /* USE_WIN32API */
|
2009-01-06 18:07:08 +01:00
|
|
|
|
|
|
|
add_prefix_cmd ("tcp", class_maintenance, set_tcp_cmd, _("\
|
|
|
|
TCP protocol specific variables\n\
|
|
|
|
Configure variables specific to remote TCP connections"),
|
|
|
|
&tcp_set_cmdlist, "set tcp ",
|
|
|
|
0 /* allow-unknown */, &setlist);
|
|
|
|
add_prefix_cmd ("tcp", class_maintenance, show_tcp_cmd, _("\
|
|
|
|
TCP protocol specific variables\n\
|
|
|
|
Configure variables specific to remote TCP connections"),
|
|
|
|
&tcp_show_cmdlist, "show tcp ",
|
|
|
|
0 /* allow-unknown */, &showlist);
|
|
|
|
|
|
|
|
add_setshow_boolean_cmd ("auto-retry", class_obscure,
|
|
|
|
&tcp_auto_retry, _("\
|
|
|
|
Set auto-retry on socket connect"), _("\
|
|
|
|
Show auto-retry on socket connect"),
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
&tcp_set_cmdlist, &tcp_show_cmdlist);
|
|
|
|
|
|
|
|
add_setshow_uinteger_cmd ("connect-timeout", class_obscure,
|
|
|
|
&tcp_retry_limit, _("\
|
Accept "set foo unlimited" in integer/uinteger/zuinteger_unlimited commands.
Currently, several commands take "0" or "-1" to mean "unlimited".
"show" knows when to print "unlimited":
(gdb) show height
Number of lines gdb thinks are in a page is 45.
(gdb) set height 0
(gdb) show height
Number of lines gdb thinks are in a page is unlimited.
However, the user can't herself specify "unlimited" directly:
(gdb) set height unlimited
No symbol table is loaded. Use the "file" command.
(gdb)
This patch addresses that, by adjusting the set handler for all
integer/uinteger/zuinteger_unlimited commands to accept literal
"unlimited". It also installs a completer. Presently, we complete on
symbols by default, and at
<http://sourceware.org/ml/gdb-patches/2013-03/msg00864.html> I've
shown a WIP prototype that tried to keep that half working in these
commands. In the end, it turned out to be more complicated than
justifiable, IMO. It's super rare to want to pass the value of a
variable/symbol in the program to a GDB set/show knob. That'll still
work, it's just that we won't assist with completion anymore. This
patch just sticks with the simple, and completes on "unlimited", and
nothing else. This simplification means that
"set he<tab><tab>"
is all it takes to get to:
"set height unlimited"
The patch then goes through all integer/uinteger/zuinteger_unlimited
commands in the tree, and updates both the online help and the manual
to mention that "unlimited" is accepted in addition to 0/-1. In the
cases where the command had no online help text at all, this adds it.
I've tried to make the texts read in a way that "unlimited" is
suggested before "0" or "-1" is.
Tested on x86_64 Fedora 17.
gdb/
2013-04-10 Pedro Alves <palves@redhat.com>
* cli/cli-decode.c (integer_unlimited_completer): New function.
(add_setshow_integer_cmd, add_setshow_uinteger_cmd)
(add_setshow_zuinteger_unlimited_cmd): Install the "unlimited"
completer.
* cli/cli-setshow.c: Include "cli/cli-utils.h".
(is_unlimited_literal): New function.
(do_set_command): Handle literal "unlimited" arguments.
* frame.c (_initialize_frame) <set backtrace limit>: Document
"unlimited".
* printcmd.c (_initialize_printcmd) <set print
max-symbolic-offset>: Add help text.
* record-full.c (_initialize_record_full) <set record full
insn-number-max>: Likewise.
* record.c (_initialize_record) <set record
instruction-history-size, set record function-call-history-size>:
Add help text.
* ser-tcp.c (_initialize_ser_tcp) <set tcp connect-timeout>: Add
help text.
* tracepoint.c (_initialize_tracepoint) <set trace-buffer-size>:
Likewise.
* source.c (_initialize_source) <set listsize>: Add help text.
* utils.c (initialize_utils) <set height, set width>: Likewise.
<set pagination>: Mention "set height unlimited".
* valprint.c (_initialize_valprint) <set print elements, set print
repeats>: Document "unlimited".
gdb/doc/
2013-04-10 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Process Record and Replay): Document that "set
record full insn-number-max", "set record
instruction-history-size" and "set record
function-call-history-size" accept "unlimited".
(Backtrace): Document that "set backtrace limit" accepts
"unlimited".
(List): Document that "set listsize" accepts "unlimited".
(Print Settings)" Document that "set print max-symbolic-offset",
"set print elements" and "set print repeats" accept "unlimited".
(Starting and Stopping Trace Experiments): Document that "set
trace-buffer-size" accepts "unlimited".
(Remote Configuration): Document that "set tcp connect-timeout"
accepts "unlimited".
(Command History): Document that "set history size" accepts
"unlimited".
(Screen Size): Document that "set height" and "set width" accepts
"unlimited". Adjust "set pagination"'s description to suggest
"set height unlimited" instead of "set height 0".
gdb/testsuite/
2013-04-10 Pedro Alves <palves@redhat.com>
* gdb.base/completion.exp: Test "set height", "set listsize" and
"set trace-buffer-size" completion.
* gdb.base/setshow.exp: Test "set height unlimited".
* gdb.trace/trace-buffer-size.exp: Test "set trace-buffer-size
unlimited".
2013-04-10 17:11:12 +02:00
|
|
|
Set timeout limit in seconds for socket connection"), _("\
|
|
|
|
Show timeout limit in seconds for socket connection"), _("\
|
|
|
|
If set to \"unlimited\", GDB will keep attempting to establish a\n\
|
|
|
|
connection forever, unless interrupted with Ctrl-c.\n\
|
|
|
|
The default is 15 seconds."),
|
|
|
|
NULL, NULL,
|
|
|
|
&tcp_set_cmdlist, &tcp_show_cmdlist);
|
1999-04-16 03:35:26 +02:00
|
|
|
}
|