* [PATCH] Set breakpoint on the right line
@ 2014-08-12 1:22 Yao Qi
2014-08-19 0:50 ` Yao Qi
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Yao Qi @ 2014-08-12 1:22 UTC (permalink / raw)
To: gdb-patches
In gdb.base/watchpoint-hw-hit-once.exp, test scans source and set
breakpoint on the line having "break-at-exit",
gdb_breakpoint [gdb_get_line_number "break-at-exit"]
However, in watchpoint-hw-hit-once.c, there are two lines having
this key word:
dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit. */
dummy = 2; /* break-at-exit */
so the test sets breakpoint on the first one, while I think it is
expected to set breakpoint on the second one, as far as I can tell
from the comments in watchpoint-hw-hit-once.c:
/* Stub lines are present as no breakpoints/watchpoint gets hit if current PC
already stays on the line PC while entering "step"/"continue". */
This patch is to change the source matching pattern so that test
can correctly set breakpoint on the right line. This patch fixes
a fail we found on arm-none-eabi target. Run it again
on x86_64-linux, no result changes.
gdb/testsuite:
2014-08-12 Yao Qi <yao@codesourcery.com>
* gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
right line.
---
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
index 53de3d5..49c0d6a 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
@@ -29,7 +29,7 @@ if ![runto_main] {
gdb_test "rwatch watchee"
-gdb_breakpoint [gdb_get_line_number "break-at-exit"]
+gdb_breakpoint [gdb_get_line_number "dummy = 2"]
gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
--
1.9.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Set breakpoint on the right line
2014-08-12 1:22 [PATCH] Set breakpoint on the right line Yao Qi
@ 2014-08-19 0:50 ` Yao Qi
2014-08-19 6:38 ` Joel Brobecker
2014-08-19 17:20 ` [OB/PUSHED] Remove stale comment (was: Re: [PATCH] Set breakpoint on the right line) Pedro Alves
2 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-08-19 0:50 UTC (permalink / raw)
To: gdb-patches
On 08/12/2014 09:18 AM, Yao Qi wrote:
> In gdb.base/watchpoint-hw-hit-once.exp, test scans source and set
> breakpoint on the line having "break-at-exit",
>
> gdb_breakpoint [gdb_get_line_number "break-at-exit"]
>
> However, in watchpoint-hw-hit-once.c, there are two lines having
> this key word:
>
> dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit. */
> dummy = 2; /* break-at-exit */
>
> so the test sets breakpoint on the first one, while I think it is
> expected to set breakpoint on the second one, as far as I can tell
> from the comments in watchpoint-hw-hit-once.c:
>
> /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC
> already stays on the line PC while entering "step"/"continue". */
>
> This patch is to change the source matching pattern so that test
> can correctly set breakpoint on the right line. This patch fixes
> a fail we found on arm-none-eabi target. Run it again
> on x86_64-linux, no result changes.
>
> gdb/testsuite:
>
> 2014-08-12 Yao Qi <yao@codesourcery.com>
>
> * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
> right line.
Ping. https://sourceware.org/ml/gdb-patches/2014-08/msg00190.html
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Set breakpoint on the right line
2014-08-12 1:22 [PATCH] Set breakpoint on the right line Yao Qi
2014-08-19 0:50 ` Yao Qi
@ 2014-08-19 6:38 ` Joel Brobecker
2014-08-19 13:35 ` Yao Qi
2014-08-19 17:20 ` [OB/PUSHED] Remove stale comment (was: Re: [PATCH] Set breakpoint on the right line) Pedro Alves
2 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2014-08-19 6:38 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> This patch is to change the source matching pattern so that test
> can correctly set breakpoint on the right line. This patch fixes
> a fail we found on arm-none-eabi target. Run it again
> on x86_64-linux, no result changes.
>
> gdb/testsuite:
>
> 2014-08-12 Yao Qi <yao@codesourcery.com>
>
> * gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
> right line.
I think you are right, but can you describe the error you are getting
with arm-none-eabi?
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Set breakpoint on the right line
2014-08-19 6:38 ` Joel Brobecker
@ 2014-08-19 13:35 ` Yao Qi
2014-08-19 13:48 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Yao Qi @ 2014-08-19 13:35 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On 08/19/2014 02:38 PM, Joel Brobecker wrote:
> I think you are right, but can you describe the error you are getting
> with arm-none-eabi?
Sure, the fail is shown as below:
continue^M
Continuing.^M
^M
*** EXIT code 0^M
[Inferior 1 (Remote target) exited normally]^M
(gdb) FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit (the program exited)
I also copy it in the commit log. Patch is pushed in.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Set breakpoint on the right line
2014-08-19 13:35 ` Yao Qi
@ 2014-08-19 13:48 ` Joel Brobecker
2014-08-20 0:21 ` Yao Qi
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2014-08-19 13:48 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> > I think you are right, but can you describe the error you are getting
> > with arm-none-eabi?
>
> Sure, the fail is shown as below:
>
> continue^M
> Continuing.^M
> ^M
> *** EXIT code 0^M
> [Inferior 1 (Remote target) exited normally]^M
> (gdb) FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit (the program exited)
>
> I also copy it in the commit log. Patch is pushed in.
I actually didn't pre-approve, but never mind :-).
I think I understand, now. The problem using the first break-at-exit
line was that the watchpoint would be triggering at the same location
the breakpoint was inserted. So the "continue" test right after would
never hit that breakpoint. If my understanding is correct, the patch
is officially approved :).
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Set breakpoint on the right line
2014-08-19 13:48 ` Joel Brobecker
@ 2014-08-20 0:21 ` Yao Qi
0 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2014-08-20 0:21 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On 08/19/2014 09:48 PM, Joel Brobecker wrote:
> I actually didn't pre-approve, but never mind :-).
>
Ur, I misunderstood you, sorry.
> I think I understand, now. The problem using the first break-at-exit
> line was that the watchpoint would be triggering at the same location
> the breakpoint was inserted. So the "continue" test right after would
> never hit that breakpoint. If my understanding is correct, the patch
> is officially approved :).
Yes, that is correct.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [OB/PUSHED] Remove stale comment (was: Re: [PATCH] Set breakpoint on the right line)
2014-08-12 1:22 [PATCH] Set breakpoint on the right line Yao Qi
2014-08-19 0:50 ` Yao Qi
2014-08-19 6:38 ` Joel Brobecker
@ 2014-08-19 17:20 ` Pedro Alves
2 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2014-08-19 17:20 UTC (permalink / raw)
To: Yao Qi, gdb-patches
On 08/12/2014 02:18 AM, Yao Qi wrote:
>
> /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC
> already stays on the line PC while entering "step"/"continue". */
I noticed that this comment is stale. This is no longer true for
watchpoints. I've pushed this as obvious.
-------------------------
Remove stale comment
This comment is no longer true for watchpoints since commit 31e77af2
(PR breakpoints/7143 - Watchpoint does not trigger when first set).
gdb/testsuite/
* gdb.base/watchpoint-hw-hit-once.c (main): Update comment.
---
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 060c7a1..d30f7a3 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-19 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/watchpoint-hw-hit-once.c (main): Update comment.
+
2014-08-19 Yao Qi <yao@codesourcery.com>
* gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c
index 8ba8ca4..aa64f1d 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c
@@ -22,7 +22,7 @@ main (void)
{
volatile int dummy;
- /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC
+ /* Stub lines are present as no breakpoint gets hit if current PC
already stays on the line PC while entering "step"/"continue". */
dummy = 0; /* Stub to catch WATCHEE access after runto_main. */
--
1.9.3
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-08-20 0:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-12 1:22 [PATCH] Set breakpoint on the right line Yao Qi
2014-08-19 0:50 ` Yao Qi
2014-08-19 6:38 ` Joel Brobecker
2014-08-19 13:35 ` Yao Qi
2014-08-19 13:48 ` Joel Brobecker
2014-08-20 0:21 ` Yao Qi
2014-08-19 17:20 ` [OB/PUSHED] Remove stale comment (was: Re: [PATCH] Set breakpoint on the right line) Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox