GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
source.h File Reference
#include "gdbsupport/scoped_fd.h"

Go to the source code of this file.

Classes

class  source_lines_range
 

Enumerations

enum  openp_flag { OPF_TRY_CWD_FIRST = 0x01 , OPF_SEARCH_IN_PATH = 0x02 , OPF_RETURN_REALPATH = 0x04 }
 
enum  print_source_lines_flag { PRINT_SOURCE_LINES_NOERROR = (1 << 0) , PRINT_SOURCE_LINES_FILENAME = (1 << 1) }
 

Functions

 DEF_ENUM_FLAGS_TYPE (openp_flag, openp_flags)
 
int openp (const char *, openp_flags, const char *, int, gdb::unique_xmalloc_ptr< char > *)
 
int source_full_path_of (const char *, gdb::unique_xmalloc_ptr< char > *)
 
void mod_path (const char *, std::string &)
 
void add_path (const char *, char **, int)
 
void add_path (const char *, std::string &, int)
 
void directory_switch (const char *, int)
 
void init_source_path (void)
 
scoped_fd find_and_open_source (const char *filename, const char *dirname, gdb::unique_xmalloc_ptr< char > *fullname)
 
gdb::unique_xmalloc_ptr< char > find_source_or_rewrite (const char *filename, const char *dirname)
 
scoped_fd open_source_file (struct symtab *s)
 
gdb::unique_xmalloc_ptr< char > rewrite_source_path (const char *path)
 
const char * symtab_to_fullname (struct symtab *s)
 
const char * symtab_to_filename_for_display (struct symtab *symtab)
 
int get_first_line_listed (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)
 
symtab_and_line set_current_source_symtab_and_line (const symtab_and_line &sal)
 
void clear_current_source_symtab_and_line (void)
 
void add_substitute_path_rule (const char *, const char *)
 
 DEF_ENUM_FLAGS_TYPE (enum print_source_lines_flag, print_source_lines_flags)
 
void print_source_lines (struct symtab *s, int line, int stopline, print_source_lines_flags flags)
 
void print_source_lines (struct symtab *s, source_lines_range r, print_source_lines_flags flags)
 
void forget_cached_source_info_for_objfile (struct objfile *)
 
void forget_cached_source_info (void)
 
void select_source_symtab (struct symtab *s)
 

Variables

std::string source_path
 

Enumeration Type Documentation

◆ openp_flag

enum openp_flag
Enumerator
OPF_TRY_CWD_FIRST 
OPF_SEARCH_IN_PATH 
OPF_RETURN_REALPATH 

Definition at line 28 of file source.h.

◆ print_source_lines_flag

Enumerator
PRINT_SOURCE_LINES_NOERROR 
PRINT_SOURCE_LINES_FILENAME 

Definition at line 134 of file source.h.

Function Documentation

◆ add_path() [1/2]

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

Definition at line 518 of file source.c.

References gdb_printf(), gdb_stderr, name, prefix, print_sys_errmsg(), and xfree().

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

◆ add_path() [2/2]

void add_path ( const char *  dirname,
std::string &  which_path,
int  parse_separators 
)

Definition at line 695 of file source.c.

References add_path(), and xfree().

◆ add_substitute_path_rule()

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

Definition at line 1733 of file source.c.

References substitute_path_rules.

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 301 of file source.c.

References current_program_space, get_source_location(), and loc.

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

◆ DEF_ENUM_FLAGS_TYPE() [1/2]

DEF_ENUM_FLAGS_TYPE ( enum  print_source_lines_flag,
print_source_lines_flags   
)

◆ DEF_ENUM_FLAGS_TYPE() [2/2]

DEF_ENUM_FLAGS_TYPE ( openp_flag  ,
openp_flags   
)

◆ directory_switch()

void directory_switch ( const char *  dirname,
int  from_tty 
)

Definition at line 498 of file source.c.

References add_path(), and source_path.

Referenced by captured_main_1().

◆ find_and_open_source()

scoped_fd find_and_open_source ( const char *  filename,
const char *  dirname,
gdb::unique_xmalloc_ptr< char > *  fullname 
)

◆ find_source_or_rewrite()

gdb::unique_xmalloc_ptr< char > find_source_or_rewrite ( const char *  filename,
const char *  dirname 
)

◆ forget_cached_source_info()

void forget_cached_source_info ( void  )

◆ forget_cached_source_info_for_objfile()

void forget_cached_source_info_for_objfile ( struct objfile objfile)

◆ get_current_source_symtab_and_line()

struct symtab_and_line get_current_source_symtab_and_line ( void  )

◆ get_first_line_listed()

int get_first_line_listed ( void  )

Definition at line 195 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 216 of file source.c.

References lines_to_list.

Referenced by edit_command(), list_command(), and source_lines_range::source_lines_range().

◆ init_source_path()

void init_source_path ( void  )

Definition at line 457 of file source.c.

References forget_cached_source_info(), and source_path.

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

◆ mod_path()

void mod_path ( const char *  dirname,
std::string &  which_path 
)

Definition at line 506 of file source.c.

References add_path().

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

◆ open_source_file()

scoped_fd open_source_file ( struct symtab s)

◆ openp()

int openp ( const char *  path,
openp_flags  opts,
const char *  string,
int  mode,
gdb::unique_xmalloc_ptr< char > *  filename_opened 
)

◆ print_source_lines() [1/2]

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

◆ print_source_lines() [2/2]

void print_source_lines ( struct symtab s,
source_lines_range  r,
print_source_lines_flags  flags 
)

◆ rewrite_source_path()

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

◆ select_source_symtab()

void select_source_symtab ( struct symtab s)

◆ set_current_source_symtab_and_line()

symtab_and_line set_current_source_symtab_and_line ( const symtab_and_line sal)

◆ set_default_source_symtab_and_line()

void set_default_source_symtab_and_line ( void  )

◆ source_full_path_of()

int source_full_path_of ( const char *  filename,
gdb::unique_xmalloc_ptr< char > *  full_pathname 
)

Definition at line 977 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().

◆ symtab_to_filename_for_display()

const char * symtab_to_filename_for_display ( struct symtab symtab)

◆ symtab_to_fullname()

const char * symtab_to_fullname ( struct symtab s)

Variable Documentation

◆ source_path

std::string source_path
extern