31#include "safe-ctype.h"
50 if (adapter.begin () != adapter.end ())
56 if (addr != (CORE_ADDR) 0)
72 const char *lineptr = *ptr;
87 result.append (lineptr, lineptr + skip_bytes);
88 lineptr += skip_bytes;
97 auto process_tab = [&] ()
102 for (
int j = column % max_tab_len;
105 result.push_back (
' ');
108 if (c ==
'\n' || c ==
'\r' || c ==
'\0')
114 else if (ISCNTRL (c))
116 result.push_back (
'^');
117 result.push_back (c + 0100);
122 result.push_back (
'^');
123 result.push_back (
'?');
127 result.push_back (c);
129 while (c !=
'\0' && c !=
'\n' && c !=
'\r');
131 if (c ==
'\r' && *lineptr ==
'\n')
135 if (length !=
nullptr)
190 win_info->update_source_window (
gdbarch, sal);
199 if (sal.
symtab !=
nullptr)
206 win_info->update_source_window (
gdbarch, sal);
213 int half_width = (
width - 2) / 2;
221 if (strlen (str) >= half_width)
224 x_pos = half_width - strlen (str);
245 wmove (
m_pad.get (), lineno, 0);
258 wnoutrefresh (
handle.get ());
262 int view_width =
width - left_margin - 1;
267 prefresh (
m_pad.get (), 0, pad_x,
y + 1,
x + left_margin,
268 y +
m_content.size (),
x + left_margin + view_width - 1);
279 if (
m_pad ==
nullptr || pad_width > getmaxx (
m_pad.get ())
283 werase (
m_pad.get ());
284 for (
int lineno = 0; lineno <
m_content.size (); lineno++)
354 if (sal.symtab == NULL)
362 if (sal.pspace ==
nullptr)
395 bool changed =
false;
405 if (content_loa.
loa == l.
loa
411 if (new_state !=
m_content[i].is_exec_point)
429 if (win->update_breakpoint_info (being_deleted,
false))
430 win->update_exec_info ();
443 (
struct breakpoint *being_deleted,
bool current_only)
446 bool need_refresh =
false;
459 tui_bp_flags mode = 0;
462 if (
bp == being_deleted)
499 for (
int i = 0; i <
m_content.size (); i++)
520 mvwaddstr (
handle.get (), i + 1, 1, element);
breakpoint_range all_breakpoints()
frame_info_ptr deprecated_safe_get_selected_frame(void)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
observable styling_changed
struct program_space * current_program_space
struct symtab_and_line get_current_source_symtab_and_line(void)
struct objfile * objfile() const
struct gdbarch * arch() const
struct compunit_symtab * compunit() const
enum tui_line_or_address_kind loa
union tui_line_or_address::@187 u
bool set_location(struct gdbarch *gdbarch, const struct symtab_and_line &sal, const char *procname)
~tui_source_window_base()
virtual bool set_contents(struct gdbarch *gdbarch, const struct symtab_and_line &sal)=0
void do_erase_source_content(const char *string)
void show_source_line(int lineno)
void do_scroll_horizontal(int num_to_scroll) override
struct tui_line_or_address m_start_line_or_addr
void refresh_window() override
void update_source_window(struct gdbarch *gdbarch, const struct symtab_and_line &sal)
gdb::observers::token m_observable
struct gdbarch * m_gdbarch
virtual void erase_source_content()=0
void update_tab_width() override
std::vector< tui_source_element > m_content
virtual bool location_matches_p(struct bp_location *loc, int line_no)=0
std::unique_ptr< WINDOW, curses_deleter > m_pad
void show_source_content()
void set_is_exec_point_at(struct tui_line_or_address l)
bool update_breakpoint_info(struct breakpoint *being_deleted, bool current_only)
virtual int extra_margin() const
void update_source_window_as_is(struct gdbarch *gdbarch, const struct symtab_and_line &sal)
virtual void show_line_number(int offset) const
void check_and_display_highlight_if_needed()
std::unique_ptr< WINDOW, curses_deleter > handle
bool find_line_pc(struct symtab *symtab, int line, CORE_ADDR *pc)
struct symtab * find_pc_line_symtab(CORE_ADDR pc)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
unsigned int tui_tab_width
void tui_get_begin_asm_address(struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
void tui_set_reverse_mode(WINDOW *w, bool reverse)
void tui_puts(const char *string, WINDOW *w)
tui_location_tracker tui_location
void tui_update_all_breakpoint_info(struct breakpoint *being_deleted)
void tui_update_source_windows_with_line(struct symtab_and_line sal)
void tui_update_source_windows_with_addr(struct gdbarch *gdbarch, CORE_ADDR addr)
std::string tui_copy_source_line(const char **ptr, int *length)
#define TUI_EXECINFO_SIZE
bool skip_ansi_escape(const char *buf, int *n_read)