GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
source_cache Class Reference

#include "source-cache.h"

Classes

struct  source_text
 

Public Member Functions

 source_cache ()
 
bool get_line_charpos (struct symtab *s, const std::vector< off_t > **offsets)
 
bool get_source_lines (struct symtab *s, int first_line, int last_line, std::string *lines_out)
 
void clear ()
 

Private Member Functions

std::string get_plain_source_lines (struct symtab *s, const std::string &fullname)
 
bool ensure (struct symtab *s)
 

Private Attributes

std::vector< source_textm_source_map
 
std::unordered_map< std::string, std::vector< off_t > > m_offset_cache
 

Detailed Description

Definition at line 36 of file source-cache.h.

Constructor & Destructor Documentation

◆ source_cache()

source_cache::source_cache ( )
inline

Definition at line 40 of file source-cache.h.

Member Function Documentation

◆ clear()

void source_cache::clear ( )
inline

Definition at line 65 of file source-cache.h.

References m_offset_cache, and m_source_map.

Referenced by forget_cached_source_info(), and set_style_enabled().

◆ ensure()

bool source_cache::ensure ( struct symtab * s)
private

◆ get_line_charpos()

bool source_cache::get_line_charpos ( struct symtab * s,
const std::vector< off_t > ** offsets )

◆ get_plain_source_lines()

std::string source_cache::get_plain_source_lines ( struct symtab * s,
const std::string & fullname )
private

◆ get_source_lines()

bool source_cache::get_source_lines ( struct symtab * s,
int first_line,
int last_line,
std::string * lines_out )

Definition at line 358 of file source-cache.c.

References ensure(), extract_lines(), and m_source_map.

Referenced by print_source_lines_base(), and tui_source_window::set_contents().

Member Data Documentation

◆ m_offset_cache

std::unordered_map<std::string, std::vector<off_t> > source_cache::m_offset_cache
private

Definition at line 97 of file source-cache.h.

Referenced by clear(), ensure(), get_line_charpos(), and get_plain_source_lines().

◆ m_source_map

std::vector<source_text> source_cache::m_source_map
private

Definition at line 93 of file source-cache.h.

Referenced by clear(), ensure(), and get_source_lines().


The documentation for this class was generated from the following files: