public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: 2009-01-06  Joel Sherrill <joel.sherrill@oarcorp.com>
@ 2009-01-06 20:03 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2009-01-06 20:03 UTC (permalink / raw)
  To: archer-commits

The branch, master has been updated
       via  26af839fdd5cd7143867acff0012473537ecc667 (commit)
       via  3bdc07d2a6f44070a5ef57b305a2e4c816b0a820 (commit)
       via  0bd695e5a4e79c240a67ea794cb83a7324584a8d (commit)
       via  d8e475b5ea302f7de5665e5bb54112f53d95bc75 (commit)
       via  60a61846f7a1d6129b24be2f9e6b38d3311a47b9 (commit)
       via  64f8419f28ea32be7ea4a8e99de688395995a0dd (commit)
       via  410508e4968402499d97466db958ceca88670e71 (commit)
       via  8b2893e01420fef3503f6245618a2c00675a6bc3 (commit)
       via  52490b0fd88bbeab9705526edae4ba9490b35e58 (commit)
       via  9ace673c7b26ef35fabe462a4d92a01383d7cfa0 (commit)
       via  529823bb9b73f202c72324e975016d3a2fc559ce (commit)
       via  40bd160e942a5a85f46b9e5cdc20e8e7e70b9ffe (commit)
       via  56266baf7d36c96b16217eab3a797a3fd73646c1 (commit)
       via  55a1b5a021b9a566f2dea68563c8b6c772155f20 (commit)
      from  1a00a723098867f4667214ed1a22e2409b347430 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 26af839fdd5cd7143867acff0012473537ecc667
Author: Joel Sherrill <joel@oarcorp.com>
Date:   Tue Jan 6 19:01:36 2009 +0000

    2009-01-06  Joel Sherrill <joel.sherrill@oarcorp.com>
    
    	* r8c.opc, m32c.opc: Add parentheses to remove warnings.

commit 3bdc07d2a6f44070a5ef57b305a2e4c816b0a820
Author: Jim Blandy <jimb@codesourcery.com>
Date:   Tue Jan 6 18:31:58 2009 +0000

    Check return values of functions declared with warn_unused_result
    attribute in GLIBC 2.8.
    * cli/cli-cmds.c (pwd_command): Check return value from getcwd.
    * inflow.c (check_syscall): New function.
    (new_tty): Use check_syscall to check return values from open and dup.
    * linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets.
    * main.c (captured_main): Call cwd after setting up gdb_stderr;
    check for errors from getcwd.
    * mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd.
    * ui-file.c (stdio_file_write): Ignore return value from fwrite.
    (stdio_file_fputs): Same.
    * utils.c (internal_vproblem): abort if last-ditch error message
    write fails.

commit 0bd695e5a4e79c240a67ea794cb83a7324584a8d
Author: Jim Blandy <jimb@codesourcery.com>
Date:   Tue Jan 6 18:28:03 2009 +0000

    * top.c (gdb_init): Don't set the current directory here; that's
    already been done in captured_main.

commit d8e475b5ea302f7de5665e5bb54112f53d95bc75
Author: H.J. Lu <hjl@lucon.org>
Date:   Tue Jan 6 17:58:19 2009 +0000

    Reformat.

commit 60a61846f7a1d6129b24be2f9e6b38d3311a47b9
Author: H.J. Lu <hjl@lucon.org>
Date:   Tue Jan 6 17:15:27 2009 +0000

    gas/testsuite/
    
    2009-01-06  H.J. Lu  <hongjiu.lu@intel.com>
    
    	AVX Programming Reference (December, 2008)
    	* gas/i386/avx.s: Add tests for 256bit vmovntdq, vmovntpd and
    	vmovntps.
    	* gas/i386/x86-64-avx.s: Likewise.
    
    	* gas/i386/avx.d: Updated.
    	* gas/i386/avx-intel.d: Likewise.
    	* gas/i386/x86-64-avx.d: Likewise.
    	* gas/i386/x86-64-avx-intel.d: Likewise.
    
    opcodes/
    
    2009-01-06  H.J. Lu  <hongjiu.lu@intel.com>
    
    	AVX Programming Reference (December, 2008)
    	* i386-dis.c (VEX_LEN_2B_M_0): Removed.
    	(VEX_LEN_E7_P_2_M_0): Likewise.
    	(VEX_LEN_2C_P_1): Updated.
    	(VEX_LEN_E8_P_2): Likewise.
    	(vex_len_table): Remove VEX_LEN_2B_M_0 and VEX_LEN_E7_P_2_M_0.
    	(mod_table): Likewise.
    
    	* i386-opc.tbl: Add 256bit vmovntdq, vmovntpd and vmovntps.
    	* i386-tbl.h: Regenerated.

