public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tui/28483] New: [gdb/tui] breakpoint creation not displayed
@ 2021-10-21 11:20 vries at gcc dot gnu.org
  2021-10-21 11:20 ` [Bug tui/28483] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-21 11:20 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28483
           Summary: [gdb/tui] breakpoint creation not displayed
           Product: gdb
           Version: 11.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Test-case setup:
...
$ cat -n hello.c
     1  #include <stdio.h>
     2  #include <stdlib.h>
     3
     4  int
     5  main (void)
     6  {
     7    void *p = malloc (10);
     8    printf ("hello: %p\n", p);
     9    return 0;
    10  }
$ gcc -g hello.c
...

This command:
...
$ gdb -q a.out -ex start -ex "tui enable" -ex "b 8"
...
gets us in the tui window:
...
     2  #include <stdlib.h>
     3
     4  int
     5  main (void)
     6  {
 >   7    void *p = malloc (10);
     8    printf ("hello: %p\n", p);
     9    return 0;
    10  }
...

Using system gdb based on 10.1, we have instead:
...
     2  #include <stdlib.h>
     3
     4  int
     5  main (void)
     6  {
 >   7    void *p = malloc (10);
b+   8    printf ("hello: %p\n", p);
     9    return 0;
    10  }
...

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tui/28483] [gdb/tui] breakpoint creation not displayed
  2021-10-21 11:20 [Bug tui/28483] New: [gdb/tui] breakpoint creation not displayed vries at gcc dot gnu.org
@ 2021-10-21 11:20 ` vries at gcc dot gnu.org
  2021-10-21 11:30 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-21 11:20 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by:
...
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index afd51e95980..955b68901fe 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -460,7 +460,7 @@ tui_source_window_base::update_breakpoint_info
       for (breakpoint *bp : all_breakpoints ())
        {
          if (bp == being_deleted)
-           return false;
+           continue;

          for (bp_location *loc : bp->locations ())
            {
@@ -478,7 +478,6 @@ tui_source_window_base::update_breakpoint_info
                    mode |= TUI_BP_HARDWARE;
                }
            }
-         return false;
        }

       if (line->break_mode != mode)
...

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tui/28483] [gdb/tui] breakpoint creation not displayed
  2021-10-21 11:20 [Bug tui/28483] New: [gdb/tui] breakpoint creation not displayed vries at gcc dot gnu.org
  2021-10-21 11:20 ` [Bug tui/28483] " vries at gcc dot gnu.org
@ 2021-10-21 11:30 ` vries at gcc dot gnu.org
  2021-10-21 22:28 ` cvs-commit at gcc dot gnu.org
  2021-10-21 22:29 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-21 11:30 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2021-October/182687.html

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tui/28483] [gdb/tui] breakpoint creation not displayed
  2021-10-21 11:20 [Bug tui/28483] New: [gdb/tui] breakpoint creation not displayed vries at gcc dot gnu.org
  2021-10-21 11:20 ` [Bug tui/28483] " vries at gcc dot gnu.org
  2021-10-21 11:30 ` vries at gcc dot gnu.org
@ 2021-10-21 22:28 ` cvs-commit at gcc dot gnu.org
  2021-10-21 22:29 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-21 22:28 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-11-branch branch has been updated by Tom de Vries
<vries@sourceware.org>:

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

commit cfd85eb3ef8d1c823daaa00783c4244089587a3a
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Oct 22 00:28:14 2021 +0200

    [gdb/tui] Fix breakpoint display functionality

    In commit 81e6b8eb208 "Make tui-winsource not use breakpoint_chain", a loop
    body was transformed into a lambda function body:
    ...
    -      for (bp = breakpoint_chain;
    -           bp != NULL;
    -           bp = bp->next)
    +      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
    ...
    and consequently:
    - a continue was replaced by a return, and
    - a final return was added.

    Then in commit 240edef62f0 "gdb: remove iterate_over_breakpoints function",
we
    transformed back to a loop body:
    ...
    -      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
    +      for (breakpoint *bp : all_breakpoints ())
    ...
    but without reverting the changes that introduced the two returns.

    Consequently, breakpoints no longer show up in the tui source window.

    Fix this by reverting the changes that introduced the two returns.

    Build on x86_64-linux, tested with all .exp test-cases that contain
    tuiterm_env.

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

    gdb/ChangeLog:

    2021-10-22  Tom de Vries  <tdevries@suse.de>

            PR tui/28483
            * tui/tui-winsource.c
(tui_source_window_base::update_breakpoint_info):
            Fix returns in loop body.

    gdb/testsuite/ChangeLog:

    2021-10-22  Tom de Vries  <tdevries@suse.de>

            PR tui/28483
            * gdb.tui/break.exp: New file.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tui/28483] [gdb/tui] breakpoint creation not displayed
  2021-10-21 11:20 [Bug tui/28483] New: [gdb/tui] breakpoint creation not displayed vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-10-21 22:28 ` cvs-commit at gcc dot gnu.org
@ 2021-10-21 22:29 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-21 22:29 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.2
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Fix with test-case committed to trunk and gdb-11-branch, marking
resolved-fixed.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-21 22:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 11:20 [Bug tui/28483] New: [gdb/tui] breakpoint creation not displayed vries at gcc dot gnu.org
2021-10-21 11:20 ` [Bug tui/28483] " vries at gcc dot gnu.org
2021-10-21 11:30 ` vries at gcc dot gnu.org
2021-10-21 22:28 ` cvs-commit at gcc dot gnu.org
2021-10-21 22:29 ` vries at gcc dot gnu.org

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).