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 gdb/26524] advance/until and multiple locations
Date: Thu, 27 Aug 2020 20:04:57 +0000	[thread overview]
Message-ID: <bug-26524-4717-Qc624bakTD@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26524-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

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

commit df63178325a5705a609bff94a349162bbb839895
Author: Pedro Alves <pedro@palves.net>
Date:   Thu Aug 27 21:03:53 2020 +0100

    Fix advance/until and multiple locations (PR gdb/26524)

    If you do "advance LINESPEC", and LINESPEC expands to more than one
    location, GDB just errors out:

       if (sals.size () != 1)
         error (_("Couldn't get information on specified line."));

    For example, advancing to a line in an inlined function, inlined three
    times:

     (gdb) b 21
     Breakpoint 1 at 0x55555555516f: advance.cc:21. (3 locations)
     (gdb) info breakpoints
     Num     Type           Disp Enb Address            What
     1       breakpoint     keep y   <MULTIPLE>
     1.1                         y   0x000055555555516f in inline_func at
advance.cc:21
     1.2                         y   0x000055555555517e in inline_func at
advance.cc:21
     1.3                         y   0x000055555555518d in inline_func at
advance.cc:21
     (gdb) advance 21
     Couldn't get information on specified line.
     (gdb)

    Similar issue with the "until" command, as it shares the
    implementation with "advance".

    Since, as the comment in gdb.base/advance.exp says, "advance <location>"
    is really just syntactic sugar for "tbreak <location>;continue",
    fix this by making GDB insert a breakpoint at all the resolved
    locations.

    A new testcase is included, which exercises both "advance" and
    "until", in two different cases expanding to multiple locations:

      - inlined functions
      - C++ overloads

    This also exercises the inline frames issue fixed by the previous
    patch.

    gdb/ChangeLog:

            PR gdb/26524
            * breakpoint.c (until_break_fsm) <location_breakpoint,
            caller_breakpoint>: Delete fields.
            <breakpoints>: New field.
            <until_break_fsm>: Adjust to save a breakpoint vector instead of
            two individual breakpoints.
            (until_break_fsm::should_stop): Loop over breakpoints in the
            breakpoint vector.
            (until_break_fsm::clean_up): Adjust to clear the breakpoints
            vector.
            (until_break_command): Handle location expanding into multiple
            sals.

    gdb/testsuite/ChangeLog:

            PR gdb/26523
            PR gdb/26524
            * gdb.base/advance-until-multiple-locations.cc: New.
            * gdb.base/advance-until-multiple-locations.exp: New.

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

  parent reply	other threads:[~2020-08-27 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22 20:14 [Bug gdb/26524] New: " palves at redhat dot com
2020-08-27  2:02 ` [Bug gdb/26524] " simark at simark dot ca
2020-08-27 20:04 ` cvs-commit at gcc dot gnu.org [this message]
2020-08-27 21:49 ` palves at redhat dot com

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-26524-4717-Qc624bakTD@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).