[Bug tui/24724] New: TUI code uses "has_break" in two different ways

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug tui/24724] New: TUI code uses "has_break" in two different ways

fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24724

            Bug ID: 24724
           Summary: TUI code uses "has_break" in two different ways
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

Some parts of the TUI use the "has_break" field as a bool:

      src->has_break = (!src->is_exec_point
                        && breakpoint_here_p (current_program_space->aspace,
                                              pc)
                        != no_breakpoint_here);

However, other parts use it as a flag word:

                  if (bp->enable_state == bp_disabled)
                    mode |= TUI_BP_DISABLED;
                  else
                    mode |= TUI_BP_ENABLED;
...
      if (line->has_break != mode)
        {
          line->has_break = mode;


This discrepancy should be fixed.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tui/24724] TUI code uses "has_break" in two different ways

fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24724

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I have a patch.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tui/24724] TUI code uses "has_break" in two different ways

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24724

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <[hidden email]>:

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

commit 0598af4880f58af5ce7c15419551362646892c7f
Author: Tom Tromey <[hidden email]>
Date:   Tue Jun 25 14:42:49 2019 -0600

    Fix TUI use of "has_break" field

    The TUI uses the "has_break" in two different ways: sometimes as a
    boolean, and sometimes as flags.

    This patch changes the TUI to be more type-safe here, and fixes the
    code.  I could not find a bug that this caused, so apparently this is
    just cosmetic.

    This deletes some code from tui_set_disassem_content.  Whenver this is
    called, I believe the TUI updates the breakpoint information
    afterward, so this assignment is redundant; which is good because it
    is also incorrect.

    gdb/ChangeLog
    2019-07-04  Tom Tromey  <[hidden email]>

        PR tui/24724:
        * tui/tui-winsource.c (tui_clear_source_content): Update.
        (tui_source_window_base::set_is_exec_point_at): Fix comment.
        (tui_update_breakpoint_info): Update.
        (tui_set_exec_info_content): Update.
        * tui/tui-source.c (tui_set_source_content_nil): Update.
        * tui/tui-disasm.c (tui_set_disassem_content): Don't set
        has_break.
        * tui/tui-data.h (enum tui_bp_flag): New.
        (tui_bp_flags): New enum flags type.
        (struct tui_source_element) <break_mode>: Change type.  Rename
        from has_break.
        (TUI_BP_ENABLED, TUI_BP_DISABLED, TUI_BP_HIT)
        (TUI_BP_CONDITIONAL, TUI_BP_HARDWARE): Don't define.  Now enum
        constants.
        * tui/tui-winsource.h: Fix comment.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tui/24724] TUI code uses "has_break" in two different ways

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24724

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

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