GDB (API)
|
#include "defs.h"
#include "dyn-string.h"
#include "gdb_assert.h"
#include <ctype.h>
#include "gdb_string.h"
#include "gdb_wait.h"
#include "event-top.h"
#include "exceptions.h"
#include "gdbthread.h"
#include "fnmatch.h"
#include "gdb_bfd.h"
#include <signal.h>
#include "timeval-utils.h"
#include "gdbcmd.h"
#include "serial.h"
#include "bfd.h"
#include "target.h"
#include "gdb-demangle.h"
#include "expression.h"
#include "language.h"
#include "charset.h"
#include "annotate.h"
#include "filenames.h"
#include "symfile.h"
#include "gdb_obstack.h"
#include "gdbcore.h"
#include "top.h"
#include "main.h"
#include "solist.h"
#include "inferior.h"
#include "gdb_curses.h"
#include "readline/readline.h"
#include <sys/time.h>
#include <time.h>
#include "gdb_usleep.h"
#include "interps.h"
#include "gdb_regex.h"
Go to the source code of this file.
Defines | |
#define | NUMCELLS 16 |
#define | CELLSIZE 50 |
#define | HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT) |
#define | AMBIGUOUS_MESS1 ".\nMatching formats:" |
#define | AMBIGUOUS_MESS2 ".\nUse \"set gnutarget format-name\" to specify the format." |
Functions | |
PTR | malloc () |
PTR | realloc () |
void | free () |
void | set_quit_flag (void) |
int | check_quit_flag (void) |
struct cleanup * | make_cleanup_freeargv (char **arg) |
struct cleanup * | make_cleanup_dyn_string_delete (dyn_string_t arg) |
struct cleanup * | make_cleanup_bfd_unref (bfd *abfd) |
struct cleanup * | make_cleanup_close (int fd) |
struct cleanup * | make_cleanup_fclose (FILE *file) |
struct cleanup * | make_cleanup_obstack_free (struct obstack *obstack) |
struct cleanup * | make_cleanup_ui_file_delete (struct ui_file *arg) |
struct cleanup * | make_cleanup_ui_out_redirect_pop (struct ui_out *uiout) |
struct cleanup * | make_cleanup_free_section_addr_info (struct section_addr_info *addrs) |
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_htab_delete (htab_t htab) |
struct cleanup * | make_cleanup_restore_ui_file (struct ui_file **variable) |
struct cleanup * | make_cleanup_value_free_to_mark (struct value *mark) |
struct cleanup * | make_cleanup_value_free (struct value *value) |
struct cleanup * | make_cleanup_free_so (struct so_list *so) |
struct cleanup * | make_cleanup_restore_current_language (void) |
void | free_current_contents (void *ptr) |
void | vwarning (const char *string, va_list args) |
void | warning (const char *string,...) |
void | verror (const char *string, va_list args) |
void | error (const char *string,...) |
void | vfatal (const char *string, va_list args) |
void | fatal (const char *string,...) |
void | error_stream (struct ui_file *stream) |
void | internal_verror (const char *file, int line, const char *fmt, va_list ap) |
void | internal_error (const char *file, int line, const char *string,...) |
void | internal_vwarning (const char *file, int line, const char *fmt, va_list ap) |
void | internal_warning (const char *file, int line, const char *string,...) |
void | throw_perror_with_name (enum errors errcode, const char *string) |
void | perror_with_name (const char *string) |
void | perror_warning_with_name (const char *string) |
void | print_sys_errmsg (const char *string, int errcode) |
void | quit (void) |
void | malloc_failure (long size) |
int | myread (int desc, char *addr, int len) |
void | print_spaces (int n, struct ui_file *file) |
void | gdb_print_host_address (const void *addr, struct ui_file *stream) |
struct cleanup * | make_regfree_cleanup (regex_t *r) |
char * | get_regcomp_error (int code, regex_t *rx) |
struct cleanup * | compile_rx_or_error (regex_t *pattern, const char *rx, const char *message) |
int | nquery (const char *ctlstr,...) |
int | yquery (const char *ctlstr,...) |
int | query (const char *ctlstr,...) |
int | parse_escape (struct gdbarch *gdbarch, const char **string_ptr) |
void | fputstr_filtered (const char *str, int quoter, struct ui_file *stream) |
void | fputstr_unfiltered (const char *str, int quoter, struct ui_file *stream) |
void | fputstrn_filtered (const char *str, int n, int quoter, struct ui_file *stream) |
void | fputstrn_unfiltered (const char *str, int n, int quoter, struct ui_file *stream) |
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) |
void | reset_prompt_for_continue_wait_time (void) |
struct timeval | get_prompt_for_continue_wait_time (void) |
void | reinitialize_more_filter (void) |
void | wrap_here (char *indent) |
void | puts_filtered_tabular (char *string, int width, int right) |
void | begin_line (void) |
void | fputs_filtered (const char *linebuffer, struct ui_file *stream) |
int | putchar_unfiltered (int c) |
int | putchar_filtered (int c) |
int | fputc_unfiltered (int c, struct ui_file *stream) |
int | fputc_filtered (int c, struct ui_file *stream) |
void | puts_debug (char *prefix, char *string, char *suffix) |
void | vfprintf_filtered (struct ui_file *stream, const char *format, va_list args) |
void | vfprintf_unfiltered (struct ui_file *stream, const char *format, va_list args) |
void | vprintf_filtered (const char *format, va_list args) |
void | vprintf_unfiltered (const char *format, va_list args) |
void | fprintf_filtered (struct ui_file *stream, const char *format,...) |
void | fprintf_unfiltered (struct ui_file *stream, const char *format,...) |
void | fprintfi_filtered (int spaces, struct ui_file *stream, const char *format,...) |
void | printf_filtered (const char *format,...) |
void | printf_unfiltered (const char *format,...) |
void | printfi_filtered (int spaces, const char *format,...) |
void | puts_filtered (const char *string) |
void | puts_unfiltered (const char *string) |
char * | n_spaces (int n) |
void | print_spaces_filtered (int n, struct ui_file *stream) |
void | fprintf_symbol_filtered (struct ui_file *stream, const char *name, enum language lang, int arg_mode) |
int | strcmp_iw (const char *string1, const char *string2) |
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) |
void | initialize_utils (void) |
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 * | pulongest (ULONGEST u) |
char * | plongest (LONGEST l) |
char * | phex (ULONGEST l, int sizeof_l) |
char * | phex_nz (ULONGEST l, int sizeof_l) |
char * | hex_string (LONGEST num) |
char * | hex_string_custom (LONGEST num, int width) |
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) |
const char * | host_address_to_string (const void *addr) |
char * | gdb_realpath (const char *filename) |
ULONGEST | align_up (ULONGEST v, int n) |
ULONGEST | align_down (ULONGEST v, int n) |
LONGEST | gdb_sign_extend (LONGEST value, int bit) |
void * | hashtab_obstack_allocate (void *data, size_t size, size_t count) |
void | dummy_obstack_deallocate (void *object, void *data) |
ULONGEST | strtoulst (const char *num, const char **trailer, int base) |
char * | ldirname (const char *filename) |
char ** | gdb_buildargv (const char *s) |
int | compare_positive_ints (const void *ap, const void *bp) |
int | compare_strings (const void *arg1, const void *arg2) |
const char * | gdb_bfd_errmsg (bfd_error_type error_tag, char **matching) |
int | parse_pid_to_attach (char *args) |
struct cleanup * | make_bpstat_clear_actions_cleanup (void) |
int | producer_is_gcc_ge_4 (const char *producer) |
struct cleanup * | make_cleanup_free_char_ptr_vec (VEC(char_ptr)*char_ptr_vec) |
void | substitute_path_component (char **stringp, const char *from, const char *to) |
int | gdb_filename_fnmatch (const char *pattern, const char *string, int flags) |
void | _initialize_utils (void) |
Variables | |
void(* | deprecated_error_begin_hook )(void) |
int | sevenbit_strings = 0 |
char * | warning_pre_print = "\nwarning: " |
int | pagination_enabled = 1 |
const char | internal_problem_ask [] = "ask" |
const char | internal_problem_yes [] = "yes" |
const char | internal_problem_no [] = "no" |
initialize_file_ftype | _initialize_utils |
#define AMBIGUOUS_MESS1 ".\nMatching formats:" |
#define AMBIGUOUS_MESS2 ".\nUse \"set gnutarget format-name\" to specify the format." |
#define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT) |
void _initialize_utils | ( | void | ) |
void begin_line | ( | void | ) |
int check_quit_flag | ( | void | ) |
int compare_positive_ints | ( | const void * | ap, |
const void * | bp | ||
) |
int compare_strings | ( | const void * | ap, |
const void * | bp | ||
) |
struct cleanup* compile_rx_or_error | ( | regex_t * | pattern, |
const char * | rx, | ||
const char * | message | ||
) | [read] |
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 error_stream | ( | struct ui_file * | stream | ) |
void fprintf_filtered | ( | struct ui_file * | stream, |
const char * | format, | ||
... | |||
) |
void fprintf_symbol_filtered | ( | struct ui_file * | stream, |
const char * | name, | ||
enum language | lang, | ||
int | arg_mode | ||
) |
void fprintf_unfiltered | ( | struct ui_file * | stream, |
const char * | format, | ||
... | |||
) |
void fprintfi_filtered | ( | int | spaces, |
struct ui_file * | stream, | ||
const char * | format, | ||
... | |||
) |
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 fputstr_filtered | ( | const char * | str, |
int | quoter, | ||
struct ui_file * | stream | ||
) |
void fputstr_unfiltered | ( | const char * | str, |
int | quoter, | ||
struct ui_file * | stream | ||
) |
void fputstrn_filtered | ( | const char * | str, |
int | n, | ||
int | quoter, | ||
struct ui_file * | stream | ||
) |
void fputstrn_unfiltered | ( | const char * | str, |
int | n, | ||
int | quoter, | ||
struct ui_file * | stream | ||
) |
void free | ( | ) |
void free_current_contents | ( | void * | ptr | ) |
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] |
char* get_regcomp_error | ( | int | code, |
regex_t * | rx | ||
) |
void* hashtab_obstack_allocate | ( | void * | data, |
size_t | size, | ||
size_t | count | ||
) |
char* hex_string | ( | LONGEST | ) |
char* hex_string_custom | ( | LONGEST | num, |
int | width | ||
) |
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 internal_error | ( | const char * | file, |
int | line, | ||
const char * | string, | ||
... | |||
) |
void internal_verror | ( | const char * | file, |
int | line, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
void internal_vwarning | ( | const char * | file, |
int | line, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
void internal_warning | ( | const char * | file, |
int | line, | ||
const char * | string, | ||
... | |||
) |
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 | ( | dyn_string_t | arg | ) | [read] |
struct cleanup* make_cleanup_fclose | ( | FILE * | file | ) | [read] |
struct cleanup* make_cleanup_free_char_ptr_vec | ( | VEC(char_ptr)* | char_ptr_vec | ) | [read] |
struct cleanup* make_cleanup_free_section_addr_info | ( | struct section_addr_info * | addrs | ) | [read] |
struct cleanup* make_cleanup_free_so | ( | struct so_list * | so | ) | [read] |
struct cleanup* make_cleanup_freeargv | ( | char ** | arg | ) | [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 * | arg | ) | [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 * | value | ) | [read] |
struct cleanup* make_cleanup_value_free_to_mark | ( | struct value * | mark | ) | [read] |
struct cleanup* make_regfree_cleanup | ( | regex_t * | r | ) | [read] |
PTR malloc | ( | ) |
void malloc_failure | ( | long | size | ) |
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 * | string | ) |
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 print_spaces | ( | int | n, |
struct ui_file * | file | ||
) |
void print_spaces_filtered | ( | int | n, |
struct ui_file * | stream | ||
) |
void print_sys_errmsg | ( | const char * | string, |
int | errcode | ||
) |
void printf_filtered | ( | const char * | format, |
... | |||
) |
void printf_unfiltered | ( | const char * | format, |
... | |||
) |
void printfi_filtered | ( | int | spaces, |
const char * | format, | ||
... | |||
) |
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 * | ) |
PTR realloc | ( | ) |
void reinitialize_more_filter | ( | void | ) |
void reset_prompt_for_continue_wait_time | ( | void | ) |
struct cleanup* set_batch_flag_and_make_cleanup_restore_page_info | ( | void | ) | [read] |
void set_quit_flag | ( | void | ) |
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 vfprintf_filtered | ( | struct ui_file * | stream, |
const char * | format, | ||
va_list | args | ||
) |
void vfprintf_unfiltered | ( | struct ui_file * | stream, |
const char * | format, | ||
va_list | args | ||
) |
void vprintf_filtered | ( | const char * | format, |
va_list | args | ||
) |
void vprintf_unfiltered | ( | const char * | format, |
va_list | args | ||
) |
void(* deprecated_error_begin_hook)(void) |
const char internal_problem_ask[] = "ask" |
const char internal_problem_no[] = "no" |
const char internal_problem_yes[] = "yes" |
int sevenbit_strings = 0 |
char* warning_pre_print = "\nwarning: " |