commit 64f8419f28ea32be7ea4a8e99de688395995a0dd
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Tue Jan 6 17:07:06 2009 +0000

    2009-01-06  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/
    	* ser-tcp.c: Adjust includes.
    	(tcp_set_cmdlist, tcp_show_cmdlist): Declare.
    	(tcp_auto_retry, tcp_retry_limit): Declare.
    	(TIMEOUT): Remove, in favor of tcp_retry_limit.
    	(POLL_INTERVAL): Increase to 5, in favor of backoff logic.
    	(wait_for_connect): New function.
    	(net_open): Use it.  Add auto-retry logic.
    	(set_tcp_cmd, show_tcp_cmd): New functions.
    	(_initialize_ser_tcp): Initialize new "set/show tcp auto-retry"
    	and "set/show tcp connect-timeout" commands.
    	* NEWS: Document new commands.
    
    	gdb/doc/
    	* gdb.texinfo (Remote Configuration): Document new
    	"set/show tcp auto-retry" and "set/show tcp connect-timeout"
    	commands.

commit 410508e4968402499d97466db958ceca88670e71
Author: Joel Sherrill <joel@oarcorp.com>
Date:   Tue Jan 6 14:40:32 2009 +0000

    2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
    
    	* config.bfd: Add lm32-*-rtems*.

commit 8b2893e01420fef3503f6245618a2c00675a6bc3
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Tue Jan 6 04:49:29 2009 +0000

    	* gdbreplay.c (gdbreplay_version): Update copyright year.
    	* server.c (gdbserver_version): Likewise.

commit 52490b0fd88bbeab9705526edae4ba9490b35e58
Author: H.J. Lu <hjl@lucon.org>
Date:   Tue Jan 6 01:14:45 2009 +0000

    2009-01-05  H.J. Lu  <hongjiu.lu@intel.com>
    
    	* i386-gen.c (process_copyright): Update for 2009.
    
    	* i386-init.h: Regenerated.
    	* i386-tbl.h: Likewise.

commit 9ace673c7b26ef35fabe462a4d92a01383d7cfa0
Author: H.J. Lu <hjl@lucon.org>
Date:   Tue Jan 6 01:03:26 2009 +0000

    gas/
    
    2009-01-05  H.J. Lu  <hongjiu.lu@intel.com>
    
    	AVX Programming Reference (December, 2008)
    	* config/tc-i386.c (build_modrm_byte): Remove 5 operand instruction
    	support.  Don't swap REG and NDS for FMA.
    
    gas/testsuite/
    
    2009-01-05  H.J. Lu  <hongjiu.lu@intel.com>
    
    	AVX Programming Reference (December, 2008)
    	* gas/i386/arch-10.s: Replace vfmaddpd with vfmadd132pd.
    	* gas/i386/x86-64-arch-2.s: Likewise.
    
    	* gas/i386/arch-10.d: Updated.
    	* gas/i386/arch-10-1.l: Likewise.
    	* gas/i386/arch-10-2.l: Likewise.
    	* gas/i386/arch-10-3.l: Likewise.
    	* gas/i386/arch-10-4.l: Likewise.
    	* gas/i386/avx.d: Likewise.
    	* gas/i386/avx-intel.d: Likewise.
    	* gas/i386/inval-avx.l: Likewise.
    	* gas/i386/x86-64-arch-2.d: Likewise.
    	* gas/i386/x86-64-avx.d: Likewise.
    	* gas/i386/x86-64-avx-intel.d: Likewise.
    	* gas/i386/x86-64-inval-avx.l: Likewise.
    
    	* gas/i386/avx.s: Remove vpermil2ps/vpermil2pd and FMA
    	instructions.  Update tests.
    	* gas/i386/inval-avx.s: Likewise.
    	* gas/i386/x86-64-avx.s: Likewise.
    	* gas/i386/x86-64-inval-avx.s: Likewise.
    
    	* gas/i386/fma.d: New.
    	* gas/i386/fma.s: Likewise.
    	* gas/i386/fma-intel.d: Likewise.
    	* gas/i386/x86-64-fma.d: Likewise.
    	* gas/i386/x86-64-fma.s: Likewise.
    	* gas/i386/x86-64-fma-intel.d: Likewise.
    
    	* gas/i386/i386.exp: Run fma, fma-intel, x86-64-fma and
    	x86-64-fma-intel.
    
    opcodes/
    
    2009-01-05  H.J. Lu  <hongjiu.lu@intel.com>
    
    	AVX Programming Reference (December, 2008)
    	* i386-dis.c (OP_VEX_FMA): Removed.
    	(OP_EX_VexW): Likewise.
    	(OP_EX_VexImmW): Likewise.
    	(OP_XMM_VexW): Likewise.
    	(VEXI4_Fixup): Likewise.
    	(VPERMIL2_Fixup): Likewise.
    	(VexI4): Likewise.
    	(VexFMA): Likewise.
    	(Vex128FMA): Likewise.
    	(EXVexW): Likewise.
    	(EXdVexW): Likewise.
    	(EXqVexW): Likewise.
    	(EXVexImmW): Likewise.
    	(XMVexW): Likewise.
    	(VPERMIL2): Likewise.
    	(PREFIX_VEX_3A48...PREFIX_VEX_3A4A): Likewise.
    	(PREFIX_VEX_3A5C...PREFIX_VEX_3A5F): Likewise.
    	(PREFIX_VEX_3A68...PREFIX_VEX_3A6F): Likewise.
    	(PREFIX_VEX_3A78...PREFIX_VEX_3A7F): Likewise.
    	(VEX_LEN_3A6A_P_2...VEX_LEN_3A6F_P_2): Likewise.
    	(VEX_LEN_3A7A_P_2...VEX_LEN_3A7F_P_2): Likewise.
    	(get_vex_imm8): Likewise.
    	(OP_EX_VexReg): Likewise.
    	vpermil2_op): Likewise.
    	(EXVexWdq): New.
    	(vex_w_dq_mode): Likewise.
    	(PREFIX_VEX_3896...PREFIX_VEX_389F): Likewise.
    	(PREFIX_VEX_38A6...PREFIX_VEX_38AF): Likewise.
    	(PREFIX_VEX_38B6...PREFIX_VEX_38BF): Likewise.
    	(es_reg): Updated.
    	(PREFIX_VEX_38DB): Likewise.
    	(PREFIX_VEX_3A4A): Likewise.
    	(PREFIX_VEX_3A60): Likewise.
    	(PREFIX_VEX_3ADF): Likewise.
    	(VEX_LEN_3ADF_P_2): Likewise.
    	(prefix_table): Remove PREFIX_VEX_3A48...PREFIX_VEX_3A4A,
    	PREFIX_VEX_3A5C...PREFIX_VEX_3A5F,
    	PREFIX_VEX_3A68...PREFIX_VEX_3A6F and
    	PREFIX_VEX_3A78...PREFIX_VEX_3A7F.  Add
    	PREFIX_VEX_3896...PREFIX_VEX_389F,
    	PREFIX_VEX_38A6...PREFIX_VEX_38AF and
    	PREFIX_VEX_38B6...PREFIX_VEX_38BF.
    	(vex_table): Likewise.
    	(vex_len_table): Remove VEX_LEN_3A6A_P_2...VEX_LEN_3A6F_P_2
    	and VEX_LEN_3A7A_P_2...VEX_LEN_3A7F_P_2.
    	(putop): Support "%XW".
    	(intel_operand_size): Handle vex_w_dq_mode.
    
    	* i386-opc.h (VexNDS): Add a comment for VEX NDS and VEX DDS.
    
    	* i386-opc.tbl: Remove vpermil2pd/vpermil2ps and old FMA
    	instructions.  Add new FMA instructions.
    	* i386-tbl.h: Regenerated.

commit 529823bb9b73f202c72324e975016d3a2fc559ce
Author: Doug Evans <dje@google.com>
Date:   Tue Jan 6 00:20:44 2009 +0000

    * ChangeLog: Fix date of last entry.
    * linux-low.c (handle_extended_wait): Improve comment.

