Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch 3/4] Fix hw watchpoints: remove dead code  [update]
Date: Sat, 03 Oct 2009 17:11:00 -0000	[thread overview]
Message-ID: <20091003171059.GC26203@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20090817194624.GD10694@host0.dyn.jankratochvil.net>

Hi,

just a rediff on top of the patch 1/4.


Thanks,
Jan

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

simple dead code removal.  Code would become invalid with the changes anyway.

The testcase is in fact unrelated, just I was surprised "hbreak" functionality
is currently not regression tested anywhere.


gdb/
2009-08-17  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* i386-nat.c (i386_stopped_by_hwbp): Remove.

gdb/testsuite/
2009-10-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/watchpoint-hw.exp: New variable breakline.
	(hbreak, continue to break-at-exit after hbreak): New tests.

--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -593,27 +593,6 @@ i386_stopped_by_watchpoint (void)
   return target_stopped_data_address (&current_target, &addr);
 }
 
-/* Return non-zero if the inferior has some break/watchpoint that
-   triggered.  */
-
-static int
-i386_stopped_by_hwbp (void)
-{
-  int i;
-
-  dr_status_mirror = i386_dr_low.get_status ();
-  if (maint_show_dr)
-    i386_show_dr ("stopped_by_hwbp", 0, 0, hw_execute);
-
-  ALL_DEBUG_REGISTERS(i)
-    {
-      if (I386_DR_WATCH_HIT (i))
-	return 1;
-    }
-
-  return 0;
-}
-
 /* Insert a hardware-assisted breakpoint at BP_TGT->placed_address.
    Return 0 on success, EBUSY on failure.  */
 static int
--- a/gdb/testsuite/gdb.base/watchpoint-hw.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp
@@ -53,11 +53,27 @@ if ![runto_main] {
 
 gdb_test "rwatch watchee"
 
-gdb_breakpoint [gdb_get_line_number "break-at-exit"]
+set breakline [gdb_get_line_number "break-at-exit"]
+gdb_breakpoint $breakline
 
 gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
 
 # Here should be no repeated notification of the read watchpoint.
 gdb_test "continue" \
 	 "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \
-	 "continue to break-at-exit"
+	 "continue to break-at-exit after rwatch"
+
+clean_restart ${test}
+
+if ![runto_main] {
+    untested ${test}.exp
+    return -1
+}
+
+gdb_test "hbreak ${srcfile}:${breakline}" \
+	 "Hardware assisted breakpoint 2 at 0x\[0-9a-f\]+: file .*${srcfile}, line ${breakline}\\." \
+	 "hbreak"
+
+gdb_test "continue" \
+	 "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \
+	 "continue to break-at-exit after hbreak"


  reply	other threads:[~2009-10-03 17:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 19:46 [patch 3/4] Fix hw watchpoints: remove dead code Jan Kratochvil
2009-10-03 17:11 ` Jan Kratochvil [this message]
2009-10-07 18:51   ` [patch 3/4] Fix hw watchpoints: remove dead code [update] Joel Brobecker
2009-10-07 19:28     ` Joel Brobecker
2009-10-07 19:40     ` Jan Kratochvil
2009-10-07 19:55     ` Jan Kratochvil
2009-10-07 21:51   ` Joel Brobecker
2009-10-08 13:10     ` Jan Kratochvil

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=20091003171059.GC26203@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.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