GDB (xrefs)

Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/source.c File Reference
`#include "defs.h"`
`#include "arch-utils.h"`
`#include "symtab.h"`
`#include "expression.h"`
`#include "language.h"`
`#include "command.h"`
`#include "source.h"`
`#include "gdbcmd.h"`
`#include "frame.h"`
`#include "value.h"`
`#include "filestuff.h"`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include "gdbcore.h"`
`#include "gdb_regex.h"`
`#include "symfile.h"`
`#include "objfiles.h"`
`#include "annotate.h"`
`#include "gdbtypes.h"`
`#include "linespec.h"`
`#include "filenames.h"`
`#include "completer.h"`
`#include "ui-out.h"`
`#include "readline/readline.h"`
`#include "common/enum-flags.h"`
`#include <algorithm>`

Go to the source code of this file.

## Classes
struct | substitute_path_rule

## Macros
#define | OPEN_MODE (O_RDONLY | O_BINARY)
#define | FDOPEN_MODE FOPEN_RB
#define | cdir_len 5

## Functions
static int | get_filename_and_charpos (struct symtab *, char **)
static void | show_lines_to_list (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void | show_filename_display_string (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
int | get_first_line_listed (void)
static void | clear_lines_listed_range (void)
int | get_lines_to_list (void)
struct symtab_and_line | get_current_source_symtab_and_line (void)
void | set_default_source_symtab_and_line (void)
struct symtab_and_line | set_current_source_symtab_and_line (const symtab_and_line &sal)
void | clear_current_source_symtab_and_line (void)
void | select_source_symtab (struct symtab *s)
static void | set_directories_command (const char *args, int from_tty, struct cmd_list_element *c)
static void | show_directories_1 (char *ignore, int from_tty)
static void | show_directories_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void | forget_cached_source_info_for_objfile (struct objfile *objfile)
void | forget_cached_source_info (void)
void | init_source_path (void)
static void | directory_command (const char *dirname, int from_tty)
void | directory_switch (const char *dirname, int from_tty)
void | mod_path (const char *dirname, char **which_path)
void | add_path (const char *dirname, char **which_path, int parse_separators)
static void | info_source_command (const char *ignore, int from_tty)
static int | is_regular_file (const char *name, int *errno_ptr)
int | openp (const char *path, int opts, const char *string, int mode, char **filename_opened)
int | source_full_path_of (const char *filename, char **full_pathname)
static int | substitute_path_rule_matches (const struct substitute_path_rule *rule, const char *path)
static struct substitute_path_rule * | get_substitute_path_rule (const char *path)
gdb::unique_xmalloc_ptr< char > | rewrite_source_path (const char *path)
int | find_and_open_source (const char *filename, const char *dirname, char **fullname)
int | open_source_file (struct symtab *s)
const char * | symtab_to_fullname (struct symtab *s)
const char * | symtab_to_filename_for_display (struct symtab *symtab)
void | find_source_lines (struct symtab *s, int desc)
int | identify_source_line (struct symtab *s, int line, int mid_statement, CORE_ADDR pc)
static void | print_source_lines_base (struct symtab *s, int line, int stopline, print_source_lines_flags flags)
void | print_source_lines (struct symtab *s, int line, int stopline, print_source_lines_flags flags)
static void | info_line_command (const char *arg, int from_tty)
static void | forward_search_command (const char *regex, int from_tty)
static void | reverse_search_command (const char *regex, int from_tty)
static void | strip_trailing_directory_separator (char *path)
static struct substitute_path_rule * | find_substitute_path_rule (const char *from)
void | add_substitute_path_rule (char *from, char *to)
static void | delete_substitute_path_rule (struct substitute_path_rule *rule)
static void | show_substitute_path_command (const char *args, int from_tty)
static void | unset_substitute_path_command (const char *args, int from_tty)
static void | set_substitute_path_command (const char *args, int from_tty)
void | _initialize_source (void)

## Variables
char * | source_path
static struct substitute_path_rule * | substitute_path_rules = NULL
static struct symtab * | current_source_symtab
static int | current_source_line
static struct program_space * | current_source_pspace
static int | lines_to_list = 10
static const char | filename_display_basename [] = "basename"
static const char | filename_display_relative [] = "relative"
static const char | filename_display_absolute [] = "absolute"
static const char *const | filename_display_kind_names []
static const char * | filename_display_string = filename_display_relative
static int | last_line_listed
static int | first_line_listed
static struct symtab * | last_source_visited = NULL
static int | last_source_error = 0

## Macro Definition Documentation

## ◆ cdir_len

#define cdir_len 5

Referenced by find_and_open_source().

## ◆ FDOPEN_MODE

#define FDOPEN_MODE FOPEN_RB

Definition at line 49 of file source.c.

Referenced by forward_search_command(), print_source_lines_base(), and reverse_search_command().

## ◆ OPEN_MODE

#define OPEN_MODE (O_RDONLY | O_BINARY)

Definition at line 48 of file source.c.

Referenced by find_and_open_source().

## Function Documentation

## ◆ _initialize_source()

void _initialize_source | ( | void |  | ) |

Definition at line 1966 of file source.c.

References _, add_cmd(), add_com(), add_com_alias(), add_info(), add_setshow_enum_cmd(), add_setshow_integer_cmd(), add_setshow_optional_filename_cmd(), class_files, class_support, cmdlist, current_source_symtab, dbx_commands, directory_command(), filename_completer(), filename_display_kind_names, filename_display_string, forward_search_command(), info_line_command(), info_source_command(), init_source_path(), lines_to_list, reverse_search_command(), set_cmd_completer(), set_directories_command(), set_substitute_path_command(), setlist, show_directories_command(), show_filename_display_string(), show_lines_to_list(), show_substitute_path_command(), showlist, source_path, unset_substitute_path_command(), and unsetlist.

## ◆ add_path()

void add_path | ( | const char * | dirname,
|  | char ** | which_path,
|  | int | parse_separators
| ) |  |

Definition at line 460 of file source.c.

References _, cleanup::arg, gdb::argv, current_directory, DIRNAME_SEPARATOR, dirnames_to_char_ptr_vec_append(), do_cleanups(), fprintf_unfiltered(), gdb_stderr, make_cleanup(), make_cleanup_free_char_ptr_vec(), name, print_sys_errmsg(), savestring(), SLASH_STRING, VEC, VEC_iterate, VEC_safe_push, warning(), and xfree().

Referenced by directory_switch(), env_mod_path(), and mod_path().

## ◆ add_substitute_path_rule()

void add_substitute_path_rule | ( | char * | from,
|  | char * | to
| ) |  |

Definition at line 1790 of file source.c.

References substitute_path_rule::from, substitute_path_rule::next, substitute_path_rules, substitute_path_rule::to, and XNEW.

Referenced by captured_main_1(), and set_substitute_path_command().

## ◆ clear_current_source_symtab_and_line()

void clear_current_source_symtab_and_line | ( | void |  | ) |

Definition at line 232 of file source.c.

References current_source_line, and current_source_symtab.

Referenced by clear_symtab_users(), and objfile::~objfile().

## ◆ clear_lines_listed_range()

static void clear_lines_listed_range | ( | void |  | ) |
| static

Definition at line 150 of file source.c.

References first_line_listed, and last_line_listed.

Referenced by identify_source_line(), and set_current_source_symtab_and_line().

## ◆ delete_substitute_path_rule()

static void delete_substitute_path_rule | ( | struct substitute_path_rule * | rule | ) |
| static

Definition at line 1822 of file source.c.

References substitute_path_rule::from, gdb_assert, substitute_path_rule::next, substitute_path_rules, substitute_path_rule::to, and xfree().

Referenced by set_substitute_path_command(), and unset_substitute_path_command().

## ◆ directory_command()

static void directory_command | ( | const char * | dirname,
|  | int | from_tty
| ) |  |
| static

Definition at line 415 of file source.c.

References _, dont_repeat(), forget_cached_source_info(), init_source_path(), mod_path(), query(), show_directories_1(), source_path, and xfree().

Referenced by _initialize_source().

## ◆ directory_switch()

void directory_switch | ( | const char * | dirname,
|  | int | from_tty
| ) |  |

Definition at line 440 of file source.c.

References add_path(), and source_path.

Referenced by captured_main_1().

## ◆ find_and_open_source()

int find_and_open_source | ( | const char * | filename,
|  | const char * | dirname,
|  | char ** | fullname
| ) |  |

Definition at line 1012 of file source.c.

References cdir_len, DIRNAME_SEPARATOR, gdb_open_cloexec(), gdb_realpath(), OPEN_MODE, openp(), OPF_RETURN_REALPATH, OPF_SEARCH_IN_PATH, rewrite_source_path(), source_path, and xfree().

Referenced by open_source_file(), psymtab_to_fullname(), and symtab_to_fullname().

## ◆ find_source_lines()

void find_source_lines | ( | struct symtab * | s,
|  | int | desc
| ) |  |

Definition at line 1186 of file source.c.

References _, do_cleanups(), exec_bfd, exec_bfd_mtime, gdb_assert, symtab::line_charpos, make_cleanup(), myread(), symtab::nlines, perror_with_name(), size, SYMTAB_OBJFILE, symtab_to_filename_for_display(), warning(), xfree(), xmalloc(), XNEWVEC, and xrealloc().

Referenced by forward_search_command(), get_filename_and_charpos(), print_source_lines_base(), reverse_search_command(), and tui_set_source_content().

## ◆ find_substitute_path_rule()

static struct substitute_path_rule* find_substitute_path_rule | ( | const char * | from | ) |
| static

Definition at line 1772 of file source.c.

References substitute_path_rule::from, substitute_path_rule::next, and substitute_path_rules.

Referenced by set_substitute_path_command().

## ◆ forget_cached_source_info()

void forget_cached_source_info | ( | void |  | ) |

Definition at line 388 of file source.c.

References ALL_PSPACE_OBJFILES, ALL_PSPACES, forget_cached_source_info_for_objfile(), last_source_visited, objfile::objfile(), and objfile::pspace.

Referenced by cd_command(), directory_command(), init_source_path(), mi_cmd_env_dir(), set_substitute_path_command(), and unset_substitute_path_command().

## ◆ forget_cached_source_info_for_objfile()

void forget_cached_source_info_for_objfile | ( | struct objfile * | objfile | ) |

Definition at line 360 of file source.c.

References ALL_OBJFILE_FILETABS, quick_symbol_functions::forget_cached_source_info, symtab::fullname, symtab::line_charpos, sym_fns::qf, objfile::sf, and xfree().

Referenced by forget_cached_source_info(), and objfile::~objfile().

## ◆ forward_search_command()

static void forward_search_command | ( | const char * | regex,
|  | int | from_tty
| ) |  |
| static

Definition at line 1587 of file source.c.

References _, current_source_line, current_source_symtab, discard_cleanups(), error(), FDOPEN_MODE, find_source_lines(), last_line_listed, symtab::line_charpos, lines_to_list, lookup_internalvar(), make_cleanup_close(), symtab::nlines, open_source_file(), perror_with_name(), print_source_lines(), printf_filtered(), re_comp(), select_source_symtab(), set_internalvar_integer(), symtab_to_filename_for_display(), xmalloc(), and xrealloc().

Referenced by _initialize_source().

## ◆ get_current_source_symtab_and_line()

struct symtab_and_line get_current_source_symtab_and_line | ( | void |  | ) |

Definition at line 171 of file source.c.

References current_source_line, current_source_pspace, current_source_symtab, and symtab_and_line::pspace.

Referenced by decode_line_with_current_source(), default_macro_scope(), edit_command(), extract_display_start_addr(), gdbpy_decode_line(), get_expr_block_and_pc(), initialize_defaults(), list_command(), make_visible_with_new_height(), mi_cmd_file_list_exec_source_file(), parse_breakpoint_sals(), parse_exp_in_context_1(), tui_horizontal_source_scroll(), tui_show_source(), tui_vertical_source_scroll(), and objfile::~objfile().

## ◆ get_filename_and_charpos()

static int get_filename_and_charpos | ( | struct symtab * | s,
|  | char ** | fullname
| ) |  |
| static

Definition at line 1262 of file source.c.

References do_cleanups(), find_source_lines(), symtab::fullname, symtab::line_charpos, make_cleanup_close(), and open_source_file().

Referenced by identify_source_line().

## ◆ get_first_line_listed()

int get_first_line_listed | ( | void |  | ) |

Definition at line 141 of file source.c.

References first_line_listed.

Referenced by list_command().

## ◆ get_lines_to_list()

int get_lines_to_list | ( | void |  | ) |

Definition at line 162 of file source.c.

References lines_to_list.

Referenced by edit_command(), and list_command().

## ◆ get_substitute_path_rule()

static struct substitute_path_rule* get_substitute_path_rule | ( | const char * | path | ) |
| static

Definition at line 973 of file source.c.

References substitute_path_rule::next, substitute_path_rule_matches(), and substitute_path_rules.

Referenced by rewrite_source_path().

## ◆ identify_source_line()

int identify_source_line | ( | struct symtab * | s,
|  | int | line,
|  | int | mid_statement,
|  | CORE_ADDR | pc
| ) |  |

Definition at line 1295 of file source.c.

References annotate_source(), clear_lines_listed_range(), current_source_line, current_source_symtab, symtab::fullname, get_filename_and_charpos(), get_objfile_arch(), symtab::line_charpos, symtab::nlines, and SYMTAB_OBJFILE.

Referenced by info_line_command(), and print_frame_info().

## ◆ info_line_command()

static void info_line_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 1480 of file source.c.

References _, annotation_level, current_program_space, current_source_line, current_source_symtab, DECODE_LINE_LIST_MODE, decode_line_with_last_displayed(), dont_repeat(), find_line_pc_range(), gdb_stdout, get_current_arch(), get_objfile_arch(), identify_source_line(), last_line_listed, symtab_and_line::line, print_address(), printf_filtered(), symtab_and_line::pspace, set_next_address(), symtab_and_line::symtab, SYMTAB_OBJFILE, symtab_to_filename_for_display(), and wrap_here().

Referenced by _initialize_source().

## ◆ info_source_command()

static void info_source_command | ( | const char * | ignore,
|  | int | from_tty
| ) |  |
| static

Definition at line 639 of file source.c.

References _, COMPUNIT_DEBUGFORMAT, COMPUNIT_MACRO_TABLE, COMPUNIT_PRODUCER, current_source_symtab, symtab::filename, symtab::fullname, symtab::language, language_str(), symtab::nlines, printf_filtered(), SYMTAB_COMPUNIT, and SYMTAB_DIRNAME.

Referenced by _initialize_source().

## ◆ init_source_path()

void init_source_path | ( | void |  | ) |

Definition at line 403 of file source.c.

References DIRNAME_SEPARATOR, forget_cached_source_info(), source_path, and xsnprintf().

Referenced by _initialize_source(), directory_command(), mi_cmd_env_dir(), and set_directories_command().

## ◆ is_regular_file()

static int is_regular_file | ( | const char * | name,
|  | int * | errno_ptr
| ) |  |
| static

Definition at line 677 of file source.c.

References name, and status.

Referenced by openp().

## ◆ mod_path()

void mod_path | ( | const char * | dirname,
|  | char ** | which_path
| ) |  |

Definition at line 448 of file source.c.

References add_path().

Referenced by directory_command(), path_command(), and set_directories_command().

## ◆ open_source_file()

int open_source_file | ( | struct symtab * | s | ) |

Definition at line 1113 of file source.c.

References symtab::filename, find_and_open_source(), symtab::fullname, and SYMTAB_DIRNAME.

Referenced by forward_search_command(), get_filename_and_charpos(), print_source_lines_base(), reverse_search_command(), and tui_set_source_content().

## ◆ openp()

int openp | ( | const char * | path,
|  | int | opts,
|  | const char * | string,
|  | int | mode,
|  | char ** | filename_opened
| ) |  |

Definition at line 739 of file source.c.

References current_directory, do_cleanups(), gdb_abspath(), gdb_assert, gdb_open_cloexec(), gdb_realpath(), is_regular_file(), make_cleanup_free_char_ptr_vec(), O_BINARY, OPF_RETURN_REALPATH, OPF_SEARCH_IN_PATH, OPF_TRY_CWD_FIRST, SLASH_STRING, VEC, and VEC_iterate.

Referenced by exec_file_attach(), find_and_open_script(), find_and_open_source(), nto_find_and_open_solib(), solib_find_1(), source_full_path_of(), symfile_bfd_open(), and try_open_dwop_file().

## ◆ print_source_lines()

void print_source_lines | ( | struct symtab * | s,
|  | int | line,
|  | int | stopline,
|  | print_source_lines_flags | flags
| ) |  |

Definition at line 1471 of file source.c.

References flags, and print_source_lines_base().

Referenced by btrace_print_lines(), do_mixed_source_and_assembly(), do_mixed_source_and_assembly_deprecated(), forward_search_command(), list_command(), print_frame_info(), reverse_search_command(), and tui_vertical_source_scroll().

## ◆ print_source_lines_base()

static void print_source_lines_base | ( | struct symtab * | s,
|  | int | line,
|  | int | stopline,
|  | print_source_lines_flags | flags
| ) |  |
| static

Definition at line 1319 of file source.c.

References _, current_source_line, current_source_symtab, current_uiout, error(), FDOPEN_MODE, ui_out::field_int(), ui_out::field_string(), find_source_lines(), first_line_listed, flags, ui_out::is_mi_like_p(), last_line_listed, last_source_error, last_source_visited, symtab::line_charpos, name, symtab::nlines, open_source_file(), perror_with_name(), PRINT_SOURCE_LINES_FILENAME, PRINT_SOURCE_LINES_NOERROR, print_sys_errmsg(), printf_filtered(), symtab_to_filename_for_display(), symtab_to_fullname(), ui_out::test_flags(), ui_out::text(), ui_source_list, and xsnprintf().

Referenced by print_source_lines().

## ◆ reverse_search_command()

static void reverse_search_command | ( | const char * | regex,
|  | int | from_tty
| ) |  |
| static

Definition at line 1672 of file source.c.

References _, current_source_line, current_source_symtab, discard_cleanups(), error(), FDOPEN_MODE, find_source_lines(), last_line_listed, symtab::line_charpos, lines_to_list, lookup_internalvar(), make_cleanup_close(), symtab::nlines, open_source_file(), perror_with_name(), print_source_lines(), printf_filtered(), re_comp(), select_source_symtab(), set_internalvar_integer(), and symtab_to_filename_for_display().

Referenced by _initialize_source().

## ◆ rewrite_source_path()

gdb::unique_xmalloc_ptr<char> rewrite_source_path | ( | const char * | path | ) |

Definition at line 990 of file source.c.

References substitute_path_rule::from, get_substitute_path_rule(), substitute_path_rule::to, and xmalloc().

Referenced by find_and_open_source(), psymtab_to_fullname(), and symtab_to_fullname().

## ◆ select_source_symtab()

void select_source_symtab | ( | struct symtab * | s | ) |

Definition at line 247 of file source.c.

References _, ALL_FILETABS, ALL_OBJFILES, current_program_space, current_source_line, current_source_pspace, current_source_symtab, DECODE_LINE_FUNFIRSTLINE, decode_line_with_current_source(), error(), symtab::filename, quick_symbol_functions::find_last_source_symtab, symtab_and_line::line, lines_to_list, lookup_symbol(), main_name(), name, symtab_and_line::pspace, sym_fns::qf, objfile::sf, symtab_and_line::symtab, SYMTAB_PSPACE, and VAR_DOMAIN.

Referenced by forward_search_command(), reverse_search_command(), set_default_source_symtab_and_line(), and tui_refresh_frame_and_register_information().

## ◆ set_current_source_symtab_and_line()

struct symtab_and_line set_current_source_symtab_and_line | ( | const symtab_and_line & | sal | ) |

Definition at line 209 of file source.c.

References clear_lines_listed_range(), current_source_line, current_source_pspace, current_source_symtab, symtab_and_line::end, symtab_and_line::line, symtab_and_line::pc, symtab_and_line::pspace, and symtab_and_line::symtab.

Referenced by set_current_sal_from_frame(), tui_show_disassem_and_update_source(), and tui_update_source_window_as_is().

## ◆ set_default_source_symtab_and_line()

void set_default_source_symtab_and_line | ( | void |  | ) |

Definition at line 193 of file source.c.

References _, current_source_symtab, error(), have_full_symbols(), have_partial_symbols(), and select_source_symtab().

Referenced by create_sals_line_offset(), edit_command(), gdbpy_decode_line(), list_command(), and mi_cmd_file_list_exec_source_file().

## ◆ set_directories_command()

static void set_directories_command | ( | const char * | args,
|  | int | from_tty,
|  | struct cmd_list_element * | c
| ) |  |
| static

Definition at line 317 of file source.c.

References init_source_path(), mod_path(), source_path, and xfree().

Referenced by _initialize_source().

## ◆ set_substitute_path_command()

static void set_substitute_path_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 1931 of file source.c.

References _, add_substitute_path_rule(), gdb::argv, delete_substitute_path_rule(), error(), find_substitute_path_rule(), forget_cached_source_info(), and strip_trailing_directory_separator().

Referenced by _initialize_source().

## ◆ show_directories_1()

static void show_directories_1 | ( | char * | ignore,
|  | int | from_tty
| ) |  |
| static

Definition at line 340 of file source.c.

References puts_filtered(), and source_path.

Referenced by directory_command(), and show_directories_command().

## ◆ show_directories_command()

static void show_directories_command | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 350 of file source.c.

References show_directories_1().

Referenced by _initialize_source().

## ◆ show_filename_display_string()

static void show_filename_display_string | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 113 of file source.c.

References _, and fprintf_filtered().

Referenced by _initialize_source().

## ◆ show_lines_to_list()

static void show_lines_to_list | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 89 of file source.c.

References _, and fprintf_filtered().

Referenced by _initialize_source().

## ◆ show_substitute_path_command()

static void show_substitute_path_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 1846 of file source.c.

References _, gdb::argv, error(), substitute_path_rule::from, substitute_path_rule::next, printf_filtered(), substitute_path_rule_matches(), substitute_path_rules, and substitute_path_rule::to.

Referenced by _initialize_source().

## ◆ source_full_path_of()

int source_full_path_of | ( | const char * | filename,
|  | char ** | full_pathname
| ) |  |

Definition at line 923 of file source.c.

References openp(), OPF_RETURN_REALPATH, OPF_SEARCH_IN_PATH, OPF_TRY_CWD_FIRST, and source_path.

Referenced by exec_file_find().

## ◆ strip_trailing_directory_separator()

static void strip_trailing_directory_separator | ( | char * | path | ) |
| static

Definition at line 1757 of file source.c.

Referenced by set_substitute_path_command().

## ◆ substitute_path_rule_matches()

static int substitute_path_rule_matches | ( | const struct substitute_path_rule * | rule,
|  | const char * | path
| ) |  |
| static

Definition at line 944 of file source.c.

References substitute_path_rule::from.

Referenced by get_substitute_path_rule(), and show_substitute_path_command().

## ◆ symtab_to_filename_for_display()

const char* symtab_to_filename_for_display | ( | struct symtab * | symtab | ) |

Definition at line 1168 of file source.c.

References _, symtab::filename, filename_display_absolute, filename_display_basename, filename_display_relative, filename_display_string, internal_error(), and symtab_to_fullname().

Referenced by bkscm_print_block_syms_progress_smob(), btrace_call_history_src_line(), build_address_symbolic(), debug_symtab_name(), decode_line_2(), do_mixed_source_and_assembly(), dump_objfile(), dump_symtab_1(), edit_command(), error_in_psymtab_expansion(), find_source_lines(), fixup_go_packaging(), forward_search_command(), ftrace_print_filename(), gdbscm_symtab_filename(), info_checkpoints_command(), info_frame_command(), info_line_command(), list_command(), maintenance_check_symtabs(), maintenance_info_line_tables(), maintenance_info_symtabs(), maintenance_print_symbols(), mi_cmd_file_list_exec_source_file(), mi_cmd_file_list_exec_source_files(), print_breakpoint_location(), print_frame(), print_one_static_tracepoint_marker(), print_sal_location(), print_source_lines_base(), print_symbol_info(), psymtab_to_symtab_1(), rbreak_command(), resolve_sal_pc(), reverse_search_command(), sal_macro_scope(), salpy_str(), say_where(), set_traceframe_context(), stpy_get_filename(), stpy_str(), stscm_print_symtab_smob(), symtab_symbol_info(), tfind_line_command(), tui_set_source_content(), update_static_tracepoint(), and user_select_syms().

## ◆ symtab_to_fullname()

const char* symtab_to_fullname | ( | struct symtab * | s | ) |

Definition at line 1131 of file source.c.

References symtab::filename, find_and_open_source(), symtab::fullname, rewrite_source_path(), SLASH_STRING, and SYMTAB_DIRNAME.

Referenced by add_sal_to_sals(), canonical_to_fullform(), clear_command(), convert_linespec_to_sals(), create_sals_line_offset(), skiplist_entry::do_skip_file_p(), skiplist_entry::do_skip_gfile_p(), edit_command(), find_line_symtab(), ftrace_function_switched(), gdbpy_rbreak(), gdbscm_symtab_fullname(), info_sources_command(), is_known_support_routine(), iterate_over_some_symtabs(), maintenance_print_one_line_table(), mi_cmd_file_list_exec_source_file(), mi_cmd_file_list_exec_source_files(), print_breakpoint_location(), print_frame(), print_one_static_tracepoint_marker(), print_source_lines_base(), rbreak_command(), search_symbols(), skip_file_command(), stpy_fullname(), symtab_to_filename_for_display(), tui_display_main(), tui_set_source_content(), tui_show_disassem_and_update_source(), tui_show_frame_info(), tui_update_breakpoint_info(), and update_static_tracepoint().

## ◆ unset_substitute_path_command()

static void unset_substitute_path_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 1880 of file source.c.

References _, gdb::argv, delete_substitute_path_rule(), error(), forget_cached_source_info(), substitute_path_rule::from, substitute_path_rule::next, query(), and substitute_path_rules.

Referenced by _initialize_source().

## Variable Documentation

## ◆ current_source_line

int current_source_line
| static

Definition at line 77 of file source.c.

Referenced by clear_current_source_symtab_and_line(), forward_search_command(), get_current_source_symtab_and_line(), identify_source_line(), info_line_command(), print_source_lines_base(), reverse_search_command(), select_source_symtab(), and set_current_source_symtab_and_line().

## ◆ current_source_pspace

struct program_space* current_source_pspace
| static

Definition at line 79 of file source.c.

Referenced by get_current_source_symtab_and_line(), select_source_symtab(), and set_current_source_symtab_and_line().

## ◆ current_source_symtab

struct symtab* current_source_symtab
| static

Definition at line 73 of file source.c.

Referenced by _initialize_source(), clear_current_source_symtab_and_line(), forward_search_command(), get_current_source_symtab_and_line(), identify_source_line(), info_line_command(), info_source_command(), print_source_lines_base(), reverse_search_command(), select_source_symtab(), set_current_source_symtab_and_line(), and set_default_source_symtab_and_line().

## ◆ filename_display_absolute

const char filename_display_absolute[] = "absolute"
| static

Definition at line 101 of file source.c.

Referenced by symtab_to_filename_for_display().

## ◆ filename_display_basename

const char filename_display_basename[] = "basename"
| static

Definition at line 99 of file source.c.

Referenced by symtab_to_filename_for_display().

## ◆ filename_display_kind_names

const char* const filename_display_kind_names[]
| static

Initial value:
= {
filename_display_basename,
filename_display_relative,
filename_display_absolute,
NULL
}
filename_display_absolute
static const char filename_display_absolute[]
Definition: source.c:101
filename_display_relative
static const char filename_display_relative[]
Definition: source.c:100
filename_display_basename
static const char filename_display_basename[]
Definition: source.c:99

Definition at line 103 of file source.c.

Referenced by _initialize_source().

## ◆ filename_display_relative

const char filename_display_relative[] = "relative"
| static

Definition at line 100 of file source.c.

Referenced by symtab_to_filename_for_display().

## ◆ filename_display_string

const char* filename_display_string = filename_display_relative
| static

Definition at line 110 of file source.c.

Referenced by _initialize_source(), and symtab_to_filename_for_display().

## ◆ first_line_listed

int first_line_listed
| static

Definition at line 128 of file source.c.

Referenced by clear_lines_listed_range(), get_first_line_listed(), and print_source_lines_base().

## ◆ last_line_listed

int last_line_listed
| static

Definition at line 122 of file source.c.

Referenced by clear_lines_listed_range(), forward_search_command(), info_line_command(), print_source_lines_base(), and reverse_search_command().

## ◆ last_source_error

int last_source_error = 0
| static

Definition at line 134 of file source.c.

Referenced by print_source_lines_base().

## ◆ last_source_visited

struct symtab* last_source_visited = NULL
| static

Definition at line 133 of file source.c.

Referenced by forget_cached_source_info(), and print_source_lines_base().

## ◆ lines_to_list

int lines_to_list = 10
| static

Definition at line 87 of file source.c.

Referenced by _initialize_source(), forward_search_command(), get_lines_to_list(), reverse_search_command(), and select_source_symtab().

## ◆ source_path

char* source_path

Definition at line 58 of file source.c.

Referenced by _initialize_source(), directory_command(), directory_switch(), find_and_open_script(), find_and_open_source(), init_source_path(), mi_cmd_env_dir(), set_directories_command(), show_directories_1(), and source_full_path_of().

## ◆ substitute_path_rules

struct substitute_path_rule* substitute_path_rules = NULL
| static

Definition at line 69 of file source.c.

Referenced by add_substitute_path_rule(), delete_substitute_path_rule(), find_substitute_path_rule(), get_substitute_path_rule(), show_substitute_path_command(), and unset_substitute_path_command().