aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-disasm.c2
-rw-r--r--gdb/tui/tui-source.c1
-rw-r--r--gdb/tui/tui-winsource.c20
-rw-r--r--gdb/tui/tui-winsource.h14
4 files changed, 11 insertions, 26 deletions
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index e55f35d..2394394 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -179,8 +179,6 @@ tui_set_disassem_content (tui_source_window_base *win_info,
if (pc == 0)
return TUI_FAILURE;
- tui_alloc_source_buffer (win_info);
-
win_info->gdbarch = gdbarch;
win_info->start_line_or_addr.loa = LOA_ADDRESS;
win_info->start_line_or_addr.u.addr = pc;
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 7c173f8..3d88f66 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -135,7 +135,6 @@ tui_set_source_content (tui_source_window_base *win_info,
int line_width, nlines;
ret = TUI_SUCCESS;
- tui_alloc_source_buffer (win_info);
line_width = win_info->width - 1;
/* Take hilite (window border) into account, when
calculating the number of lines. */
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index a852696..121f19a 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -620,23 +620,3 @@ tui_source_window_base::update_exec_info ()
}
execution_info->refresh_window ();
}
-
-
-void
-tui_alloc_source_buffer (struct tui_source_window_base *win_info)
-{
- int i, line_width, max_lines;
-
- /* The window width/height includes the highlight box. Determine actual
- content dimensions, including string null-terminators. */
- max_lines = win_info->height - 2;
- line_width = win_info->width - 2 + 1;
-
- /* Allocate the buffer for the source lines. */
- win_info->content.resize (max_lines);
- for (i = 0; i < max_lines; i++)
- {
- if (win_info->content[i].line == nullptr)
- win_info->content[i].line = (char *) xmalloc (line_width);
- }
-}
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index 237c4da..bff2560 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -69,6 +69,17 @@ struct tui_source_element
xfree (line);
}
+ DISABLE_COPY_AND_ASSIGN (tui_source_element);
+
+ 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;
@@ -173,9 +184,6 @@ extern void tui_update_source_windows_with_line (struct symtab *,
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_alloc_source_buffer (struct tui_source_window_base *);
-
-
/* Constant definitions. */
#define SCROLL_THRESHOLD 2 /* Threshold for lazy scroll. */