commit 40bd160e942a5a85f46b9e5cdc20e8e7e70b9ffe
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Tue Jan 6 00:00:05 2009 +0000

    daily update

commit 56266baf7d36c96b16217eab3a797a3fd73646c1
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Tue Jan 6 00:00:03 2009 +0000

    *** empty log message ***

commit 55a1b5a021b9a566f2dea68563c8b6c772155f20
Author: Doug Evans <dje@google.com>
Date:   Mon Jan 5 23:11:48 2009 +0000

    	* linux-low.c (linux_attach_lwp): Add some comments/fixmes.

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                         |    4 +
 bfd/config.bfd                        |    2 +-
 bfd/version.h                         |    2 +-
 gdb/ChangeLog                         |   33 +
 gdb/NEWS                              |    8 +
 gdb/cli/cli-cmds.c                    |    4 +-
 gdb/doc/ChangeLog                     |    6 +
 gdb/doc/gdb.texinfo                   |   30 +
 gdb/gdbserver/ChangeLog               |   10 +
 gdb/gdbserver/gdbreplay.c             |    2 +-
 gdb/gdbserver/linux-low.c             |   37 +-
 gdb/gdbserver/server.c                |    2 +-
 gdb/inflow.c                          |   26 +-
 gdb/linux-nat.c                       |    6 +-
 gdb/main.c                            |   12 +-
 gdb/mi/mi-cmd-env.c                   |    5 +-
 gdb/ser-tcp.c                         |  244 +++++--
 gdb/top.c                             |    3 -
 gdb/ui-file.c                         |    8 +-
 gdb/utils.c                           |   14 +-
 gdb/version.in                        |    2 +-
 opcodes/ChangeLog                     | 1231 ++---------------------------
 opcodes/{ChangeLog => ChangeLog-2008} |    5 -
 opcodes/i386-dis.c                    |  848 +++++++-------------
 opcodes/i386-gen.c                    |    6 +-
 opcodes/i386-init.h                   |    3 +-
 opcodes/i386-opc.h                    |    7 +-
 opcodes/i386-opc.tbl                  |  197 +++---
 opcodes/i386-tbl.h                    | 1423 +++++++++++++--------------------
 sim/m32c/ChangeLog                    |    4 +
 sim/m32c/m32c.opc                     |    4 +-
 sim/m32c/r8c.opc                      |    4 +-
 32 files changed, 1421 insertions(+), 2771 deletions(-)
 copy opcodes/{ChangeLog => ChangeLog-2008} (99%)

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4e2726d..c114076 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* config.bfd: Add lm32-*-rtems*.
+
 2009-01-03  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* coff-ppc.c: Add 2009 to Copyright.
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 452f25d..e3d2b86 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -728,7 +728,7 @@ case "${targ}" in
     targ_defvec=bfd_elf32_iq2000_vec
     ;;
 
-  lm32-*-elf)
+  lm32-*-elf | lm32-*-rtems*)
     targ_defvec=bfd_elf32_lm32_vec
     targ_selvecs=bfd_elf32_lm32fdpic_vec
     ;;
diff --git a/bfd/version.h b/bfd/version.h
index 26c4d87..65dbb42 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20090105
+#define BFD_VERSION_DATE 20090106
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b959e9a..8c93b4a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,36 @@
+2009-01-06  Jim Blandy  <jimb@red-bean.com>
+
+	Check return values of functions declared with warn_unused_result
+	attribute in GLIBC 2.8.
+	* cli/cli-cmds.c (pwd_command): Check return value from getcwd.
+	* inflow.c (check_syscall): New function.
+	(new_tty): Use check_syscall to check return values from open and dup.
+	* linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets.
+	* main.c (captured_main): Call cwd after setting up gdb_stderr;
+	check for errors from getcwd.
+	* mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd.
+	* ui-file.c (stdio_file_write): Ignore return value from fwrite.
+	(stdio_file_fputs): Same.
+	* utils.c (internal_vproblem): abort if last-ditch error message
+	write fails.
+
+	* top.c (gdb_init): Don't set the current directory here; that's
+	already been done in captured_main.
+
+2009-01-06  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* ser-tcp.c: Adjust includes.
+	(tcp_set_cmdlist, tcp_show_cmdlist): Declare.
+	(tcp_auto_retry, tcp_retry_limit): Declare.
+	(TIMEOUT): Remove, in favor of tcp_retry_limit.
+	(POLL_INTERVAL): Increase to 5, in favor of backoff logic.
+	(wait_for_connect): New function.
+	(net_open): Use it.  Add auto-retry logic.
+	(set_tcp_cmd, show_tcp_cmd): New functions.
+	(_initialize_ser_tcp): Initialize new "set/show tcp auto-retry"
+	and "set/show tcp connect-timeout" commands.
+	* NEWS: Document new commands.
+
 2009-01-05  Tom Tromey  <tromey@redhat.com>
 
 	* python/python-internal.h (Py_ssize_t): Define as int.
