public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master:  * inflow.c (copy_terminal_info): Deep copy `run_terminal'.
@ 2009-05-24 21:39 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-05-24 21:39 UTC (permalink / raw)
  To: archer-commits

The branch, master has been updated
       via  546da8d3a3377dc9e427f354e1edb0da4ef9b4c8 (commit)
       via  0efdb1199ccffd23a13d30a9e917fb5f7182ad8b (commit)
       via  36e31abea910a4676548f886c9833f68b2248391 (commit)
       via  e52936c1ba43e5e5e1b8ef8af204dc365cc04d63 (commit)
       via  ab50f59f12b38d09a50cff1a27f2cc79bb64b410 (commit)
       via  bf0cd74600c9c7305a99e1c3912296d6f8bcd7c5 (commit)
       via  3762a5c52929067fe652808aa9560b1f06ef01a6 (commit)
       via  7e02d1681fe6880801781375fa78ca29bc3bc27f (commit)
       via  6fea4b8aef82dd1c02e76454d9ba4f433e435434 (commit)
       via  23c9946e3b77ae32350d2601ed35d4e6f7aba1d9 (commit)
       via  f3cb6ca5b57df4e72a47143cf951a3ba0703a777 (commit)
      from  e1e21f169b161d369fd4e7efdbc0cfd8ef400a3c (commit)

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

- Log -----------------------------------------------------------------
commit 546da8d3a3377dc9e427f354e1edb0da4ef9b4c8
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Sun May 24 18:16:53 2009 +0000

    	* inflow.c (copy_terminal_info): Deep copy `run_terminal'.

commit 0efdb1199ccffd23a13d30a9e917fb5f7182ad8b
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Sun May 24 18:00:07 2009 +0000

    gdb/
    	* gdbthread.h (struct thread_info): New `pending_follow' field.
    	* thread.c (new_thread): New function.
    	(add_thread_silent): Use it.
    	* breakpoint.c (internal_breakpoint_number): New global, moved
    	from inside...
    	(create_internal_breakpoint): ... this.
    	(clone_momentary_breakpoint): New.
    	* breakpoint.h (clone_momentary_breakpoint): Declare.
    	* infrun.c (nullify_last_target_wait_ptid): Move declaration
    	higher.
    	(pending_follow): Delete.
    	(follow_fork): Handle pending follow fork event here.  Moved the
    	preserving of thread stepping state here.
    	(resume): Don't handle pending follow fork events here.  Only
    	install the inferior's terminal modes if we're about to resume it.
    	(proceed): Handle possible pending follow fork events here.
    	(init_wait_for_inferior): No need to clear pending_follow anymore,
    	it's gone.
    	(handle_inferior_event): Adjust to per-thread `pending_follow'.
    	Call `follow_fork' to handle following the fork.  If the
    	follow-fork is cancelled, stop stepping.
    	* linux-nat.c (linux_child_follow_fork): Adjust to per-thread
    	`pending_follow' events.  Remove code that handled preserving the
    	thread stepping state.
    	* inf-ptrace.c (inf_ptrace_follow_fork): Ditto.
    	* inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
    
    gdb/testsuite/
    	* gdb.threads/fork-thread-pending.c: New.
    	* gdb.threads/fork-thread-pending.exp: New.

commit 36e31abea910a4676548f886c9833f68b2248391
Author: Doug Evans <dje@google.com>
Date:   Sun May 24 17:44:19 2009 +0000

    	* linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
    	to resume the newly created thread, don't call ptrace (PTRACE_CONT)
    	directly.

commit e52936c1ba43e5e5e1b8ef8af204dc365cc04d63
Author: Doug Evans <dje@google.com>
Date:   Sun May 24 17:37:33 2009 +0000

    	* linux-low.c (get_stop_pc): Print pc if debug_threads.
    	(check_removed_breakpoint, linux_wait_for_lwp): Ditto.
    	(linux_resume_one_lwp): Ditto.

