#define TUI_TUI_WINSOURCE_H
#include "tui/tui-data.h"
+#include "symtab.h"
+
+/* 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);
+
+/* Position of breakpoint markers in the exec info string. */
+#define TUI_BP_HIT_POS 0
+#define TUI_BP_BREAK_POS 1
+#define TUI_EXEC_POS 2
+#define TUI_EXECINFO_SIZE 4
+
+typedef char tui_exec_info_content[TUI_EXECINFO_SIZE];
/* Execution info window class. */
: tui_gen_win_info (EXEC_INFO_WIN)
{
}
+};
- ~tui_exec_info_window () override
+/* Elements in the Source/Disassembly Window. */
+struct tui_source_element
+{
+ tui_source_element ()
{
- xfree (m_content);
+ line_or_addr.loa = LOA_LINE;
+ line_or_addr.u.line_no = 0;
}
- /* Get or allocate contents. */
- tui_exec_info_content *maybe_allocate_content (int n_elements);
-
- /* Return the contents. */
- const tui_exec_info_content *get_content () const
+ ~tui_source_element ()
{
- return m_content;
+ xfree (line);
}
-private:
+ DISABLE_COPY_AND_ASSIGN (tui_source_element);
- tui_exec_info_content *m_content = nullptr;
+ tui_source_element (tui_source_element &&other)
+ : line (other.line),
+ line_or_addr (other.line_or_addr),
+ is_exec_point (other.is_exec_point),
+ break_mode (other.break_mode)
+ {
+ other.line = nullptr;
+ }
+
+ char *line = nullptr;
+ struct tui_line_or_address line_or_addr;
+ bool is_exec_point = false;
+ tui_bp_flags break_mode = 0;
};
+
/* The base class for all source-like windows, namely the source and
disassembly windows. */
void do_scroll_horizontal (int num_to_scroll) override;
void do_make_visible_with_new_height () override;
+ /* Erase the content and display STRING. */
+ void do_erase_source_content (const char *string);
+
public:
void clear_detail ();
void show_source_content ();
- void set_exec_info_content ();
+ void update_exec_info ();
+
+ /* Update the window to display the given location. Does nothing if
+ the location is already displayed. */
+ virtual void maybe_update (struct frame_info *fi, symtab_and_line sal,
+ int line_no, CORE_ADDR addr) = 0;
+
+ /* Erase the source content. */
+ virtual void erase_source_content () = 0;
/* Does the locator belong to this window? */
bool m_has_locator = false;
extern void tui_update_source_windows_with_addr (struct gdbarch *, CORE_ADDR);
extern void tui_update_source_windows_with_line (struct symtab *,
int);
-extern void tui_clear_source_content (struct tui_source_window_base *);
-extern void tui_erase_source_content (struct tui_source_window_base *);
-extern void tui_show_exec_info_content (struct tui_source_window_base *);
-extern void tui_erase_exec_info_content (struct tui_source_window_base *);
-extern void tui_clear_exec_info_content (struct tui_source_window_base *);
-extern void tui_update_exec_info (struct tui_source_window_base *);
-
-extern void tui_alloc_source_buffer (struct tui_source_window_base *);
-extern int tui_line_is_displayed (int,
- struct tui_source_window_base *,
- int);
-extern int tui_addr_is_displayed (CORE_ADDR,
- struct tui_source_window_base *,
- int);
-
/* Constant definitions. */
#define SCROLL_THRESHOLD 2 /* Threshold for lazy scroll. */