GDB (API)

Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/utils.h File Reference
`#include "exceptions.h"`
`#include "common/scoped_restore.h"`
`#include <chrono>`

Go to the source code of this file.

## Classes
class | gdb_argv
struct | htab_deleter
struct | set_batch_flag_and_restore_page_info

## Macros
#define | gdb_stdout (*current_ui_gdb_stdout_ptr ())
#define | gdb_stdin (*current_ui_gdb_stdin_ptr ())
#define | gdb_stderr (*current_ui_gdb_stderr_ptr ())
#define | gdb_stdlog (*current_ui_gdb_stdlog_ptr ())
#define | gdb_print_host_address(ADDR, STREAM) gdb_print_host_address_1 ((const void *) ADDR, STREAM)

## Typedefs
typedef std::unique_ptr< htab, htab_deleter > | htab_up

## Enumerations
enum | strncmp_iw_mode { strncmp_iw_mode::NORMAL, strncmp_iw_mode::MATCH_PARAMS }
enum | resource_limit_kind { LIMIT_CUR, LIMIT_MAX }

## Functions
void | initialize_utils (void)
int | strncmp_iw_with_mode (const char *string1, const char *string2, size_t string2_len, strncmp_iw_mode mode, enum language language, completion_match_for_lcd *match_for_lcd=NULL)
int | strncmp_iw (const char *string1, const char *string2, size_t string2_len)
int | strcmp_iw (const char *string1, const char *string2)
int | strcmp_iw_ordered (const char *, const char *)
int | streq (const char *, const char *)
int | subset_compare (const char *, const char *)
int | compare_positive_ints (const void *ap, const void *bp)
int | compare_strings (const void *ap, const void *bp)
const char * | gdb_bfd_errmsg (bfd_error_type error_tag, char **matching)
void | reset_prompt_for_continue_wait_time (void)
std::chrono::steady_clock::duration | get_prompt_for_continue_wait_time ()
int | parse_pid_to_attach (const char *args)
int | parse_escape (struct gdbarch *, const char **)
struct cleanup * | make_cleanup_free_section_addr_info (struct section_addr_info *)
struct cleanup * | make_cleanup_unpush_target (struct target_ops *ops)
struct cleanup * | make_cleanup_value_free_to_mark (struct value *)
void | free_current_contents (void *)
void | init_page_info (void)
struct cleanup * | make_bpstat_clear_actions_cleanup (void)
gdb::unique_xmalloc_ptr< char > | gdb_realpath (const char *)
gdb::unique_xmalloc_ptr< char > | gdb_realpath_keepfile (const char *)
gdb::unique_xmalloc_ptr< char > | gdb_abspath (const char *)
int | gdb_filename_fnmatch (const char *pattern, const char *string, int flags)
void | substitute_path_component (char **stringp, const char *from, const char *to)
std::string | ldirname (const char *filename)
int | count_path_elements (const char *path)
const char * | strip_leading_path_elements (const char *path, int n)
int | query (const char *,...) ATTRIBUTE_PRINTF(1
int int | nquery (const char *,...) ATTRIBUTE_PRINTF(1
int int int | yquery (const char *,...) ATTRIBUTE_PRINTF(1
int int int void | begin_line (void)
void | wrap_here (const char *)
void | reinitialize_more_filter (void)
struct ui_file ** | current_ui_gdb_stdout_ptr (void)
struct ui_file ** | current_ui_gdb_stdin_ptr (void)
struct ui_file ** | current_ui_gdb_stderr_ptr (void)
struct ui_file ** | current_ui_gdb_stdlog_ptr (void)
void | set_screen_width_and_height (int width, int height)
void | fputs_filtered (const char *, struct ui_file *)
void | fputs_unfiltered (const char *, struct ui_file *)
int | fputc_filtered (int c, struct ui_file *)
int | fputc_unfiltered (int c, struct ui_file *)
int | putchar_filtered (int c)
int | putchar_unfiltered (int c)
void | puts_filtered (const char *)
void | puts_unfiltered (const char *)
void | puts_filtered_tabular (char *string, int width, int right)
void | puts_debug (char *prefix, char *string, char *suffix)
void | vprintf_filtered (const char *, va_list) ATTRIBUTE_PRINTF(1
void void | vfprintf_filtered (struct ui_file *, const char *, va_list) ATTRIBUTE_PRINTF(2
void void void | fprintf_filtered (struct ui_file *, const char *,...) ATTRIBUTE_PRINTF(2
void void void void | fprintfi_filtered (int, struct ui_file *, const char *,...) ATTRIBUTE_PRINTF(3
void void void void void | printf_filtered (const char *,...) ATTRIBUTE_PRINTF(1
void void void void void void | printfi_filtered (int, const char *,...) ATTRIBUTE_PRINTF(2
void void void void void void void | vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF(1
void void void void void void void void | vfprintf_unfiltered (struct ui_file *, const char *, va_list) ATTRIBUTE_PRINTF(2
void void void void void void void void void | fprintf_unfiltered (struct ui_file *, const char *,...) ATTRIBUTE_PRINTF(2
void void void void void void void void void void | printf_unfiltered (const char *,...) ATTRIBUTE_PRINTF(1
void void void void void void void void void void void | print_spaces (int, struct ui_file *)
void | print_spaces_filtered (int, struct ui_file *)
char * | n_spaces (int)
void | fputstr_filtered (const char *str, int quotr, struct ui_file *stream)
void | fputstr_unfiltered (const char *str, int quotr, struct ui_file *stream)
void | fputstrn_filtered (const char *str, int n, int quotr, struct ui_file *stream)
void | fputstrn_unfiltered (const char *str, int n, int quotr, struct ui_file *stream)
int | filtered_printing_initialized (void)
void | gdb_print_host_address_1 (const void *addr, struct ui_file *stream)
CORE_ADDR | address_significant (gdbarch *gdbarch, CORE_ADDR addr)
const char * | paddress (struct gdbarch *gdbarch, CORE_ADDR addr)
const char * | print_core_address (struct gdbarch *gdbarch, CORE_ADDR address)
hashval_t | core_addr_hash (const void *ap)
int | core_addr_eq (const void *ap, const void *bp)
CORE_ADDR | string_to_core_addr (const char *my_string)
void | fprintf_symbol_filtered (struct ui_file *, const char *, enum language, int)
void | throw_perror_with_name (enum errors errcode, const char *string) ATTRIBUTE_NORETURN
void | perror_warning_with_name (const char *string)
void | print_sys_errmsg (const char *, int)
void | error_stream (const string_file &) ATTRIBUTE_NORETURN
void | demangler_vwarning (const char *file, int line, const char *, va_list ap) ATTRIBUTE_PRINTF(3
void void | demangler_warning (const char *file, int line, const char *,...) ATTRIBUTE_PRINTF(3
void void void * | hashtab_obstack_allocate (void *data, size_t size, size_t count)
void | dummy_obstack_deallocate (void *object, void *data)
int | myread (int, char *, int)
ULONGEST | align_up (ULONGEST v, int n)
ULONGEST | align_down (ULONGEST v, int n)
int | can_dump_core (enum resource_limit_kind limit_kind)
void | warn_cant_dump_core (const char *reason)
void | dump_core (void)
char * | make_hex_string (const gdb_byte *data, size_t length)

## Variables
int | sevenbit_strings
int | pagination_enabled
struct ui_file * | gdb_stdtarg
struct ui_file * | gdb_stdtargerr
struct ui_file * | gdb_stdtargin
void(* | deprecated_error_begin_hook )(void)
const char * | warning_pre_print

## Macro Definition Documentation

## ◆ gdb_print_host_address

#define gdb_print_host_address | ( |  | ADDR,
|  |  | STREAM
| ) |  | gdb_print_host_address_1 ((const void *) ADDR, STREAM)

Definition at line 438 of file utils.h.

## ◆ gdb_stderr

#define gdb_stderr (*current_ui_gdb_stderr_ptr ())

Definition at line 344 of file utils.h.

## ◆ gdb_stdin

#define gdb_stdin (*current_ui_gdb_stdin_ptr ())

Definition at line 342 of file utils.h.

## ◆ gdb_stdlog

#define gdb_stdlog (*current_ui_gdb_stdlog_ptr ())

Definition at line 349 of file utils.h.

## ◆ gdb_stdout

#define gdb_stdout (*current_ui_gdb_stdout_ptr ())

Definition at line 340 of file utils.h.

## Typedef Documentation

## ◆ htab_up

typedef std::unique_ptr<htab, htab_deleter> htab_up

Definition at line 266 of file utils.h.

## Enumeration Type Documentation

## ◆ resource_limit_kind

enum resource_limit_kind

Enumerator
LIMIT_CUR |
LIMIT_MAX |

Definition at line 535 of file utils.h.

## ◆ strncmp_iw_mode

enum strncmp_iw_mode
| strong

Enumerator
NORMAL |
MATCH_PARAMS |

Definition at line 36 of file utils.h.

## Function Documentation

## ◆ address_significant()

CORE_ADDR address_significant | ( | gdbarch * | gdbarch,
|  | CORE_ADDR | addr
| ) |  |

## ◆ align_down()

ULONGEST align_down | ( | ULONGEST | v,
|  | int | n
| ) |  |

## ◆ align_up()

ULONGEST align_up | ( | ULONGEST | v,
|  | int | n
| ) |  |

## ◆ begin_line()

int int int void begin_line | ( | void |  | ) |

## ◆ can_dump_core()

int can_dump_core | ( | enum resource_limit_kind | limit_kind | ) |

## ◆ compare_positive_ints()

int compare_positive_ints | ( | const void * | ap,
|  | const void * | bp
| ) |  |

## ◆ compare_strings()

int compare_strings | ( | const void * | ap,
|  | const void * | bp
| ) |  |

## ◆ core_addr_eq()

int core_addr_eq | ( | const void * | ap,
|  | const void * | bp
| ) |  |

## ◆ core_addr_hash()

hashval_t core_addr_hash | ( | const void * | ap | ) |

## ◆ count_path_elements()

int count_path_elements | ( | const char * | path | ) |

## ◆ current_ui_gdb_stderr_ptr()

struct ui_file** current_ui_gdb_stderr_ptr | ( | void |  | ) |

## ◆ current_ui_gdb_stdin_ptr()

struct ui_file** current_ui_gdb_stdin_ptr | ( | void |  | ) |

## ◆ current_ui_gdb_stdlog_ptr()

struct ui_file** current_ui_gdb_stdlog_ptr | ( | void |  | ) |

## ◆ current_ui_gdb_stdout_ptr()

struct ui_file** current_ui_gdb_stdout_ptr | ( | void |  | ) |

## ◆ demangler_vwarning()

void demangler_vwarning | ( | const char * | file,
|  | int | line,
|  | const char * | ,
|  | va_list | ap
| ) |  |

## ◆ demangler_warning()

void void demangler_warning | ( | const char * | file,
|  | int | line,
|  | const char * | ,
|  |  | ...
| ) |  |

## ◆ dummy_obstack_deallocate()

void dummy_obstack_deallocate | ( | void * | object,
|  | void * | data
| ) |  |

## ◆ dump_core()

void dump_core | ( | void |  | ) |

## ◆ error_stream()

void error_stream | ( | const string_file & |  | ) |

## ◆ filtered_printing_initialized()

int filtered_printing_initialized | ( | void |  | ) |

## ◆ fprintf_filtered()

void void void fprintf_filtered | ( | struct ui_file * | ,
|  | const char * | ,
|  |  | ...
| ) |  |

## ◆ fprintf_symbol_filtered()

void fprintf_symbol_filtered | ( | struct ui_file * | ,
|  | const char * | ,
|  | enum | language,
|  | int |
| ) |  |

## ◆ fprintf_unfiltered()

void void void void void void void void void fprintf_unfiltered | ( | struct ui_file * | ,
|  | const char * | ,
|  |  | ...
| ) |  |

## ◆ fprintfi_filtered()

void void void void fprintfi_filtered | ( | int | ,
|  | struct ui_file * | ,
|  | const char * | ,
|  |  | ...
| ) |  |

## ◆ fputc_filtered()

int fputc_filtered | ( | int | c,
|  | struct ui_file * |
| ) |  |

## ◆ fputc_unfiltered()

int fputc_unfiltered | ( | int | c,
|  | struct ui_file * |
| ) |  |

## ◆ fputs_filtered()

void fputs_filtered | ( | const char * | ,
|  | struct ui_file * |
| ) |  |

## ◆ fputs_unfiltered()

void fputs_unfiltered | ( | const char * | ,
|  | struct ui_file * |
| ) |  |

## ◆ fputstr_filtered()

void fputstr_filtered | ( | const char * | str,
|  | int | quotr,
|  | struct ui_file * | stream
| ) |  |

## ◆ fputstr_unfiltered()

void fputstr_unfiltered | ( | const char * | str,
|  | int | quotr,
|  | struct ui_file * | stream
| ) |  |

## ◆ fputstrn_filtered()

void fputstrn_filtered | ( | const char * | str,
|  | int | n,
|  | int | quotr,
|  | struct ui_file * | stream
| ) |  |

## ◆ fputstrn_unfiltered()

void fputstrn_unfiltered | ( | const char * | str,
|  | int | n,
|  | int | quotr,
|  | struct ui_file * | stream
| ) |  |

## ◆ free_current_contents()

void free_current_contents | ( | void * |  | ) |

## ◆ gdb_abspath()

gdb::unique_xmalloc_ptr<char> gdb_abspath | ( | const char * |  | ) |

## ◆ gdb_bfd_errmsg()

const char* gdb_bfd_errmsg | ( | bfd_error_type | error_tag,
|  | char ** | matching
| ) |  |

## ◆ gdb_filename_fnmatch()

int gdb_filename_fnmatch | ( | const char * | pattern,
|  | const char * | string,
|  | int | flags
| ) |  |

## ◆ gdb_print_host_address_1()

void gdb_print_host_address_1 | ( | const void * | addr,
|  | struct ui_file * | stream
| ) |  |

## ◆ gdb_realpath()

gdb::unique_xmalloc_ptr<char> gdb_realpath | ( | const char * |  | ) |

## ◆ gdb_realpath_keepfile()

gdb::unique_xmalloc_ptr<char> gdb_realpath_keepfile | ( | const char * |  | ) |

## ◆ get_prompt_for_continue_wait_time()

std::chrono::steady_clock::duration get_prompt_for_continue_wait_time | ( |  | ) |

## ◆ hashtab_obstack_allocate()

void void void* hashtab_obstack_allocate | ( | void * | data,
|  | size_t | size,
|  | size_t | count
| ) |  |

## ◆ init_page_info()

void init_page_info | ( | void |  | ) |

## ◆ initialize_utils()

void initialize_utils | ( | void |  | ) |

## ◆ ldirname()

std::string ldirname | ( | const char * | filename | ) |

## ◆ make_bpstat_clear_actions_cleanup()

struct cleanup* make_bpstat_clear_actions_cleanup | ( | void |  | ) |

## ◆ make_cleanup_free_section_addr_info()

struct cleanup* make_cleanup_free_section_addr_info | ( | struct section_addr_info * |  | ) |

## ◆ make_cleanup_unpush_target()

struct cleanup* make_cleanup_unpush_target | ( | struct target_ops * | ops | ) |

## ◆ make_cleanup_value_free_to_mark()

struct cleanup* make_cleanup_value_free_to_mark | ( | struct value * |  | ) |

## ◆ make_hex_string()

char* make_hex_string | ( | const gdb_byte * | data,
|  | size_t | length
| ) |  |

## ◆ myread()

int myread | ( | int | ,
|  | char * | ,
|  | int |
| ) |  |

## ◆ n_spaces()

char* n_spaces | ( | int |  | ) |

## ◆ nquery()

int int nquery | ( | const char * | ,
|  |  | ...
| ) |  |

## ◆ paddress()

const char* paddress | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | addr
| ) |  |

## ◆ parse_escape()

int parse_escape | ( | struct gdbarch * | ,
|  | const char ** |
| ) |  |

## ◆ parse_pid_to_attach()

int parse_pid_to_attach | ( | const char * | args | ) |

## ◆ perror_warning_with_name()

void perror_warning_with_name | ( | const char * | string | ) |

## ◆ print_core_address()

const char* print_core_address | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | address
| ) |  |

## ◆ print_spaces()

void void void void void void void void void void void print_spaces | ( | int | ,
|  | struct ui_file * |
| ) |  |

## ◆ print_spaces_filtered()

void print_spaces_filtered | ( | int | ,
|  | struct ui_file * |
| ) |  |

## ◆ print_sys_errmsg()

void print_sys_errmsg | ( | const char * | ,
|  | int |
| ) |  |

## ◆ printf_filtered()

void void void void void printf_filtered | ( | const char * | ,
|  |  | ...
| ) |  |

## ◆ printf_unfiltered()

void void void void void void void void void void printf_unfiltered | ( | const char * | ,
|  |  | ...
| ) |  |

## ◆ printfi_filtered()

void void void void void void printfi_filtered | ( | int | ,
|  | const char * | ,
|  |  | ...
| ) |  |

## ◆ putchar_filtered()

int putchar_filtered | ( | int | c | ) |

## ◆ putchar_unfiltered()

int putchar_unfiltered | ( | int | c | ) |

## ◆ puts_debug()

void puts_debug | ( | char * | prefix,
|  | char * | string,
|  | char * | suffix
| ) |  |

## ◆ puts_filtered()

void puts_filtered | ( | const char * |  | ) |

## ◆ puts_filtered_tabular()

void puts_filtered_tabular | ( | char * | string,
|  | int | width,
|  | int | right
| ) |  |

## ◆ puts_unfiltered()

void puts_unfiltered | ( | const char * |  | ) |

## ◆ query()

int query | ( | const char * | ,
|  |  | ...
| ) |  |

## ◆ reinitialize_more_filter()

void reinitialize_more_filter | ( | void |  | ) |

## ◆ reset_prompt_for_continue_wait_time()

void reset_prompt_for_continue_wait_time | ( | void |  | ) |

## ◆ set_screen_width_and_height()

void set_screen_width_and_height | ( | int | width,
|  | int | height
| ) |  |

## ◆ strcmp_iw()

int strcmp_iw | ( | const char * | string1,
|  | const char * | string2
| ) |  |

## ◆ strcmp_iw_ordered()

int strcmp_iw_ordered | ( | const char * | ,
|  | const char * |
| ) |  |

## ◆ streq()

int streq | ( | const char * | ,
|  | const char * |
| ) |  |

## ◆ string_to_core_addr()

CORE_ADDR string_to_core_addr | ( | const char * | my_string | ) |

## ◆ strip_leading_path_elements()

const char* strip_leading_path_elements | ( | const char * | path,
|  | int | n
| ) |  |

## ◆ strncmp_iw()

int strncmp_iw | ( | const char * | string1,
|  | const char * | string2,
|  | size_t | string2_len
| ) |  |

## ◆ strncmp_iw_with_mode()

int strncmp_iw_with_mode | ( | const char * | string1,
|  | const char * | string2,
|  | size_t | string2_len,
|  | strncmp_iw_mode | mode,
|  | enum language | language,
|  | completion_match_for_lcd * | match_for_lcd = `NULL`
| ) |  |

## ◆ subset_compare()

int subset_compare | ( | const char * | ,
|  | const char * |
| ) |  |

## ◆ substitute_path_component()

void substitute_path_component | ( | char ** | stringp,
|  | const char * | from,
|  | const char * | to
| ) |  |

## ◆ throw_perror_with_name()

void throw_perror_with_name | ( | enum errors | errcode,
|  | const char * | string
| ) |  |

## ◆ vfprintf_filtered()

void void vfprintf_filtered | ( | struct ui_file * | ,
|  | const char * | ,
|  | va_list |
| ) |  |

## ◆ vfprintf_unfiltered()

void void void void void void void void vfprintf_unfiltered | ( | struct ui_file * | ,
|  | const char * | ,
|  | va_list |
| ) |  |

## ◆ vprintf_filtered()

void vprintf_filtered | ( | const char * | ,
|  | va_list |
| ) |  |

## ◆ vprintf_unfiltered()

void void void void void void void vprintf_unfiltered | ( | const char * | ,
|  | va_list |
| ) |  |

## ◆ warn_cant_dump_core()

void warn_cant_dump_core | ( | const char * | reason | ) |

## ◆ wrap_here()

void wrap_here | ( | const char * |  | ) |

## ◆ yquery()

int int int yquery | ( | const char * | ,
|  |  | ...
| ) |  |

## Variable Documentation

## ◆ deprecated_error_begin_hook

void(* deprecated_error_begin_hook) (void)

## ◆ gdb_stdtarg

struct ui_file* gdb_stdtarg

## ◆ gdb_stdtargerr

struct ui_file* gdb_stdtargerr

## ◆ gdb_stdtargin

struct ui_file* gdb_stdtargin

## ◆ pagination_enabled

int pagination_enabled

## ◆ sevenbit_strings

int sevenbit_strings

## ◆ warning_pre_print

const char* warning_pre_print