commit ab50f59f12b38d09a50cff1a27f2cc79bb64b410
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Sun May 24 12:31:43 2009 +0000

     * Correct date for last commit

commit bf0cd74600c9c7305a99e1c3912296d6f8bcd7c5
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Sun May 24 12:27:35 2009 +0000

    	* symfile.c (add_shared_symbol_files_command): Remove
    	prototype and function.
    	(_initialize _symfile): Move "add-shared-symbol-files"
    	command and "assf" alias.
    	* windows-nat.c (_initialize_windows_nat): to here.
    	Change "add-shared-symbol-files" to alias.
    
    	* config/i386/cygwin.mh: Remove NAT_FILE.
    	* config/i386/mingw.mh: Remove NAT_FILE.
    	* config/i386/mingw64.mh: Remove NAT_FILE.
    	* config/i386/nm-cygwin.h: Remove file.
    	* config/i386/nm-cygwin64.h: Remove file.

commit 3762a5c52929067fe652808aa9560b1f06ef01a6
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sun May 24 11:47:27 2009 +0000

           * bfdio.c (bfd_seek): Formatting.  Ensure newly allocated memory
           for BFD_IN_MEMORY is cleared.
           (bfd_bwrite): Zero excess memory allocated.

commit 7e02d1681fe6880801781375fa78ca29bc3bc27f
Author: Hui Zhu <teawater@gmail.com>
Date:   Sun May 24 04:42:49 2009 +0000

    	* i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
    	I386_LINUX_RECORD_IOCTL_*,
    	I386_LINUX_RECORD_FCNTL_*) Removed.
    	(i386_linux_init_abi): Change size of record from macros to
    	numbers.
    	* i386-linux-tdep.c (i386_linux_init_abi): Remove size_char.
    	* linux-record.c (record_linux_system_call): Ditto.
    	* linux-record.h (linux_record_tdep): Ditto.

commit 6fea4b8aef82dd1c02e76454d9ba4f433e435434
Author: Doug Evans <dje@google.com>
Date:   Sun May 24 01:09:22 2009 +0000

    	* linux-low.c (linux_resume_one_lwp): Change type of first arg
    	from struct inferior_list_entry * to struct lwp_info *.
    	All callers updated.

commit 23c9946e3b77ae32350d2601ed35d4e6f7aba1d9
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sun May 24 00:00:04 2009 +0000

    daily update

commit f3cb6ca5b57df4e72a47143cf951a3ba0703a777
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sun May 24 00:00:03 2009 +0000

    *** empty log message ***

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

Summary of changes:
 bfd/ChangeLog                                     |    6 +
 bfd/bfdio.c                                       |    7 +-
 bfd/version.h                                     |    2 +-
 gdb/ChangeLog                                     |   62 +++
 gdb/breakpoint.c                                  |   40 ++-
 gdb/breakpoint.h                                  |    2 +
 gdb/config/i386/cygwin.mh                         |    1 -
 gdb/config/i386/mingw.mh                          |    1 -
 gdb/config/i386/mingw64.mh                        |    1 -
 gdb/config/i386/nm-cygwin.h                       |   20 -
 gdb/config/i386/nm-cygwin64.h                     |   19 -
 gdb/gdbserver/ChangeLog                           |   16 +
 gdb/gdbserver/linux-low.c                         |   73 ++--
 gdb/gdbthread.h                                   |    5 +
 gdb/i386-linux-tdep.c                             |  461 +++++++--------------
 gdb/inf-ptrace.c                                  |   36 +--
 gdb/inf-ttrace.c                                  |   44 +--
 gdb/inflow.c                                      |    3 +-
 gdb/infrun.c                                      |  241 +++++++++---
 gdb/linux-nat.c                                   |   37 +--
 gdb/linux-record.c                                |    3 +-
 gdb/linux-record.h                                |    1 -
 gdb/symfile.c                                     |   20 +-
 gdb/testsuite/ChangeLog                           |    5 +
 gdb/testsuite/gdb.threads/fork-thread-pending.c   |  109 +++++
 gdb/testsuite/gdb.threads/fork-thread-pending.exp |  128 ++++++
 gdb/thread.c                                      |   37 ++-
 gdb/version.in                                    |    2 +-
 gdb/windows-nat.c                                 |    4 +
 29 files changed, 796 insertions(+), 590 deletions(-)
 delete mode 100644 gdb/config/i386/nm-cygwin.h
 delete mode 100644 gdb/config/i386/nm-cygwin64.h
 create mode 100644 gdb/testsuite/gdb.threads/fork-thread-pending.c
 create mode 100644 gdb/testsuite/gdb.threads/fork-thread-pending.exp

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6e5652f..217b96c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-24  Alan Modra  <amodra@bigpond.net.au>
+
+       * bfdio.c (bfd_seek): Formatting.  Ensure newly allocated memory
+       for BFD_IN_MEMORY is cleared.
+       (bfd_bwrite): Zero excess memory allocated.
+
 2009-05-22  Julian Brown  <julian@codesourcery.com>
 
 	* elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index d3a295c..16bbf03 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -235,6 +235,8 @@ bfd_bwrite (const void *ptr, bfd_size_type size, bfd *abfd)
 		  bim->size = 0;
 		  return 0;
 		}
