+2019-07-04 Tom Tromey <tom@tromey.com>
+
+ 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.
+
2019-07-04 Alan Hayward <alan.hayward@arm.com>
* aarch32-linux-nat.h (VFP_REGS_SIZE): Remove define.
enum tui_win_type display_mode;
};
+/* Flags to tell what kind of breakpoint is at current line. */
+enum tui_bp_flag
+{
+ TUI_BP_ENABLED = 0x01,
+ TUI_BP_DISABLED = 0x02,
+ TUI_BP_HIT = 0x04,
+ TUI_BP_CONDITIONAL = 0x08,
+ TUI_BP_HARDWARE = 0x10
+};
+
+DEF_ENUM_FLAGS_TYPE (enum tui_bp_flag, tui_bp_flags);
+
/* Elements in the Source/Disassembly Window. */
struct tui_source_element
{
char *line = nullptr;
struct tui_line_or_address line_or_addr;
bool is_exec_point = false;
- int has_break = 0;
+ tui_bp_flags break_mode = 0;
};
# define MAX_LOCATOR_ELEMENT_LEN 1024
#endif
-/* Flags to tell what kind of breakpoint is at current line. */
-#define TUI_BP_ENABLED 0x01
-#define TUI_BP_DISABLED 0x02
-#define TUI_BP_HIT 0x04
-#define TUI_BP_CONDITIONAL 0x08
-#define TUI_BP_HARDWARE 0x10
-
/* Position of breakpoint markers in the exec info string. */
#define TUI_BP_HIT_POS 0
#define TUI_BP_BREAK_POS 1
src->line_or_addr.u.addr = asm_lines[i].addr;
src->is_exec_point = asm_lines[i].addr == cur_pc;
- /* See whether there is a breakpoint installed. */
- src->has_break = (!src->is_exec_point
- && breakpoint_here_p (current_program_space->aspace,
- pc)
- != no_breakpoint_here);
-
xfree (asm_lines[i].addr_string);
xfree (asm_lines[i].insn);
}
element->line_or_addr.loa = LOA_LINE;
element->line_or_addr.u.line_no = 0;
element->is_exec_point = false;
- element->has_break = FALSE;
+ element->break_mode = 0;
/* Set the contents of the line to blank. */
element->line[0] = (char) 0;
{
struct tui_source_element *element = &win_info->content[i];
- element->has_break = FALSE;
+ element->break_mode = 0;
element->is_exec_point = false;
}
}
}
-/* Set or clear the has_break flag in the line whose line is
+/* Set or clear the is_exec_point flag in the line whose line is
line_no. */
void
{
struct breakpoint *bp;
extern struct breakpoint *breakpoint_chain;
- int mode;
struct tui_source_element *line;
line = &win->content[i];
/* Scan each breakpoint to see if the current line has something to
do with it. Identify enable/disabled breakpoints as well as
those that we already hit. */
- mode = 0;
+ tui_bp_flags mode = 0;
for (bp = breakpoint_chain;
bp != NULL;
bp = bp->next)
}
}
}
- if (line->has_break != mode)
+ if (line->break_mode != mode)
{
- line->has_break = mode;
- need_refresh = 1;
+ line->break_mode = mode;
+ need_refresh = true;
}
}
return need_refresh;
{
tui_exec_info_content &element = content[i];
struct tui_source_element *src_element;
- int mode;
+ tui_bp_flags mode;
src_element = &win_info->content[i];
/* Now update the exec info content based upon the state
of each line as indicated by the source content. */
- mode = src_element->has_break;
+ mode = src_element->break_mode;
if (mode & TUI_BP_HIT)
element[TUI_BP_HIT_POS] = (mode & TUI_BP_HARDWARE) ? 'H' : 'B';
else if (mode & (TUI_BP_ENABLED | TUI_BP_DISABLED))
state changed. */
extern void tui_update_all_breakpoint_info (void);
-/* Scan the source window and the breakpoints to update the hasBreak
+/* Scan the source window and the breakpoints to update the break_mode
information for each line. Returns 1 if something changed and the
execution window must be refreshed. */
extern int tui_update_breakpoint_info (struct tui_source_window_base *win,