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/26523] advance/until to inline frames
Date: Thu, 27 Aug 2020 20:04:52 +0000	[thread overview]
Message-ID: <bug-26523-4717-f0MQAzsExD@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26523-4717@http.sourceware.org/bugzilla/>

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

--- Comment #1 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=b2b38aa45ba2eb2e7e4c70689d679c4c467eda73

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

    Fix advance/until and inline frames (PR gdb/26523)

    If you do "tbreak LINENO; c" to advance to an inlined function, GDB
    presents the stop at the inline frame instead of at the non-artificial
    stack frame:

     (gdb) list 21
     18      static inline __attribute__ ((always_inline)) int
     19      inline_func (int i)
     20      {
     21        return i + 1;
     22      }

     (gdb) tbreak 21
     Temporary breakpoint 3 at 0x55555555516f: advance.cc:21.
     (gdb) c
     Continuing.

     Temporary breakpoint 3, inline_func (i=0) at advance.cc:21
     21        return i + 1;

    The logic for this is in stopped_by_user_bp_inline_frame:

     /* Loop over the stop chain and determine if execution stopped in an
        inlined frame because of a breakpoint with a user-specified
        location set at FRAME_BLOCK.  */

     static bool
     stopped_by_user_bp_inline_frame (const block *frame_block, bpstat
stop_chain)

    If however, you do "advance LINENO" or "until LINENO" instead, GDB
    presents the stop at the non-artificial frame:

     (gdb) advance 21
     main () at advance.cc:43
     43        i = inline_func (i);
     (gdb)

    "advance" and "until" should really behave like user breakpoints here,
    since their location is also user-specified.  As the comment in
    gdb.base/advance.exp says, "advance <location>" is really just
    syntactic sugar for "tbreak <location>; continue".

    Fix this by making stopped_by_user_bp_inline_frame also consider
    advance/until breakpoints.

    A testcase covering this will be included in the next patch.

    gdb/ChangeLog:

            PR gdb/26523
            * inline-frame.c (stopped_by_user_bp_inline_frame): Also consider
            bp_until breakpoints user-specified locations.  Update intro
            comment.

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

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22 20:10 [Bug gdb/26523] New: " palves at redhat dot com
2020-08-27 20:04 ` cvs-commit at gcc dot gnu.org [this message]
2020-08-27 20:04 ` [Bug gdb/26523] " cvs-commit at gcc dot gnu.org
2020-08-27 20:21 ` palves at redhat dot com
2020-08-27 20:21 ` 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-26523-4717-f0MQAzsExD@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).