public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug testsuite/31391] Incorrect FinishBreakpoint test
Date: Tue, 27 Feb 2024 15:18:25 +0000	[thread overview]
Message-ID: <bug-31391-4717-8TevT9DONU@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31391-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31391

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cfb9cb1afd93dc71ea94ec7c7d9bfc0e43ace0bc

commit cfb9cb1afd93dc71ea94ec7c7d9bfc0e43ace0bc
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Feb 27 16:18:32 2024 +0100

    [gdb/testsuite] Fix test in gdb.python/py-finish-breakpoint.exp

    With test-case gdb.python/py-finish-breakpoint.exp, we run into:
    ...
    (gdb) python print (finishbp_default.hit_count)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    RuntimeError: Breakpoint 3 is invalid.
    Error while executing Python code.
    (gdb) PASS: gdb.python/py-finish-breakpoint.exp: normal conditions: \
      check finishBP on default frame has been hit
    ...

    The test producing the pass is:
    ...
        gdb_test "python print (finishbp_default.hit_count)" "1.*" \
          "check finishBP on default frame has been hit"
    ...
    so the pass is produced because the 1 in "line 1" matches "1.*".

    Temporary breakpoints are removed when hit, and consequently accessing the
    hit_count attribute of a temporary python breakpoint (gdb.Breakpoint class)
is
    not possible, and as per spec we get a RuntimeError.

    So the RuntimeError is correct, and not specific to finish breakpoints.

    The test presumably attempts to match:
    ...
    (gdb) python print (finishbp_default.hit_count)
    1
    ...
    but most likely this output was never produced by any gdb version.

    Fix this by checking whether the finishbp_default breakpoint has hit by
    checking that finishbp_default.is_valid() is False.

    Tested on aarch64-linux.

    Approved-By: Tom Tromey <tom@tromey.com>

    PR testsuite/31391
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31391

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2024-02-27 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 15:41 [Bug python/31391] New: " tromey at sourceware dot org
2024-02-18 10:23 ` [Bug python/31391] " ssbssa at sourceware dot org
2024-02-26 16:05 ` vries at gcc dot gnu.org
2024-02-27  8:22 ` vries at gcc dot gnu.org
2024-02-27  9:14 ` vries at gcc dot gnu.org
2024-02-27  9:14 ` [Bug testsuite/31391] " vries at gcc dot gnu.org
2024-02-27 15:18 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-27 15:19 ` vries at gcc dot gnu.org

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=bug-31391-4717-8TevT9DONU@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).