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)
 
int last_symtab_line (struct symtab *s)
 
bool can_print_line (struct symtab *s, int line)
 
void print_source_lines (struct symtab *s, source_lines_range r, print_source_lines_flags flags)
 
void forget_cached_source_info (void)
 
void select_source_symtab ()
 

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 135 of file source.h.

Function Documentation

◆ add_path() [1/2]

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

◆ add_path() [2/2]

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

Definition at line 662 of file source.c.

References add_path(), and xfree().

◆ add_substitute_path_rule()

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

Definition at line 1734 of file source.c.

References substitute_path_rules.

Referenced by captured_main_1(), and set_substitute_path_command().

◆ can_print_line()

bool can_print_line ( struct symtab * s,
int line )
extern

◆ clear_current_source_symtab_and_line()

void clear_current_source_symtab_and_line ( void )
extern

Definition at line 302 of file source.c.

References current_program_space, get_source_location(), and loc.

Referenced by clear_symtab_users(), list_command(), 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 )
extern

Definition at line 469 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 )
extern

◆ find_source_or_rewrite()

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

◆ forget_cached_source_info()

void forget_cached_source_info ( void )
extern

◆ get_current_source_symtab_and_line()

struct symtab_and_line get_current_source_symtab_and_line ( void )
extern

◆ get_first_line_listed()

int get_first_line_listed ( void )
extern

Definition at line 196 of file source.c.

References first_line_listed.

Referenced by list_command().

◆ get_lines_to_list()

int get_lines_to_list ( void )
extern

◆ init_source_path()

void init_source_path ( void )
extern

Definition at line 428 of file source.c.

References forget_cached_source_info(), and source_path.

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

◆ last_symtab_line()

int last_symtab_line ( struct symtab * s)
extern

Definition at line 1484 of file source.c.

References g_source_cache, and source_cache::get_line_charpos().

Referenced by list_command().

◆ mod_path()

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

Definition at line 477 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)
extern

◆ openp()

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

◆ print_source_lines() [1/2]

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

◆ print_source_lines() [2/2]

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

◆ rewrite_source_path()

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

◆ select_source_symtab()

void select_source_symtab ( )
extern

◆ set_current_source_symtab_and_line()

symtab_and_line set_current_source_symtab_and_line ( const symtab_and_line & sal)
extern

◆ set_default_source_symtab_and_line()

void set_default_source_symtab_and_line ( void )
extern

◆ source_full_path_of()

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

Definition at line 944 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)
extern

◆ symtab_to_fullname()

const char * symtab_to_fullname ( struct symtab * s)
extern

Variable Documentation

◆ source_path

std::string source_path
extern