diff --git a/gdb/NEWS b/gdb/NEWS
index 415a4be..4532f9e 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -169,6 +169,14 @@ set target-async
   with GDB while the target is running.  "show target-async" displays the
   current state of asynchronous execution of the target.
 
+set tcp auto-retry (on|off)
+show tcp auto-retry
+set tcp connect-timeout
+show tcp connect-timeout
+  These commands allow GDB to retry failed TCP connections to a remote stub
+  with a specified timeout period; this is useful if the stub is launched
+  in parallel with GDB but may not be ready to accept connections immediately.
+
 macro define
 macro list
 macro undef
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index de35e1a..b391e30 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -320,7 +320,9 @@ pwd_command (char *args, int from_tty)
 {
   if (args)
     error (_("The \"pwd\" command does not take an argument: %s"), args);
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
+  if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
+    error (_("Error finding name of working directory: %s"),
+           safe_strerror (errno));
 
   if (strcmp (gdb_dirbuf, current_directory) != 0)
     printf_unfiltered (_("Working directory %s\n (canonically %s).\n"),
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index b79252c..dfe9526 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-06  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* gdb.texinfo (Remote Configuration): Document new
+	"set/show tcp auto-retry" and "set/show tcp connect-timeout"
+	commands.
+
 2008-12-28  Pedro Alves  <pedro@codesourcery.com>
 
 	* gdbint.texinfo (gdbarch_cannot_fetch_register): Don't mention
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 6ef124c..f6b7a1c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -14206,6 +14206,36 @@ Select the file used for @code{run} with @code{target
 extended-remote}.  This should be set to a filename valid on the
 target system.  If it is not set, the target will use a default
 filename (e.g.@: the last program run).
+
+@kindex set tcp
+@kindex show tcp
+@item set tcp auto-retry on
+@cindex auto-retry, for remote TCP target
+Enable auto-retry for remote TCP connections.  This is useful if the remote
+debugging agent is launched in parallel with @value{GDBN}; there is a race
+condition because the agent may not become ready to accept the connection
+before @value{GDBN} attempts to connect.  When auto-retry is
+enabled, if the initial attempt to connect fails, @value{GDBN} reattempts
+to establish the connection using the timeout specified by 
+@code{set tcp connect-timeout}.
+
+@item set tcp auto-retry off
+Do not auto-retry failed TCP connections.
+
+@item show tcp auto-retry
+Show the current auto-retry setting.
+
+@item set tcp connect-timeout @var{seconds}
+@cindex connection timeout, for remote TCP target
+@cindex timeout, for remote target connection
+Set the timeout for establishing a TCP connection to the remote target to
+@var{seconds}.  The timeout affects both polling to retry failed connections 
+(enabled by @code{set tcp auto-retry on}) and waiting for connections
+that are merely slow to complete, and represents an approximate cumulative
+value.
+
+@item show tcp connect-timeout
+Show the current connection timeout setting.
 @end table
 
 @cindex remote packets, enabling and disabling
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 7c4d073..b745986 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-06  Joel Brobecker  <brobecker@adacore.com>
+
+	* gdbreplay.c (gdbreplay_version): Update copyright year.
+	* server.c (gdbserver_version): Likewise.
+
+2009-01-05  Doug Evans  <dje@google.com>
+
+	* linux-low.c (linux_attach_lwp): Add some comments/fixmes.
+	(handle_extended_wait): Improve comment.
+
 2008-12-13  Doug Evans  <dje@google.com>
 
 	* utils.c (xmalloc,xcalloc,xstrdup): New fns.
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 9bb9e0d..aec45a5 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -395,7 +395,7 @@ static void
 gdbreplay_version (void)
 {
   printf ("GNU gdbreplay %s%s\n"
-	  "Copyright (C) 2008 Free Software Foundation, Inc.\n"
+	  "Copyright (C) 2009 Free Software Foundation, Inc.\n"
 	  "gdbreplay is free software, covered by the GNU General Public License.\n"
 	  "This gdbreplay was configured as \"%s\"\n",
 	  PKGVERSION, version, host_name);
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index c8b07eb..3fa06ec 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -180,7 +180,7 @@ handle_extended_wait (struct process_info *event_child, int wstat)
 
       /* Normally we will get the pending SIGSTOP.  But in some cases
 	 we might get another signal delivered to the group first.
-         If we do, be sure not to lose it.  */
+	 If we do get another signal, be sure not to lose it.  */
       if (WSTOPSIG (status) == SIGSTOP)
 	{
 	  if (stopping_threads)
@@ -326,6 +326,8 @@ linux_attach_lwp (unsigned long pid)
 	       strerror (errno), errno);
     }
 
+  /* FIXME: This intermittently fails.
+     We need to wait for SIGSTOP first.  */
   ptrace (PTRACE_SETOPTIONS, pid, 0, PTRACE_O_TRACECLONE);
 
   new_process = (struct process_info *) add_process (pid);
@@ -333,15 +335,36 @@ linux_attach_lwp (unsigned long pid)
   new_thread_notify (thread_id_to_gdb_id (new_process->lwpid));
 
   /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH
-     brings it to a halt.  We should ignore that SIGSTOP and resume the process
-     (unless this is the first process, in which case the flag will be cleared
-     in linux_attach).
+     brings it to a halt.
+
+     There are several cases to consider here:
+
+     1) gdbserver has already attached to the process and is being notified
+        of a new thread that is being created.
+        In this case we should ignore that SIGSTOP and resume the process.
+        This is handled below by setting stop_expected = 1.
+
+     2) This is the first thread (the process thread), and we're attaching
+        to it via attach_inferior.
+        In this case we want the process thread to stop.
+        This is handled by having linux_attach clear stop_expected after
+        we return.
+        ??? If the process already has several threads we leave the other
+        threads running.
+
+     3) GDB is connecting to gdbserver and is requesting an enumeration of all
+        existing threads.
+        In this case we want the thread to stop.
+        FIXME: This case is currently not properly handled.
+        We should wait for the SIGSTOP but don't.  Things work apparently
+        because enough time passes between when we ptrace (ATTACH) and when
+        gdb makes the next ptrace call on the thread.
 
      On the other hand, if we are currently trying to stop all threads, we
      should treat the new thread as if we had sent it a SIGSTOP.  This works
