GDB (xrefs)

Public Member Functions | Private Member Functions | Private Attributes | List of all members
completion_tracker Class Reference

`#include "completer.h"`

## Public Member Functions
| completion_tracker ()
| ~completion_tracker ()
| DISABLE_COPY_AND_ASSIGN (completion_tracker)
void | add_completion (gdb::unique_xmalloc_ptr< char > name, completion_match_for_lcd *match_for_lcd=NULL, const char *text=NULL, const char *word=NULL)
void | add_completions (completion_list &&list)
void | set_quote_char (int quote_char)
int | quote_char ()
void | set_use_custom_word_point (bool enable)
bool | use_custom_word_point () const
int | custom_word_point () const
void | set_custom_word_point (int point)
void | advance_custom_word_point_by (size_t len)
bool | suppress_append_ws () const
void | set_suppress_append_ws (bool suppress)
bool | completes_to_completion_word (const char *word)
completion_match_result & | reset_completion_match_result ()
bool | have_completions () const
void | discard_completions ()
completion_result | build_completion_result (const char *text, int start, int end)

## Private Member Functions
bool | maybe_add_completion (gdb::unique_xmalloc_ptr< char > name, completion_match_for_lcd *match_for_lcd, const char *text, const char *word)
void | recompute_lowest_common_denominator (gdb::unique_xmalloc_ptr< char > &&new_match)

## Private Attributes
completion_match_result | m_completion_match_result
completion_list | m_entries_vec
htab_t | m_entries_hash
int | m_quote_char = '\0'
bool | m_use_custom_word_point = false
int | m_custom_word_point = 0
bool | m_suppress_append_ws = false
char * | m_lowest_common_denominator = NULL
bool | m_lowest_common_denominator_unique = false

## Detailed Description

Definition at line 310 of file completer.h.

## Constructor & Destructor Documentation

## ◆ completion_tracker()

completion_tracker::completion_tracker | ( |  | ) |

Definition at line 1475 of file completer.c.

References INITIAL_COMPLETION_HTAB_SIZE, m_entries_hash, streq(), xcalloc(), and xfree().

## ◆ ~completion_tracker()

completion_tracker::~completion_tracker | ( |  | ) |

Definition at line 1502 of file completer.c.

References m_entries_hash, m_lowest_common_denominator, and xfree().

## Member Function Documentation

## ◆ add_completion()

void completion_tracker::add_completion | ( | gdb::unique_xmalloc_ptr< char > | name,
|  | completion_match_for_lcd * | match_for_lcd = `NULL`,
|  | const char * | text = `NULL`,
|  | const char * | word = `NULL`
| ) |  |

Definition at line 1550 of file completer.c.

References _, MAX_COMPLETIONS_REACHED_ERROR, maybe_add_completion(), name, and throw_error().

Referenced by add_completions(), cmdpy_completer(), cmdscm_add_completion(), complete_explicit_location(), complete_internalvar(), complete_label(), complete_on_cmdlist(), complete_on_enum(), completion_list_add_name(), condition_completer(), filename_completer(), interpreter_completer(), linespec_complete(), reg_or_group_completer_1(), signal_completer(), sim_command_completer(), and tui_reggroup_completer().

## ◆ add_completions()

void completion_tracker::add_completions | ( | completion_list && | list | ) |

Definition at line 1561 of file completer.c.

References add_completion().

Referenced by collect_explicit_location_matches(), complete_expression(), complete_files_symbols(), and complete_linespec_component().

## ◆ advance_custom_word_point_by()

void completion_tracker::advance_custom_word_point_by | ( | size_t | len | ) |

Definition at line 1946 of file completer.c.

References m_custom_word_point.

Referenced by advance_to_expression_complete_word_point(), collect_explicit_location_matches(), complete_address_and_linespec_locations(), complete_explicit_location(), complete_line_internal_1(), linespec_complete(), location_completer(), and skip_keyword().

## ◆ build_completion_result()

completion_result completion_tracker::build_completion_result | ( | const char * | text,
|  | int | start,
|  | int | end
| ) |  |

Definition at line 2019 of file completer.c.

References expand_preserving_ws(), m_entries_vec, m_lowest_common_denominator, m_lowest_common_denominator_unique, quote_char(), suppress_append_ws(), and XNEWVEC.

Referenced by complete_command(), and gdb_rl_attempted_completion_function_throw().

## ◆ completes_to_completion_word()

bool completion_tracker::completes_to_completion_word | ( | const char * | word | ) |

Definition at line 379 of file completer.c.

References m_lowest_common_denominator, m_lowest_common_denominator_unique, and strncmp_iw().

Referenced by collect_explicit_location_matches(), and linespec_complete().

## ◆ custom_word_point()

int completion_tracker::custom_word_point | ( |  | ) | const
| inline

Definition at line 352 of file completer.h.

References m_custom_word_point.

Referenced by completion_find_completion_word(), gdb_completion_word_break_characters_throw(), and location_completer().

## ◆ DISABLE_COPY_AND_ASSIGN()

completion_tracker::DISABLE_COPY_AND_ASSIGN | ( | completion_tracker |  | ) |

## ◆ discard_completions()

void completion_tracker::discard_completions | ( |  | ) |

Definition at line 1485 of file completer.c.

References INITIAL_COMPLETION_HTAB_SIZE, m_entries_hash, m_entries_vec, m_lowest_common_denominator, m_lowest_common_denominator_unique, streq(), xcalloc(), and xfree().

