GDB (xrefs)
Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-7.10/gdb/completer.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "filenames.h"
#include "language.h"
#include "gdb_signals.h"
#include "target.h"
#include "reggroups.h"
#include "user-regs.h"
#include "arch-utils.h"
#include "cli/cli-decode.h"
#include "gdbcmd.h"
#include "readline/readline.h"
#include "completer.h"

Go to the source code of this file.

Macros

#define ELLIPSIS_LEN   3
 

Typedefs

typedef int QSFUNC(const void *, const void *)
 

Enumerations

enum  complete_line_internal_reason { handle_brkchars, handle_completions, handle_help }
 
enum  reg_completer_targets { complete_register_names = 0x1, complete_reggroup_names = 0x2 }
 

Functions

static char * line_completion_function (const char *text, int matches, char *line_buffer, int point)
 
char * get_gdb_completer_quote_characters (void)
 
char * readline_line_completion_function (const char *text, int matches)
 
 VEC (char_ptr)
 
static void add_struct_fields (struct type *type, VEC(char_ptr)**output, char *fieldname, int namelen)
 
void set_gdb_completion_word_break_characters (completer_ftype *fn)
 
completion_tracker_t new_completion_tracker (void)
 
static void free_completion_tracker (void *p)
 
struct cleanupmake_cleanup_free_completion_tracker (completion_tracker_t *tracker_ptr)
 
enum maybe_add_completion_enum maybe_add_completion (completion_tracker_t tracker, char *name)
 
void throw_max_completions_reached_error (void)
 
char * gdb_completion_word_break_characters (void)
 
const char * skip_quoted_chars (const char *str, const char *quotechars, const char *breakchars)
 
const char * skip_quoted (const char *str)
 
const char * get_max_completions_reached_message (void)
 
static int gdb_get_y_or_n (int for_pager, const struct match_list_displayer *displayer)
 
static int gdb_display_match_list_pager (int lines, const struct match_list_displayer *displayer)
 
static int gdb_path_isdir (const char *filename)
 
static char * gdb_printable_part (char *pathname)
 
static int gdb_fnwidth (const char *string)
 
static int gdb_fnprint (const char *to_print, int prefix_bytes, const struct match_list_displayer *displayer)
 
static int gdb_print_filename (char *to_print, char *full_pathname, int prefix_bytes, const struct match_list_displayer *displayer)
 
static int gdb_complete_get_screenwidth (const struct match_list_displayer *displayer)
 
EXTERN_C int _rl_qsort_string_compare (const void *, const void *)
 
static int gdb_display_match_list_1 (char **matches, int len, int max, const struct match_list_displayer *displayer)
 
void gdb_display_match_list (char **matches, int len, int max, const struct match_list_displayer *displayer)
 
void _initialize_completer (void)
 

Variables

static char * gdb_completer_command_word_break_characters
 
static char * gdb_completer_file_name_break_characters = " \t\n*|\"';:?><"
 
static char * gdb_completer_quote_characters = "'"
 
int max_completions = 200
 
int _rl_completion_prefix_display_length
 
int _rl_print_completions_horizontally
 
initialize_file_ftype _initialize_completer
 

Macro Definition Documentation

#define ELLIPSIS_LEN   3

Definition at line 1224 of file completer.c.

Referenced by gdb_display_match_list_1(), and gdb_fnprint().

Typedef Documentation

typedef int QSFUNC(const void *, const void *)

Definition at line 1597 of file completer.c.

Enumeration Type Documentation

Enumerator
handle_brkchars 
handle_completions 
handle_help 

Definition at line 496 of file completer.c.

Enumerator
complete_register_names 
complete_reggroup_names 

Definition at line 976 of file completer.c.

Function Documentation

void _initialize_completer ( void  )

Definition at line 1778 of file completer.c.

References _, add_setshow_zuinteger_unlimited_cmd(), no_class, setlist, and showlist.

EXTERN_C int _rl_qsort_string_compare ( const void *  ,
const void *   
)
static void add_struct_fields ( struct type type,
VEC(char_ptr)**  output,
char *  fieldname,
int  namelen 
)
static
static void free_completion_tracker ( void *  p)
static

Definition at line 810 of file completer.c.

Referenced by make_cleanup_free_completion_tracker().

static int gdb_complete_get_screenwidth ( const struct match_list_displayer displayer)
static

Definition at line 1587 of file completer.c.

References match_list_displayer::width.

Referenced by gdb_display_match_list_1().

char* gdb_completion_word_break_characters ( void  )

Definition at line 1054 of file completer.c.

References gdb_assert, handle_brkchars, and VEC().

Referenced by init_main().

void gdb_display_match_list ( char **  matches,
int  len,
int  max,
const struct match_list_displayer displayer 
)
static int gdb_display_match_list_1 ( char **  matches,
int  len,
int  max,
const struct match_list_displayer displayer 
)
static
static int gdb_display_match_list_pager ( int  lines,
const struct match_list_displayer displayer 
)
static
static int gdb_fnprint ( const char *  to_print,
int  prefix_bytes,
const struct match_list_displayer displayer 
)
static

Definition at line 1401 of file completer.c.

References CTRL_CHAR, ELLIPSIS_LEN, cleanup_check::ps, and match_list_displayer::putch.

Referenced by gdb_print_filename().

static int gdb_fnwidth ( const char *  string)
static

Definition at line 1347 of file completer.c.

References CTRL_CHAR, and cleanup_check::ps.

Referenced by gdb_display_match_list_1().

static int gdb_get_y_or_n ( int  for_pager,
const struct match_list_displayer displayer 
)
static
static int gdb_path_isdir ( const char *  filename)
static

Definition at line 1294 of file completer.c.

Referenced by gdb_print_filename().

static int gdb_print_filename ( char *  to_print,
char *  full_pathname,
int  prefix_bytes,
const struct match_list_displayer displayer 
)
static
static char* gdb_printable_part ( char *  pathname)
static

Definition at line 1313 of file completer.c.

Referenced by gdb_display_match_list_1().

char* get_gdb_completer_quote_characters ( void  )

Definition at line 94 of file completer.c.

References gdb_completer_quote_characters.

Referenced by init_main().

const char* get_max_completions_reached_message ( void  )

Definition at line 1197 of file completer.c.

References _.

Referenced by complete_command(), and gdb_display_match_list().

static char * line_completion_function ( const char *  text,
int  matches,
char *  line_buffer,
int  point 
)
static
struct cleanup* make_cleanup_free_completion_tracker ( completion_tracker_t tracker_ptr)
enum maybe_add_completion_enum maybe_add_completion ( completion_tracker_t  tracker,
char *  name 
)
completion_tracker_t new_completion_tracker ( void  )

Definition at line 796 of file completer.c.

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

Referenced by default_make_symbol_completion_list_break_on_1().

char* readline_line_completion_function ( const char *  text,
int  matches 
)

Definition at line 102 of file completer.c.

References line_completion_function().

Referenced by init_main().

void set_gdb_completion_word_break_characters ( completer_ftype *  fn)
const char* skip_quoted ( const char *  str)

Definition at line 1188 of file completer.c.

References skip_quoted_chars().

Referenced by yylex().

const char* skip_quoted_chars ( const char *  str,
const char *  quotechars,
const char *  breakchars 
)
void throw_max_completions_reached_error ( void  )

Definition at line 859 of file completer.c.

References _, MAX_COMPLETIONS_REACHED_ERROR, and throw_error().

Referenced by VEC().

VEC ( char_ptr  )

Definition at line 110 of file completer.c.

Referenced by gdb_completion_word_break_characters(), and line_completion_function().

Variable Documentation

initialize_file_ftype _initialize_completer
int _rl_completion_prefix_display_length
int _rl_print_completions_horizontally
char* gdb_completer_command_word_break_characters
static
Initial value:
=
" \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,"

Definition at line 71 of file completer.c.

Referenced by set_gdb_completion_word_break_characters().

char* gdb_completer_file_name_break_characters = " \t\n*|\"';:?><"
static

Definition at line 83 of file completer.c.

Referenced by set_gdb_completion_word_break_characters().

char* gdb_completer_quote_characters = "'"
static

Definition at line 89 of file completer.c.

Referenced by get_gdb_completer_quote_characters(), and skip_quoted_chars().

int max_completions = 200

Definition at line 791 of file completer.c.

Referenced by complete_command().