30 #include "filenames.h"
47 if (s != (
struct symtab *) NULL)
50 int i, desc, c, line_width,
nlines;
58 nlines = (line_no + (
TUI_SRC_WIN->generic.height - 2)) - line_no;
65 char *
name = alloca (strlen (filename) + 100);
67 sprintf (name,
"%s:%d", filename, line_no);
77 if (line_no < 1 || line_no > s->
nlines)
86 else if (lseek (desc, s->
line_charpos[line_no - 1], 0) < 0)
93 int offset, cur_line_no, cur_line, cur_len, threshold;
110 threshold = (line_width - 1) + offset;
111 stream = fdopen (desc, FOPEN_RT);
119 (threshold + 1) *
sizeof (char));
120 while (cur_line < nlines)
130 ->which_element.source.line;
132 sprintf (src_line,
"%-6d", cur_line_no);
133 cur_len = strlen (src_line);
138 src_line[cur_len] =
' ';
142 src_line[cur_len] = (char) 0;
151 (filename_cmp (locator->
content[0]
159 i = strlen (src_line) - 1;
162 if ((c !=
'\n') && (c !=
'\r')
163 && (++i < threshold))
165 if (c < 040 && c !=
'\t')
168 src_line[i] = c + 0100;
186 for (j = i - ((i / max_tab_len)
202 while (c != EOF && c !=
'\n' && c !=
'\r')
206 && (c = fgetc (stream)) !=
'\n'
215 while (c != EOF && c !=
'\n' && c !=
'\r'
217 && (c = fgetc (stream)));
223 else if (strlen (src_line) > offset)
225 ->which_element.source.line,
229 ->which_element.source.line[0] = (char) 0;
254 char *warning_string)
265 while (curr_line < win_info->
generic.content_size)
288 if (curr_line == (n_lines / 2 + 1))
292 int warning_length = strlen (warning_string);
297 if (warning_length >= ((line_width - 1) / 2))
300 xpos = (line_width - 1) / 2 - warning_length;
302 for (i = 0; i < xpos; i++)
305 sprintf (src_line + i,
"%s", warning_string);
307 for (i = xpos + warning_length; i < line_width; i++)
327 TUI_SRC_WIN->detail.source_info.horizontal_offset = 0;
357 if (cursal.symtab == (
struct symtab *) NULL)
const char * symtab_to_filename_for_display(struct symtab *symtab)
enum tui_status tui_set_source_content(struct symtab *s, int line_no, int noerror)
struct frame_info * get_selected_frame(const char *message)
CORE_ADDR get_frame_pc(struct frame_info *frame)
int open_source_file(struct symtab *s)
struct tui_line_or_address line_or_addr
struct symtab_and_line get_current_source_symtab_and_line(void)
void print_sys_errmsg(const char *string, int errcode)
int tui_source_is_displayed(const char *fullname)
union tui_line_or_address::@171 u
enum tui_line_or_address_kind loa
const char * symtab_to_fullname(struct symtab *s)
char full_name[MAX_LOCATOR_ELEMENT_LEN]
struct tui_locator_element locator
void find_source_lines(struct symtab *s, int desc)
struct tui_gen_win_info generic
#define SYMTAB_OBJFILE(symtab)
struct tui_line_or_address start_line_or_addr
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
struct tui_gen_win_info * tui_locator_win_info_ptr(void)
void tui_vertical_source_scroll(enum tui_scroll_direction scroll_direction, int num_to_scroll)
void print_source_lines(struct symtab *s, int line, int stopline, enum print_source_lines_flags flags)
void printf_unfiltered(const char *format,...)
union tui_which_element which_element
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
struct tui_win_element ** tui_win_content
int tui_default_tab_len(void)
void tui_show_symtab_source(struct gdbarch *gdbarch, struct symtab *s, struct tui_line_or_address line, int noerror)
enum tui_status tui_alloc_source_buffer(struct tui_win_info *win_info)
struct symtab * find_pc_line_symtab(CORE_ADDR pc)
void tui_set_source_content_nil(struct tui_win_info *win_info, char *warning_string)
struct tui_source_element source
void tui_update_source_window_as_is(struct tui_win_info *win_info, struct gdbarch *gdbarch, struct symtab *s, struct tui_line_or_address line_or_addr, int noerror)