-     because we are guaranteed that add_process added us to the end of the
-     list, and so the new thread has not yet reached wait_for_sigstop (but
-     will).  */
+     because we are guaranteed that the add_process call above added us to the
+     end of the list, and so the new thread has not yet reached
+     wait_for_sigstop (but will).  */
   if (! stopping_threads)
     new_process->stop_expected = 1;
 }
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 6e13657..f2e9b05 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1255,7 +1255,7 @@ static void
 gdbserver_version (void)
 {
   printf ("GNU gdbserver %s%s\n"
-	  "Copyright (C) 2007 Free Software Foundation, Inc.\n"
+	  "Copyright (C) 2009 Free Software Foundation, Inc.\n"
 	  "gdbserver is free software, covered by the GNU General Public License.\n"
 	  "This gdbserver was configured as \"%s\"\n",
 	  PKGVERSION, version, host_name);
diff --git a/gdb/inflow.c b/gdb/inflow.c
index a7cb25f..972b52e 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -523,6 +523,20 @@ new_tty_prefork (const char *ttyname)
   inferior_thisrun_terminal = ttyname;
 }
 
+
+/* If RESULT, assumed to be the return value from a system call, is
+   negative, print the error message indicated by errno and exit.
+   MSG should identify the operation that failed.  */
+static void
+check_syscall (const char *msg, int result)
+{
+  if (result < 0)
+    {
+      print_sys_errmsg (msg, errno);
+      _exit (1);
+    }
+}
+
 void
 new_tty (void)
 {
@@ -549,27 +563,23 @@ new_tty (void)
 
   /* Now open the specified new terminal.  */
   tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY);