Referenced by collect_explicit_location_matches(), and linespec_complete().

## ◆ have_completions()

bool completion_tracker::have_completions | ( |  | ) | const
| inline

Definition at line 391 of file completer.h.

References m_entries_vec.

Referenced by collect_explicit_location_matches(), complete_files_symbols(), complete_linespec_component(), linespec_complete(), linespec_parse_basic(), and location_completer().

## ◆ maybe_add_completion()

bool completion_tracker::maybe_add_completion | ( | gdb::unique_xmalloc_ptr< char > | name,
|  | completion_match_for_lcd * | match_for_lcd,
|  | const char * | text,
|  | const char * | word
| ) |  |
| private

Definition at line 1512 of file completer.c.

References completion_match_for_lcd::finish(), make_completion_match_str(), max_completions, and name.

Referenced by add_completion().

## ◆ quote_char()

int completion_tracker::quote_char | ( |  | ) |
| inline

Definition at line 338 of file completer.h.

References m_quote_char.

Referenced by build_completion_result(), complete_linespec_component(), completion_find_completion_word(), linespec_complete(), and set_quote_char().

## ◆ recompute_lowest_common_denominator()

void completion_tracker::recompute_lowest_common_denominator | ( | gdb::unique_xmalloc_ptr< char > && | new_match | ) |
| private

Definition at line 1913 of file completer.c.

## ◆ reset_completion_match_result()

completion_match_result& completion_tracker::reset_completion_match_result | ( |  | ) |
| inline

Definition at line 380 of file completer.h.

References completion_match::clear(), completion_match_for_lcd::clear(), m_completion_match_result, completion_match_result::match, and completion_match_result::match_for_lcd.

Referenced by completion_list_add_name().

## ◆ set_custom_word_point()

void completion_tracker::set_custom_word_point | ( | int | point | ) |
| inline

Definition at line 356 of file completer.h.

References m_custom_word_point.

Referenced by location_completer().

## ◆ set_quote_char()

void completion_tracker::set_quote_char | ( | int | quote_char | ) |
| inline

Definition at line 332 of file completer.h.

References m_quote_char, and quote_char().

Referenced by complete_linespec_component(), linespec_complete(), and location_completer().

## ◆ set_suppress_append_ws()

void completion_tracker::set_suppress_append_ws | ( | bool | suppress | ) |
| inline

Definition at line 369 of file completer.h.

References m_suppress_append_ws, and suppress.

Referenced by complete_linespec_component().

## ◆ set_use_custom_word_point()

void completion_tracker::set_use_custom_word_point | ( | bool | enable | ) |
| inline

Definition at line 344 of file completer.h.

References enable, and m_use_custom_word_point.

Referenced by location_completer_handle_brkchars().

## ◆ suppress_append_ws()

bool completion_tracker::suppress_append_ws | ( |  | ) | const
| inline

Definition at line 364 of file completer.h.

References m_suppress_append_ws.

Referenced by build_completion_result().

## ◆ use_custom_word_point()

bool completion_tracker::use_custom_word_point | ( |  | ) | const
| inline

Definition at line 348 of file completer.h.

References m_use_custom_word_point.

Referenced by complete_command(), completion_find_completion_word(), gdb_completion_word_break_characters_throw(), and gdb_rl_attempted_completion_function_throw().

## Member Data Documentation

## ◆ m_completion_match_result

completion_match_result completion_tracker::m_completion_match_result
| private

Definition at line 431 of file completer.h.

Referenced by reset_completion_match_result().

## ◆ m_custom_word_point

int completion_tracker::m_custom_word_point = 0
| private

Definition at line 464 of file completer.h.

Referenced by advance_custom_word_point_by(), custom_word_point(), and set_custom_word_point().

## ◆ m_entries_hash

htab_t completion_tracker::m_entries_hash
| private

Definition at line 442 of file completer.h.

Referenced by completion_tracker(), discard_completions(), and ~completion_tracker().

## ◆ m_entries_vec

completion_list completion_tracker::m_entries_vec
| private

Definition at line 434 of file completer.h.

Referenced by build_completion_result(), discard_completions(), and have_completions().

## ◆ m_lowest_common_denominator

char* completion_tracker::m_lowest_common_denominator = NULL
| private

Definition at line 476 of file completer.h.

Referenced by build_completion_result(), completes_to_completion_word(), discard_completions(), and ~completion_tracker().

## ◆ m_lowest_common_denominator_unique

bool completion_tracker::m_lowest_common_denominator_unique = false
| private

Definition at line 485 of file completer.h.

Referenced by build_completion_result(), completes_to_completion_word(), and discard_completions().

## ◆ m_quote_char

int completion_tracker::m_quote_char = '\0'
| private

Definition at line 453 of file completer.h.

Referenced by quote_char(), and set_quote_char().

## ◆ m_suppress_append_ws

bool completion_tracker::m_suppress_append_ws = false
| private

Definition at line 472 of file completer.h.

Referenced by set_suppress_append_ws(), and suppress_append_ws().

## ◆ m_use_custom_word_point

bool completion_tracker::m_use_custom_word_point = false
| private

Definition at line 458 of file completer.h.

Referenced by set_use_custom_word_point(), and use_custom_word_point().

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

- /tmp/gdb-8.1/gdb/completer.h
- /tmp/gdb-8.1/gdb/completer.c