Remove tui_clear_source_content
[deliverable/binutils-gdb.git] / gdb / tui / tui-winsource.h
index bce889d5abe334a1e3dce1bda3ce015fee62280e..e7ae5b0abc39f3ebf3f934a0f16fa48c5baa9452 100644 (file)
 #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.  */
 
@@ -32,26 +53,40 @@ struct tui_exec_info_window : public tui_gen_win_info
     : 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.  */
 
@@ -65,6 +100,9 @@ protected:
   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 ();
@@ -91,9 +129,16 @@ public:
 
   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;
   /* Execution information window.  */
@@ -142,20 +187,6 @@ extern void tui_update_source_window_as_is (struct tui_source_window_base *,
 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_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.  */
This page took 0.028018 seconds and 4 git commands to generate.