-  if (tty == -1)
-    {
-      print_sys_errmsg (inferior_thisrun_terminal, errno);
-      _exit (1);
-    }
+  check_syscall (inferior_thisrun_terminal, tty);
 
   /* Avoid use of dup2; doesn't exist on all systems.  */
   if (tty != 0)
     {
       close (0);
-      dup (tty);
+      check_syscall ("dup'ing tty into fd 0", dup (tty));
     }
   if (tty != 1)
     {
       close (1);
-      dup (tty);
+      check_syscall ("dup'ing tty into fd 1", dup (tty));
     }
   if (tty != 2)
     {
       close (2);
-      dup (tty);
+      check_syscall ("dup'ing tty into fd 2", dup (tty));
     }
 
 #ifdef TIOCSCTTY
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index dfa7ef2..9a7e39c 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -3684,8 +3684,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
       if ((procfile = fopen (fname1, "r")) != NULL)
 	{
 	  struct cleanup *cleanup = make_cleanup_fclose (procfile);
-	  fgets (buffer, sizeof (buffer), procfile);
-	  printf_filtered ("cmdline = '%s'\n", buffer);
+          if (fgets (buffer, sizeof (buffer), procfile))
+            printf_filtered ("cmdline = '%s'\n", buffer);
+          else
+            warning (_("unable to read '%s'"), fname1);
 	  do_cleanups (cleanup);
 	}
       else
diff --git a/gdb/main.c b/gdb/main.c
index ccd5e46..0eb9596 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -188,9 +188,6 @@ captured_main (void *data)
   line[0] = '\0';		/* Terminate saved (now empty) cmd line */
   instream = stdin;
 
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
-  current_directory = gdb_dirbuf;
-
   gdb_stdout = stdio_fileopen (stdout);
   gdb_stderr = stdio_fileopen (stderr);
   gdb_stdlog = gdb_stderr;	/* for moment */
@@ -199,6 +196,15 @@ captured_main (void *data)
   gdb_stdtargerr = gdb_stderr;	/* for moment */
   gdb_stdtargin = gdb_stdin;	/* for moment */
 
+  if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
+    /* Don't use *_filtered or warning() (which relies on
+       current_target) until after initialize_all_files(). */
+    fprintf_unfiltered (gdb_stderr,
+                        _("%s: warning: error finding working directory: %s\n"),
+                        argv[0], safe_strerror (errno));
+    
+  current_directory = gdb_dirbuf;
+
   /* Set the sysroot path.  */
 #ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
   gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT);
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index b40fac4..cbc9bdb 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -79,7 +79,10 @@ mi_cmd_env_pwd (char *command, char **argv, int argc)
      
   /* Otherwise the mi level is 2 or higher.  */
 
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
+  if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
+    error (_("mi_cmd_env_pwd: error finding name of working directory: %s"),
+           safe_strerror (errno));
+    
   ui_out_field_string (uiout, "cwd", gdb_dirbuf);
 }
 
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index e3cf970..7792133 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -22,6 +22,9 @@
 #include "serial.h"
 #include "ser-base.h"
 #include "ser-tcp.h"
+#include "gdbcmd.h"
+#include "cli/cli-decode.h"
+#include "cli/cli-setshow.h"
 
 #include <sys/types.h>
 
@@ -49,6 +52,7 @@
 
 #include <signal.h>
 #include "gdb_string.h"
+#include "gdb_select.h"
 
 #ifndef HAVE_SOCKLEN_T
 typedef int socklen_t;
@@ -56,10 +60,93 @@ typedef int socklen_t;
 
 void _initialize_ser_tcp (void);
 
-/* seconds to wait for connect */
-#define TIMEOUT 15
+/* 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.  */
+
+static int tcp_retry_limit = 15;
+
 /* how many times per second to poll deprecated_ui_loop_hook */
-#define POLL_INTERVAL 2
+
+#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
+wait_for_connect (struct serial *scb, int *polls)
+{
+  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;
+      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.  */


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-06 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-06 20:03 [SCM] master: 2009-01-06 Joel Sherrill <joel.sherrill@oarcorp.com> tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).