Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: gdb-patches@sourceware.org
Subject: [Patch] Use resume instead of target_resume when stepping over watchpoint.
Date: Wed, 10 Sep 2008 00:32:00 -0000	[thread overview]
Message-ID: <48C71565.3050601@avtrex.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 929 bytes --]

In handle_inferior_event() when stepping over a watch point currently we
issue target_resume().  This only works on architectures that have
hardware single step support.  For gdbarch_software_single_step_p()
systems (like MIPS), we need to insert a single step breakpoint instead.

The fix is to call resume() as it does the right thing already.  I also
added an assert that inferior_ptid == ecs->ptid to be sure that resume()
was stepping the proper thread.

This is essentially the change requested by Daniel in:
http://sourceware.org/ml/gdb-patches/2008-04/msg00443.html

This change is a prerequisite for my forthcoming MIPS hardware watch patch.

Tested on x86_64-pc-linux-gnu as well as mipsel-linux (in conjunction
with the MIPS hardware watch patch).

OK to commit?

2008-09-09  David Daney  <ddaney@avtrex.com>

	* infrun.c (handle_inferior_event): Call resume instead of
	target_resume when stepping over watchpoint.



[-- Attachment #2: infrun.patch --]
[-- Type: text/plain, Size: 715 bytes --]

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.316
diff -u -p -r1.316 infrun.c
--- infrun.c	8 Sep 2008 22:10:20 -0000	1.316
+++ infrun.c	9 Sep 2008 23:37:09 -0000
@@ -2472,7 +2472,8 @@ targets should add new threads to the th
       if (!HAVE_STEPPABLE_WATCHPOINT)
 	remove_breakpoints ();
       registers_changed ();
-      target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);	/* Single step */
+      gdb_assert (ptid_equal (inferior_ptid, ecs->ptid));
+      resume (1, TARGET_SIGNAL_0);	/* Single step */
       waiton_ptid = ecs->ptid;
       if (HAVE_STEPPABLE_WATCHPOINT)
 	infwait_state = infwait_step_watch_state;

             reply	other threads:[~2008-09-10  0:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10  0:32 David Daney [this message]
2008-10-30  3:34 ` Joel Brobecker
2008-10-30 21:21   ` Pedro Alves
2008-10-30 21:43     ` Joel Brobecker
2008-10-31  2:13       ` David Daney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C71565.3050601@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox