Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] XFAIL gdb.cp/mb-inline.exp conditionaly
Date: Thu, 23 Jun 2011 09:21:00 -0000	[thread overview]
Message-ID: <4E030591.6040709@codesourcery.com> (raw)
In-Reply-To: <201106221638.30062.pedro@codesourcery.com>

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

On 06/22/2011 11:38 PM, Pedro Alves wrote:
> Why not do "info breakpoints", and parse the output, checking if
> the breakpoint is really disabled?  If it is not, no point issuing
> the continue.

Oh, yes.  New patch is revised in this way.

> The breakpoint was set by line number, and we're reloading
> the session the same both times.  Why does breakpoint 1.2 become
> enabled (and I'm guessing that breakpoint 1.1 becomes disabled)?
> 

No, in my case, both 1.1 and 1.2 becomes enabled.
info break^M
Num     Type           Disp Enb Address    What^M
1       breakpoint     keep y   <MULTIPLE> ^M
        breakpoint already hit 3 times^M
1.1                         y     0xe78c90a8 in foo(int) at
gdb/testsuite/gdb.cp/mb-inline.h:26^M
1.2                         y     0xe78c91a8 in foo(int) at
gdb/testsuite/gdb.cp/mb-inline.h:26^M

During breakpoint updates (when inferior is re-created), GDB will
iterate list of breakpoint locations, to look for breakpoint locations
for a certain address in new inferior, and assign found breakpoint
locations to that breakpoint.  The state of breakpoint location
(enabled/disabled) is kept, and this test will pass.

If gdb is unable to find any breakpoint location for a given address,
gdb will create new breakpoint locations, and remove old breakpoint
location.  Then, the state of breakpoint location of previous inferior
is lost, and new created breakpoint location is enabled in default.

OK for mainline?

-- 
Yao (齐尧)

[-- Attachment #2: mb-inline-v2.patch --]
[-- Type: text/x-patch, Size: 1053 bytes --]

	gdb/testsuite/
	* gdb.cp/mb-inline.exp: Parse the output of `info break' to check breakpoint
	1.2 is disabled.  XFAIL for uclinux.

diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp
index 86cb5ba..81f7460 100644
--- a/gdb/testsuite/gdb.cp/mb-inline.exp
+++ b/gdb/testsuite/gdb.cp/mb-inline.exp
@@ -101,7 +101,19 @@ gdb_expect {
     }
 }
 
-gdb_continue_to_end "disabled breakpoint 1.2"
+gdb_test_multiple "info break" "disabled breakpoint 1.2" {
+    -re "1\.2.* n .* at .*$hdrfile:$bp_location.*$gdb_prompt $" {
+	pass "disabled breakpoint 1.2"
+    }
+    -re "1\.2.* y .* at .*$hdrfile:$bp_location.*$gdb_prompt $" {
+	# When inferior is restarted, breakpoint locations will be updated.
+	# On uclinux, it is not guaranteed that new inferior is located the
+	# same address as previous one, so status/state of breakpoint location
+	# will loose.
+	setup_xfail "*-*-uclinux*"
+	fail "disabled breakpoint 1.2"
+    }    
+}
 
 # Make sure we can set a breakpoint on a source statement that spans
 # multiple lines.

  reply	other threads:[~2011-06-23  9:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  6:17 Yao Qi
2011-06-22 15:38 ` Pedro Alves
2011-06-23  9:21   ` Yao Qi [this message]
2011-06-23 10:28     ` Pedro Alves
2011-06-23 13:40       ` Yao Qi
2011-06-23 14:00         ` Pedro Alves
2011-06-23 10:37     ` Pedro Alves
2011-06-23 14:41       ` Yao Qi

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=4E030591.6040709@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /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