GDB (API)
|
Go to the source code of this file.
Functions | |
void | initialize_utils (void) |
char * | savestring (const char *ptr, size_t len) |
int | strcmp_iw (const char *, const char *) |
int | strcmp_iw_ordered (const char *string1, const char *string2) |
int | streq (const char *lhs, const char *rhs) |
int | subset_compare (char *string_to_compare, char *template_string) |
ULONGEST | strtoulst (const char *num, const char **trailer, int base) |
int | compare_positive_ints (const void *ap, const void *bp) |
int | compare_strings (const void *ap, const void *bp) |
char * | safe_strerror (int) |
const char * | gdb_bfd_errmsg (bfd_error_type error_tag, char **matching) |
void | reset_prompt_for_continue_wait_time (void) |
struct timeval | get_prompt_for_continue_wait_time (void) |
int | parse_pid_to_attach (char *args) |
int | parse_escape (struct gdbarch *, const char **) |
char ** | gdb_buildargv (const char *s) |
struct cleanup * | make_cleanup_freeargv (char **) |
struct cleanup * | make_cleanup_dyn_string_delete (struct dyn_string *) |
struct cleanup * | make_cleanup_ui_file_delete (struct ui_file *) |
struct cleanup * | make_cleanup_ui_out_redirect_pop (struct ui_out *uiout) |
struct cleanup * | make_cleanup_free_section_addr_info (struct section_addr_info *)) |
struct cleanup * | make_cleanup_close (int fd) |
struct cleanup * | make_cleanup_fclose (FILE *file) |
struct cleanup * | make_cleanup_bfd_unref (bfd *abfd) |
struct cleanup * | make_cleanup_obstack_free (struct obstack *obstack) |
struct cleanup * | make_cleanup_restore_integer (int *variable) |
struct cleanup * | make_cleanup_restore_uinteger (unsigned int *variable) |
struct cleanup * | make_cleanup_unpush_target (struct target_ops *ops) |
struct cleanup * | make_cleanup_restore_ui_file (struct ui_file **variable) |
struct cleanup * | make_cleanup_value_free_to_mark (struct value *) |
struct cleanup * | make_cleanup_value_free (struct value *) |
struct cleanup * | make_cleanup_free_so (struct so_list *so) |
struct cleanup * | make_cleanup_restore_current_language (void) |
struct cleanup * | make_cleanup_htab_delete (htab_t htab) |
void | free_current_contents (void *) |
void | init_page_info (void) |
struct cleanup * | make_cleanup_restore_page_info (void) |
struct cleanup * | set_batch_flag_and_make_cleanup_restore_page_info (void) |
struct cleanup * | make_bpstat_clear_actions_cleanup (void) |
char * | gdb_realpath (const char *filename) |
int | gdb_filename_fnmatch (const char *pattern, const char *string, int flags) |
void | substitute_path_component (char **stringp, const char *from, const char *to) |
char * | ldirname (const char *filename) |
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 (char *) |
void | reinitialize_more_filter (void) |
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) |
void | gdb_print_host_address (const void *addr, struct ui_file *stream) |
const char * | host_address_to_string (const void *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) |
char * | plongest (LONGEST l) |
char * | pulongest (ULONGEST l) |
char * | phex (ULONGEST l, int sizeof_l) |
char * | phex_nz (ULONGEST l, int sizeof_l) |
char * | int_string (LONGEST val, int radix, int is_signed, int width, int use_c_format) |
const char * | core_addr_to_string (const CORE_ADDR addr) |
const char * | core_addr_to_string_nz (const CORE_ADDR addr) |
CORE_ADDR | string_to_core_addr (const char *my_string) |
char * | hex_string (LONGEST) |
char * | hex_string_custom (LONGEST, int) |
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_with_name (const char *) ATTRIBUTE_NORETURN |
void | perror_warning_with_name (const char *string) |
void | print_sys_errmsg (const char *, int) |
void | verror (const char *fmt, va_list ap) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1 |
void void | error (const char *fmt,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1 |
void void void | error_stream (struct ui_file *) ATTRIBUTE_NORETURN |
void | vfatal (const char *fmt, va_list ap) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1 |
void void | fatal (const char *fmt,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1 |
void void void | internal_verror (const char *file, int line, const char *, va_list ap) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(3 |
void void void void | internal_vwarning (const char *file, int line, const char *, va_list ap) ATTRIBUTE_PRINTF(3 |
void void void void void | internal_warning (const char *file, int line, const char *,...) ATTRIBUTE_PRINTF(3 |
void void void void void void | warning (const char *,...) ATTRIBUTE_PRINTF(1 |
void void void void void void void | vwarning (const char *, va_list args) ATTRIBUTE_PRINTF(1 |
void void void void void void void void * | hashtab_obstack_allocate (void *data, size_t size, size_t count) |
void | dummy_obstack_deallocate (void *object, void *data) |
int | producer_is_gcc_ge_4 (const char *producer) |
int | myread (int, char *, int) |
ULONGEST | align_up (ULONGEST v, int n) |
ULONGEST | align_down (ULONGEST v, int n) |
LONGEST | gdb_sign_extend (LONGEST value, int bit) |
Variables | |
int | sevenbit_strings |
int | pagination_enabled |
struct ui_file * | gdb_stdout |
struct ui_file * | gdb_stdin |
struct ui_file * | gdb_stderr |
struct ui_file * | gdb_stdlog |
struct ui_file * | gdb_stdtarg |
struct ui_file * | gdb_stdtargerr |
struct ui_file * | gdb_stdtargin |
void(* | deprecated_error_begin_hook )(void) |
char * | warning_pre_print |
int compare_positive_ints | ( | const void * | ap, |
const void * | bp | ||
) |
int compare_strings | ( | const void * | ap, |
const void * | bp | ||
) |
hashval_t core_addr_hash | ( | const void * | ap | ) |
const char* core_addr_to_string | ( | const CORE_ADDR | addr | ) |
Convert a CORE_ADDR into a hex string with leading zeros, and prefixed with "0x" as in C syntax. The output from core_addr_to_string() can be passed direct to string_to_core_addr().
const char* core_addr_to_string_nz | ( | const CORE_ADDR | addr | ) |
Convert a CORE_ADDR into a hex string, withOUT leading zeros, and prefixed with "0x" as in C syntax. The output from core_addr_to_string() can be passed direct to string_to_core_addr().
void dummy_obstack_deallocate | ( | void * | object, |
void * | data | ||
) |
void void void error_stream | ( | struct ui_file * | ) |
void void void fprintf_filtered | ( | struct ui_file * | , |
const char * | , | ||
... | |||
) |
void fprintf_symbol_filtered | ( | struct ui_file * | , |
const char * | , | ||
enum | language, | ||
int | |||
) |
void void void void void void void void void fprintf_unfiltered | ( | struct ui_file * | , |
const char * | , | ||
... | |||
) |
void void void void fprintfi_filtered | ( | int | , |
struct ui_file * | , | ||
const char * | , | ||
... | |||
) |
int fputc_filtered | ( | int | c, |
struct ui_file * | |||
) |
int fputc_unfiltered | ( | int | c, |
struct ui_file * | |||
) |
void fputs_filtered | ( | const char * | , |
struct ui_file * | |||
) |
void fputs_unfiltered | ( | const char * | , |
struct ui_file * | |||
) |
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 | ||
) |
void free_current_contents | ( | void * | ) |
const char* gdb_bfd_errmsg | ( | bfd_error_type | error_tag, |
char ** | matching | ||
) |
char** gdb_buildargv | ( | const char * | s | ) |
int gdb_filename_fnmatch | ( | const char * | pattern, |
const char * | string, | ||
int | flags | ||
) |
void gdb_print_host_address | ( | const void * | addr, |
struct ui_file * | stream | ||
) |
char* gdb_realpath | ( | const char * | filename | ) |
struct timeval get_prompt_for_continue_wait_time | ( | void | ) | [read] |
void void void void void void void void* hashtab_obstack_allocate | ( | void * | data, |
size_t | size, | ||
size_t | count | ||
) |
char* hex_string | ( | LONGEST | ) |
char* hex_string_custom | ( | LONGEST | , |
int | |||
) |
const char* host_address_to_string | ( | const void * | addr | ) |
void init_page_info | ( | void | ) |
void initialize_utils | ( | void | ) |
Convert VAL to a numeral in the given radix. For radix 10, IS_SIGNED may be true, indicating a signed quantity; otherwise VAL is interpreted as unsigned. If WIDTH is supplied, it is the minimum width (0-padded if needed). USE_C_FORMAT means to use C format in all cases. If it is false, then 'x' and 'o' formats do not include a prefix (0x or leading 0).
void void void internal_verror | ( | const char * | file, |
int | line, | ||
const char * | , | ||
va_list | ap | ||
) |
void void void void internal_vwarning | ( | const char * | file, |
int | line, | ||
const char * | , | ||
va_list | ap | ||
) |
void void void void void internal_warning | ( | const char * | file, |
int | line, | ||
const char * | , | ||
... | |||
) |
struct cleanup* make_bpstat_clear_actions_cleanup | ( | void | ) | [read] |
struct cleanup* make_cleanup_bfd_unref | ( | bfd * | abfd | ) | [read] |
struct cleanup* make_cleanup_close | ( | int | fd | ) | [read] |
struct cleanup* make_cleanup_dyn_string_delete | ( | struct dyn_string * | ) | [read] |
struct cleanup* make_cleanup_fclose | ( | FILE * | file | ) | [read] |
struct cleanup* make_cleanup_free_section_addr_info | ( | struct section_addr_info * | ) | [read] |
struct cleanup* make_cleanup_free_so | ( | struct so_list * | so | ) | [read] |
struct cleanup* make_cleanup_freeargv | ( | char ** | ) | [read] |
struct cleanup* make_cleanup_htab_delete | ( | htab_t | htab | ) | [read] |
struct cleanup* make_cleanup_obstack_free | ( | struct obstack * | obstack | ) | [read] |
struct cleanup* make_cleanup_restore_current_language | ( | void | ) | [read] |
struct cleanup* make_cleanup_restore_integer | ( | int * | variable | ) | [read] |
struct cleanup* make_cleanup_restore_page_info | ( | void | ) | [read] |
struct cleanup* make_cleanup_restore_ui_file | ( | struct ui_file ** | variable | ) | [read] |
struct cleanup* make_cleanup_restore_uinteger | ( | unsigned int * | variable | ) | [read] |
struct cleanup* make_cleanup_ui_file_delete | ( | struct ui_file * | ) | [read] |
struct cleanup* make_cleanup_ui_out_redirect_pop | ( | struct ui_out * | uiout | ) | [read] |
struct cleanup* make_cleanup_unpush_target | ( | struct target_ops * | ops | ) | [read] |
struct cleanup* make_cleanup_value_free | ( | struct value * | ) | [read] |
struct cleanup* make_cleanup_value_free_to_mark | ( | struct value * | ) | [read] |
int parse_escape | ( | struct gdbarch * | , |
const char ** | |||
) |
Parse a C escape sequence. STRING_PTR points to a variable containing a pointer to the string to parse. That pointer should point to the character after the \. That pointer is updated past the characters we use. The value of the escape sequence is returned.
A negative value means the sequence \ newline was seen, which is supposed to be equivalent to nothing at all.
If \ is followed by a null character, we return a negative value and leave the string pointer pointing at the null character.
If \ is followed by 000, we return 0 and leave the string pointer after the zeros. A value of 0 does not mean end of string.
int parse_pid_to_attach | ( | char * | args | ) |
void perror_warning_with_name | ( | const char * | string | ) |
void perror_with_name | ( | const char * | ) |
Print a ULONGEST in %0x format (hex with leading zeros).
l | the unsigned integer to print |
sizeof_l | size of integer to print; values of 2, 4, and 8 force sizes of the respective numbers of bytes, any other value will use sizeof(l) |
Print a ULONGEST in x format (hex, and NO leading zeros).
l | the unsigned integer to print |
sizeof_l | size of integer to print; values of 2, 4, and 8 force sizes of the respective numbers of bytes, any other value will use sizeof(l) |
const char* print_core_address | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | address | ||
) |
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 * | |||
) |
void print_sys_errmsg | ( | const char * | , |
int | |||
) |
void void void void void printf_filtered | ( | const char * | , |
... | |||
) |
void void void void void void void void void void printf_unfiltered | ( | const char * | , |
... | |||
) |
void void void void void void printfi_filtered | ( | int | , |
const char * | , | ||
... | |||
) |
int producer_is_gcc_ge_4 | ( | const char * | producer | ) |
int putchar_filtered | ( | int | c | ) |
int putchar_unfiltered | ( | int | c | ) |
void puts_debug | ( | char * | prefix, |
char * | string, | ||
char * | suffix | ||
) |
void puts_filtered | ( | const char * | ) |
void puts_filtered_tabular | ( | char * | string, |
int | width, | ||
int | right | ||
) |
void puts_unfiltered | ( | const char * | ) |
void reinitialize_more_filter | ( | void | ) |
void reset_prompt_for_continue_wait_time | ( | void | ) |
char* safe_strerror | ( | int | ) |
A host-specific version of strerror.
This is defined in *-hdep.c, e.g., posix-hdep.c.
Definition at line 50 of file mingw-hdep.c.
char* savestring | ( | const char * | ptr, |
size_t | len | ||
) |
Make a copy of a string, using freshly-allocated space and limiting to the given length. Space is gotten using xmalloc.
ptr | pointer to the string to be copied |
len | maximum length to copy. If the original string is longer, then the copy will be truncated to len bytes. |
Definition at line 156 of file common-utils.c.
struct cleanup* set_batch_flag_and_make_cleanup_restore_page_info | ( | void | ) | [read] |
int strcmp_iw_ordered | ( | const char * | string1, |
const char * | string2 | ||
) |
This is like strcmp except that it ignores whitespace and treats '(' as the first non-NULL character in terms of ordering. Like strcmp (and unlike strcmp_iw), it returns negative if STRING1 < STRING2, 0 if STRING2 = STRING2, and positive if STRING1 > STRING2 according to that ordering.
If a list is sorted according to this function and if you want to find names in the list that match some fixed NAME according to strcmp_iw(LIST_ELT, NAME), then the place to start looking is right where this function would put NAME.
This function must be neutral to the CASE_SENSITIVITY setting as the user may choose it during later lookup. Therefore this function always sorts primarily case-insensitively and secondarily case-sensitively.
Here are some examples of why using strcmp to sort is a bad idea:
Whitespace example:
Say your partial symtab contains: "foo<char *>", "goo". Then, if we try to do a search for "foo<char*>", strcmp will locate this after "foo<char *>" and before "goo". Then lookup_partial_symbol will start looking at strings beginning with "goo", and will never see the correct match of "foo<char *>".
Parenthesis example:
In practice, this is less like to be an issue, but I'll give it a shot. Let's assume that '$' is a legitimate character to occur in symbols. (Which may well even be the case on some systems.) Then say that the partial symbol table contains "foo$" and "foo(int)". strcmp will put them in this order, since '$' < '('. Now, if the user searches for "foo", then strcmp will sort "foo" before "foo$". Then lookup_partial_symbol will notice that strcmp_iw("foo$", "foo") is false, so it won't proceed to the actual match of "foo(int)" with "foo".
CORE_ADDR string_to_core_addr | ( | const char * | my_string | ) |
int subset_compare | ( | char * | string_to_compare, |
char * | template_string | ||
) |
void substitute_path_component | ( | char ** | stringp, |
const char * | from, | ||
const char * | to | ||
) |
void throw_perror_with_name | ( | enum errors | errcode, |
const char * | string | ||
) |
void void vfprintf_filtered | ( | struct ui_file * | , |
const char * | , | ||
va_list | |||
) |
void void void void void void void void vfprintf_unfiltered | ( | struct ui_file * | , |
const char * | , | ||
va_list | |||
) |
void vprintf_filtered | ( | const char * | , |
va_list | |||
) |
void void void void void void void vprintf_unfiltered | ( | const char * | , |
va_list | |||
) |
Like warning, but takes a va_list of arguments.
Print a warning message.
The first argument STRING is the warning message, used as a fprintf string, and the remaining args are passed as arguments to it. The primary difference between warnings and errors is that a warning does not force the return to command level.
void(* deprecated_error_begin_hook)(void) |
struct ui_file* gdb_stderr |
struct ui_file* gdb_stdlog |
struct ui_file* gdb_stdout |
struct ui_file* gdb_stdtarg |
struct ui_file* gdb_stdtargerr |
struct ui_file* gdb_stdtargin |
char* warning_pre_print |