+	      if (newsize > bim->size)
+		memset (bim->buffer + bim->size, 0, newsize - bim->size);
 	    }
 	}
       memcpy (bim->buffer + abfd->where, ptr, (size_t) size);
@@ -342,8 +344,8 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
 
       if (abfd->where > bim->size)
 	{
-	  if ((abfd->direction == write_direction) ||
-	      (abfd->direction == both_direction))
+	  if (abfd->direction == write_direction
+	      || abfd->direction == both_direction)
 	    {
 	      bfd_size_type newsize, oldsize;
 
@@ -359,6 +361,7 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
 		      bim->size = 0;
 		      return -1;
 		    }
+		  memset (bim->buffer + oldsize, 0, newsize - oldsize);
 	        }
 	    }
 	  else
diff --git a/bfd/version.h b/bfd/version.h
index 051e953..befa484 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20090523
+#define BFD_VERSION_DATE 20090524
 #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 bcc9ab1..cd8671b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,65 @@
+2009-05-24  Pedro Alves  <pedro@codesourcery.com>
+
+	* inflow.c (copy_terminal_info): Deep copy `run_terminal'.
+
+2009-05-24  Pedro Alves  <pedro@codesourcery.com>
+
+	* gdbthread.h (struct thread_info): New `pending_follow' field.
+	* thread.c (new_thread): New function.
+	(add_thread_silent): Use it.
+	* breakpoint.c (internal_breakpoint_number): New global, moved
+	from inside...
+	(create_internal_breakpoint): ... this.
+	(clone_momentary_breakpoint): New.
+	* breakpoint.h (clone_momentary_breakpoint): Declare.
+	* infrun.c (nullify_last_target_wait_ptid): Move declaration
+	higher.
+	(pending_follow): Delete.
+	(follow_fork): Handle pending follow fork event here.  Moved the
+	preserving of thread stepping state here.
+	(resume): Don't handle pending follow fork events here.  Only
+	install the inferior's terminal modes if we're about to resume it.
+	(proceed): Handle possible pending follow fork events here.
+	(init_wait_for_inferior): No need to clear pending_follow anymore,
+	it's gone.
+	(handle_inferior_event): Adjust to per-thread `pending_follow'.
+	Call `follow_fork' to handle following the fork.  If the
+	follow-fork is cancelled, stop stepping.
+	* linux-nat.c (linux_child_follow_fork): Adjust to per-thread
+	`pending_follow' events.  Remove code that handled preserving the
+	thread stepping state.
+	* inf-ptrace.c (inf_ptrace_follow_fork): Ditto.
+	* inf-ttrace.c (inf_ttrace_follow_fork): Ditto.
+
+2009-05-24  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+	* symfile.c (add_shared_symbol_files_command): Remove
+	prototype and function.
+	(_initialize _symfile): Move "add-shared-symbol-files"
+	command and "assf" alias.
+	* windows-nat.c (_initialize_windows_nat): to here.
+	Change "add-shared-symbol-files" to alias.
+	
+	* config/i386/cygwin.mh: Remove NAT_FILE.
+	* config/i386/mingw.mh: Remove NAT_FILE.
+	* config/i386/mingw64.mh: Remove NAT_FILE.
+	* config/i386/nm-cygwin.h: Remove file.
+	* config/i386/nm-cygwin64.h: Remove file.
+
+2009-05-24  Hui Zhu  <teawater@gmail.com>
+
+	* i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
+	I386_LINUX_RECORD_IOCTL_*,
+	I386_LINUX_RECORD_FCNTL_*) Removed.
+	(i386_linux_init_abi): Change size of record from macros to
+	numbers.
+
+2009-05-24  Hui Zhu  <teawater@gmail.com>
+
+	* i386-linux-tdep.c (i386_linux_init_abi): Remove size_char.
+	* linux-record.c (record_linux_system_call): Ditto.
+	* linux-record.h (linux_record_tdep): Ditto.
+
 2009-05-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	Replace the savestring calls by xstrdup calls where possible.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b5362e2..1235946 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1456,10 +1456,11 @@ reattach_breakpoints (int pid)
   return 0;
 }
 
+static int internal_breakpoint_number = -1;
+
 static struct breakpoint *
 create_internal_breakpoint (CORE_ADDR address, enum bptype type)
 {
-  static int internal_breakpoint_number = -1;
   struct symtab_and_line sal;
   struct breakpoint *b;
 
@@ -5007,6 +5008,43 @@ set_momentary_breakpoint (struct symtab_and_line sal, struct frame_id frame_id,
   return b;
 }
 
+/* Make a deep copy of momentary breakpoint ORIG.  Returns NULL if
+   ORIG is NULL.  */
+
+struct breakpoint *
+clone_momentary_breakpoint (struct breakpoint *orig)
+{
+  struct breakpoint *copy;
+
+  /* If there's nothing to clone, then return nothing.  */
+  if (orig == NULL)
+    return NULL;
+
+  copy = set_raw_breakpoint_without_location (orig->type);
+  copy->loc = allocate_bp_location (copy);
+  set_breakpoint_location_function (copy->loc);
+
+  copy->loc->requested_address = orig->loc->requested_address;
+  copy->loc->address = orig->loc->address;
+  copy->loc->section = orig->loc->section;
+
+  if (orig->source_file == NULL)
+    copy->source_file = NULL;
+  else
+    copy->source_file = xstrdup (orig->source_file);
+
+  copy->line_number = orig->line_number;
+  copy->frame_id = orig->frame_id;
+  copy->thread = orig->thread;
+
+  copy->enable_state = bp_enabled;
+  copy->disposition = disp_donttouch;
+  copy->number = internal_breakpoint_number--;
+
+  update_global_location_list_nothrow (0);
+  return copy;
+}
+
 struct breakpoint *
 set_momentary_breakpoint_at_pc (CORE_ADDR pc, enum bptype type)
 {
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 43c2f3f..4e672b5 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -696,6 +696,8 @@ extern struct breakpoint *set_momentary_breakpoint
 extern struct breakpoint *set_momentary_breakpoint_at_pc
   (CORE_ADDR pc, enum bptype type);
 
+extern struct breakpoint *clone_momentary_breakpoint (struct breakpoint *bpkt);
+
 extern void set_ignore_count (int, int, int);
 
 extern void set_default_breakpoint (int, CORE_ADDR, struct symtab *, int);
diff --git a/gdb/config/i386/cygwin.mh b/gdb/config/i386/cygwin.mh
index 5b5a143..b704158 100644
--- a/gdb/config/i386/cygwin.mh
+++ b/gdb/config/i386/cygwin.mh
@@ -1,4 +1,3 @@
 MH_CFLAGS=
 NATDEPFILES= i386-nat.o windows-nat.o i386-windows-nat.o
-NAT_FILE=nm-cygwin.h
 XM_CLIBS=
diff --git a/gdb/config/i386/mingw.mh b/gdb/config/i386/mingw.mh
index 5b5a143..b704158 100644
--- a/gdb/config/i386/mingw.mh
+++ b/gdb/config/i386/mingw.mh
@@ -1,4 +1,3 @@
 MH_CFLAGS=
 NATDEPFILES= i386-nat.o windows-nat.o i386-windows-nat.o
-NAT_FILE=nm-cygwin.h
 XM_CLIBS=
diff --git a/gdb/config/i386/mingw64.mh b/gdb/config/i386/mingw64.mh
index 20809b8..ba6fd9f 100644
--- a/gdb/config/i386/mingw64.mh
+++ b/gdb/config/i386/mingw64.mh
@@ -1,2 +1 @@
 NATDEPFILES= i386-nat.o windows-nat.o amd64-windows-nat.o
-NAT_FILE=nm-cygwin64.h
diff --git a/gdb/config/i386/nm-cygwin.h b/gdb/config/i386/nm-cygwin.h
deleted file mode 100644
index 24aa749..0000000
--- a/gdb/config/i386/nm-cygwin.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Native definitions for Intel x86 running CYGWIN.
-   Copyright 2002, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
-void dll_symbol_command (char *, int);
diff --git a/gdb/config/i386/nm-cygwin64.h b/gdb/config/i386/nm-cygwin64.h
deleted file mode 100644
index 345423f..0000000
--- a/gdb/config/i386/nm-cygwin64.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright 2008, 2009 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#define ADD_SHARED_SYMBOL_FILES dll_symbol_command
-void dll_symbol_command (char *, int);
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 333ab71..472fc00 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,19 @@
+2009-05-24  Doug Evans  <dje@google.com>
+
+	* linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
+	to resume the newly created thread, don't call ptrace (PTRACE_CONT)
+	directly.
+
+	* linux-low.c (get_stop_pc): Print pc if debug_threads.
+	(check_removed_breakpoint, linux_wait_for_lwp): Ditto.
+	(linux_resume_one_lwp): Ditto.
+
+2009-05-23  Doug Evans  <dje@google.com>
+
+	* linux-low.c (linux_resume_one_lwp): Change type of first arg
+	from struct inferior_list_entry * to struct lwp_info *.
+	All callers updated.
+
 2009-05-13  Doug Evans  <dje@google.com>
 
 	* linux-x86-low.c: Don't include assert.h.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 3b53a05..9af9e6e 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -121,7 +121,7 @@ int using_threads = 1;
    control of gdbserver have the same architecture.  */
 static int new_inferior;
 
-static void linux_resume_one_lwp (struct inferior_list_entry *entry,
+static void linux_resume_one_lwp (struct lwp_info *lwp,
 				  int step, int signal, siginfo_t *info);
 static void linux_resume (struct thread_resume *resume_info, size_t n);
 static void stop_all_lwps (void);
@@ -295,36 +295,38 @@ handle_extended_wait (struct lwp_info *event_child, int wstat)
       new_lwp = (struct lwp_info *) add_lwp (ptid);
       add_thread (ptid, new_lwp);
 
+      /* Either we're going to immediately resume the new thread
+	 or leave it stopped.  linux_resume_one_lwp is a nop if it
+	 thinks the thread is currently running, so set this first
+	 before calling linux_resume_one_lwp.  */
+      new_lwp->stopped = 1;
+
       /* Normally we will get the pending SIGSTOP.  But in some cases
 	 we might get another signal delivered to the group first.
 	 If we do get another signal, be sure not to lose it.  */
       if (WSTOPSIG (status) == SIGSTOP)
 	{
-	  if (stopping_threads)
-	    new_lwp->stopped = 1;
-	  else
-	    ptrace (PTRACE_CONT, new_pid, 0, 0);
+	  if (! stopping_threads)
+	    linux_resume_one_lwp (new_lwp, 0, 0, NULL);
 	}
       else
 	{
 	  new_lwp->stop_expected = 1;
 	  if (stopping_threads)
 	    {
-	      new_lwp->stopped = 1;
 	      new_lwp->status_pending_p = 1;
 	      new_lwp->status_pending = status;
 	    }
 	  else
 	    /* Pass the signal on.  This is what GDB does - except
 	       shouldn't we really report it instead?  */
-	    ptrace (PTRACE_CONT, new_pid, 0, WSTOPSIG (status));
+	    linux_resume_one_lwp (new_lwp, 0, WSTOPSIG (status), NULL);
 	}
 
       /* Always resume the current thread.  If we are stopping
 	 threads, it will have a pending SIGSTOP; we may as well
 	 collect it now.  */
-      linux_resume_one_lwp (&event_child->head,
-			    event_child->stepping, 0, NULL);
+      linux_resume_one_lwp (event_child, event_child->stepping, 0, NULL);
     }
 }
 
@@ -355,10 +357,13 @@ get_stop_pc (void)
 {
   CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
 
-  if (get_thread_lwp (current_inferior)->stepping)
-    return stop_pc;
-  else
-    return stop_pc - the_low_target.decr_pc_after_break;
+  if (! get_thread_lwp (current_inferior)->stepping)
+    stop_pc -= the_low_target.decr_pc_after_break;
+
+  if (debug_threads)
+    fprintf (stderr, "stop pc is 0x%lx\n", (long) stop_pc);
+
+  return stop_pc;
 }
 
 static void *
@@ -688,7 +693,7 @@ linux_detach_one_lwp (struct inferior_list_entry *entry, void *args)
       /* Clear stop_expected, so that the SIGSTOP will be reported.  */
       lwp->stop_expected = 0;
       if (lwp->stopped)
-	linux_resume_one_lwp (&lwp->head, 0, 0, NULL);
+	linux_resume_one_lwp (lwp, 0, 0, NULL);
       linux_wait_for_event (lwp->head.id, &wstat, __WALL);
     }
 
@@ -815,7 +820,11 @@ check_removed_breakpoint (struct lwp_info *event_child)
      decrement.  We go immediately from this function to resuming,
      and can not safely call get_stop_pc () again.  */
   if (the_low_target.set_pc != NULL)
-    (*the_low_target.set_pc) (stop_pc);
+    {
+      if (debug_threads)
+	fprintf (stderr, "Set pc to 0x%lx\n", (long) stop_pc);
+      (*the_low_target.set_pc) (stop_pc);
+    }
 
   /* We consumed the pending SIGTRAP.  */
   event_child->pending_is_breakpoint = 0;
@@ -849,7 +858,7 @@ status_pending_p (struct inferior_list_entry *entry, void *arg)
 	   So instead of reporting the old SIGTRAP, pretend we got to
 	   the breakpoint just after it was removed instead of just
 	   before; resume the process.  */
-	linux_resume_one_lwp (&lwp->head, 0, 0, NULL);
+	linux_resume_one_lwp (lwp, 0, 0, NULL);
 	return 0;
       }
 
@@ -943,14 +952,16 @@ retry:
     }
 
   if (debug_threads
-      && WIFSTOPPED (*wstatp))
+      && WIFSTOPPED (*wstatp)
+      && the_low_target.get_pc != NULL)
     {
       struct thread_info *saved_inferior = current_inferior;
+      CORE_ADDR pc;
+
       current_inferior = (struct thread_info *)
 	find_inferior_id (&all_threads, child->head.id);
-      /* For testing only; i386_stop_pc prints out a diagnostic.  */
-      if (the_low_target.get_pc != NULL)
-	get_stop_pc ();
+      pc = (*the_low_target.get_pc) ();
+      fprintf (stderr, "linux_wait_for_lwp: pc is 0x%lx\n", (long) pc);
       current_inferior = saved_inferior;
     }
 
@@ -1074,8 +1085,7 @@ linux_wait_for_event_1 (ptid_t ptid, int *wstat, int options)
 	  if (debug_threads)
 	    fprintf (stderr, "Expected stop.\n");
 	  event_child->stop_expected = 0;
-	  linux_resume_one_lwp (&event_child->head,
-				event_child->stepping, 0, NULL);
+	  linux_resume_one_lwp (event_child, event_child->stepping, 0, NULL);
 	  continue;
 	}
 
@@ -1117,7 +1127,7 @@ linux_wait_for_event_1 (ptid_t ptid, int *wstat, int options)
 	    info_p = &info;
 	  else
 	    info_p = NULL;
-	  linux_resume_one_lwp (&event_child->head,
+	  linux_resume_one_lwp (event_child,
 				event_child->stepping,
 				WSTOPSIG (*wstat), info_p);
 	  continue;
@@ -1147,7 +1157,7 @@ linux_wait_for_event_1 (ptid_t ptid, int *wstat, int options)
 	  event_child->bp_reinsert = 0;
 
 	  /* Clear the single-stepping flag and SIGTRAP as we resume.  */
-	  linux_resume_one_lwp (&event_child->head, 0, 0, NULL);
+	  linux_resume_one_lwp (event_child, 0, 0, NULL);
 	  continue;
 	}
 
@@ -1189,18 +1199,18 @@ linux_wait_for_event_1 (ptid_t ptid, int *wstat, int options)
 	     events.  */
 	  if (bp_status == 2)
 	    /* No need to reinsert.  */
-	    linux_resume_one_lwp (&event_child->head, 0, 0, NULL);
+	    linux_resume_one_lwp (event_child, 0, 0, NULL);
 	  else if (the_low_target.breakpoint_reinsert_addr == NULL)
 	    {
 	      event_child->bp_reinsert = stop_pc;
 	      uninsert_breakpoint (stop_pc);
-	      linux_resume_one_lwp (&event_child->head, 1, 0, NULL);
+	      linux_resume_one_lwp (event_child, 1, 0, NULL);
 	    }
 	  else
 	    {
 	      reinsert_breakpoint_by_bp
 		(stop_pc, (*the_low_target.breakpoint_reinsert_addr) ());
-	      linux_resume_one_lwp (&event_child->head, 0, 0, NULL);
+	      linux_resume_one_lwp (event_child, 0, 0, NULL);
 	    }
 
 	  continue;
@@ -1645,10 +1655,9 @@ stop_all_lwps (void)
    If SIGNAL is nonzero, give it that signal.  */
 
 static void
-linux_resume_one_lwp (struct inferior_list_entry *entry,
+linux_resume_one_lwp (struct lwp_info *lwp,
 		      int step, int signal, siginfo_t *info)
 {
-  struct lwp_info *lwp = (struct lwp_info *) entry;
   struct thread_info *saved_inferior;
 
   if (lwp->stopped == 0)
@@ -1709,8 +1718,8 @@ linux_resume_one_lwp (struct inferior_list_entry *entry,
 
   if (debug_threads && the_low_target.get_pc != NULL)
     {
-      fprintf (stderr, "  ");
-      (*the_low_target.get_pc) ();
+      CORE_ADDR pc = (*the_low_target.get_pc) ();
+      fprintf (stderr, "  resuming from pc 0x%lx\n", (long) pc);


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


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

only message in thread, other threads:[~2009-05-24 21:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-24 21:39 [SCM] master: * inflow.c (copy_terminal_info): Deep copy `run_terminal' jkratoch

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).