GDB (xrefs)

Functions
common-utils.h File Reference
`#include <string>`
`#include <vector>`
`#include "poison.h"`

Go to the source code of this file.

## Functions
void * | xzalloc (size_t)
template<typename T >
static void | xfree (T *ptr)
char * | xstrprintf (const char *format,...) ATTRIBUTE_PRINTF(1
char char * | xstrvprintf (const char *format, va_list ap) ATTRIBUTE_PRINTF(1
char char int | xsnprintf (char *str, size_t size, const char *format,...) ATTRIBUTE_PRINTF(3
char char int std::string | string_printf (const char *fmt,...) ATTRIBUTE_PRINTF(1
char char int std::string std::string | string_vprintf (const char *fmt, va_list args) ATTRIBUTE_PRINTF(1
char char int std::string std::string void | string_appendf (std::string &dest, const char *fmt,...) ATTRIBUTE_PRINTF(2
char char int std::string std::string void void | string_vappendf (std::string &dest, const char *fmt, va_list args) ATTRIBUTE_PRINTF(2
char char int std::string std::string void void char * | savestring (const char *ptr, size_t len)
char * | safe_strerror (int)
static int | startswith (const char *string, const char *pattern)
ULONGEST | strtoulst (const char *num, const char **trailer, int base)
char * | skip_spaces (char *inp)
const char * | skip_spaces (const char *inp)
char * | skip_to_space (char *inp)
const char * | skip_to_space (const char *inp)
void | free_vector_argv (std::vector< char *> &v)
std::string | stringify_argv (const std::vector< char *> &argv)
template<typename T >
static bool | in_inclusive_range (T value, T low, T high)

## Function Documentation

## ◆ free_vector_argv()

void free_vector_argv | ( | std::vector< char *> & | v | ) |

Definition at line 381 of file common-utils.c.

References xfree().

## ◆ in_inclusive_range()

template<typename T >

static bool in_inclusive_range | ( | T | value,
|  | T | low,
|  | T | high
| ) |  |
| static

Definition at line 144 of file common-utils.h.

Referenced by arm_record_extension_space(), cris_spec_reg_applicable(), and thumb_record_ld_st_reg_offset().

## ◆ safe_strerror()

char* safe_strerror | ( | int |  | ) |

Definition at line 32 of file mingw-strerror.c.

References xsnprintf().

Referenced by attach_proc_task_lwp_callback(), host_float_ops< T >::binop(), child_terminal_ours_1(), close_with_trace(), create_tty_session(), ctf_save_fseek(), ctf_save_write(), ctf_save_write_metadata(), ctf_start(), darwin_attach(), darwin_decode_message(), darwin_detach(), darwin_kill_inferior(), darwin_pre_ptrace(), darwin_ptrace(), darwin_stop_inferior(), detach_one_lwp(), displaced_step_prepare_throw(), do_attach(), dsbt_current_sos(), fetch_register(), fork_inferior(), frv_current_sos(), gdb_safe_append_history(), gnu_read_inferior(), gnu_wait(), go32_terminal_inferior(), go32_terminal_ours(), hardwire_raw(), ia64_linux_fetch_register(), ia64_linux_store_register(), inf_continue(), inf_ptrace_fetch_register(), inf_ptrace_store_register(), inf_ptrace_wait(), inf_set_pid(), inf_set_traced(), inf_signal(), inf_startup(), info_port_rights(), kill_one_lwp(), linux_nat_wait_1(), linux_ptrace_attach_fail_reason_string(), linux_ptrace_test_ret_to_nx(), lseek_with_trace(), make_proc(), maybe_disable_address_space_randomization::maybe_disable_address_space_randomization(), mi_cmd_env_pwd(), new_tty(), open_symbol_file_object(), open_with_trace(), perror_string(), pipe_windows_open(), print_sys_errmsg(), proc_restore_exc_port(), proc_steal_exc_port(), proc_update_sc(), procfs_create_inferior(), procfs_meminfo(), procfs_open_1(), procfs_pidlist(), procfs_store_registers(), ptrace_check(), pwd_command(), remote_hostio_error(), restore_binary_file(), restore_section_callback(), rs6000_wait(), save_breakpoints(), serial_logchar(), shell_escape(), spu_child_wait(), steal_exc_port(), stop_callback(), stop_wait_callback(), store_register(), svr4_read_so_list(), tfile_start(), thread_takeover_sc_cmd(), trace_start_error_with_name(), try_thread_db_load(), unpush_and_perror(), wait_with_trace(), write_with_trace(), x86_linux_enable_btrace(), and maybe_disable_address_space_randomization::~maybe_disable_address_space_randomization().

## ◆ savestring()

char char int std::string std::string void void char* savestring | ( | const char * | ptr,
|  | size_t | len
| ) |  |

Definition at line 226 of file common-utils.c.

References xmalloc().

Referenced by add_path(), cd_command(), copy_token_string(), explicit_location_lex_one(), explicit_location_lex_one_function(), find_condition_and_thread(), init_breakpoint_sal(), linespec_parse_basic(), maintenance_do_deprecate(), new_linespec_location(), parse_macro_definition(), process_next_line(), read_member_functions(), read_one_struct_field(), record_full_goto_bookmark(), scan_expression(), scan_filename(), solib_find_1(), strip_bg_char(), and watch_command_1().

## ◆ skip_spaces() [1/2]

char* skip_spaces | ( | char * | inp | ) |

Definition at line 337 of file common-utils.c.

Referenced by aarch64_stap_parse_special_token(), ada_get_next_arg(), add_solib_catchpoint(), agent_command_1(), arm_stap_parse_special_token(), bppy_init(), break_range_command(), catch_ada_assert_command_split(), catch_ada_exception_command_split(), catch_exception_command_1(), catch_exec_command_1(), catch_fork_command_1(), catch_signal_command(), catch_signal_split_args(), catch_syscall_command_1(), catch_syscall_split_args(), check_raw_argument(), cmd_record_call_history(), cmd_record_insn_history(), collect_explicit_location_matches(), compile_code_command(), compile_file_command(), complete_line_internal_1(), condition_completer(), cp_search_name_hash(), decode_agent_options(), decode_static_tracepoint_spec(), decode_vmflags(), demangle_command(), disassemble_command(), disassembler_options_completer(), encode_actions_1(), ep_parse_optional_if_clause(), expand_preserving_ws(), extract_arg(), extract_exception_regexp(), find_condition_and_thread(), gdbscm_register_breakpoint_x(), get_call_history_modifiers(), get_context_size(), get_insn_history_modifiers(), get_insn_number(), number_or_range_parser::get_number(), get_number_trailer(), get_selected_pc_producer_options(), get_selections(), tid_range_parser::get_tid_or_range(), get_uint(), go32_pde(), go32_pte(), go32_pte_for_address(), go32_sgdt(), go32_sidt(), go32_sldt(), guile_command(), guile_repl_command(), info_auto_load_libthread_db(), info_macro_command(), info_threads_command(), init_breakpoint_sal(), init_history(), is_closing_quote_enclosed(), is_unlimited_literal(), lex_number(), line_first_arg(), linespec_lexer_lex_keyword(), linespec_lexer_lex_one(), linespec_lexer_lex_string(), linespec_parse_basic(), linux_fill_prpsinfo(), linux_info_proc(), maint_agent_printf_command(), maint_btrace_packet_history_cmd(), maintenance_translate_address(), mi_parse(), mi_parse_argv(), msymbol_hash_iw(), stap_probe::parse_arguments(), parse_cmd_to_aexpr(), parse_find_args(), parse_frame_specification(), parse_linespec(), parse_method(), parse_probes(), parse_proc_status_state(), parse_selector(), process_next_line(), python_command(), python_interactive_command(), rbreak_command(), read_mapping(), registers_info(), restore_command(), save_gdb_index_command(), scan_expression(), scan_filename(), serial_open(), set_completion_after_number(), set_ext_lang_command(), source_command(), stap_parse_argument(), stap_parse_argument_1(), stap_parse_argument_conditionally(), stap_parse_single_operand(), string_to_explicit_location(), strncmp_iw_with_mode(), tfind_outside_command(), tfind_range_command(), thread_apply_all_command(), thread_name_command(), trace_dump_actions(), trace_pass_command(), trace_variable_command(), ui_printf(), update_dprintf_command_list(), validate_actionline(), watch_command_1(), watch_maybe_just_location(), and whatis_exp().

## ◆ skip_spaces() [2/2]

const char* skip_spaces | ( | const char * | inp | ) |

Definition at line 349 of file common-utils.c.

## ◆ skip_to_space() [1/2]

char* skip_to_space | ( | char * | inp | ) |

Definition at line 373 of file common-utils.c.

References skip_to_space().

## ◆ skip_to_space() [2/2]

const char* skip_to_space | ( | const char * | inp | ) |

Definition at line 361 of file common-utils.c.

Referenced by ada_get_next_arg(), condition_completer(), decode_static_tracepoint_spec(), decode_vmflags(), demangle_command(), extract_arg(), extract_exception_regexp(), find_condition_and_thread(), get_selected_pc_producer_options(), tid_range_parser::get_tid_or_range(), info_macro_command(), init_breakpoint_sal(), parse_linespec(), parse_probes(), producer_is_icc(), skip_keyword(), skip_to_space(), and watch_command_1().

## ◆ startswith()

static int startswith | ( | const char * | string,
|  | const char * | pattern
| ) |  |
| inline static

Definition at line 107 of file common-utils.h.

Referenced by _initialize_amd64_linux_tdep(), ada_add_block_symbols(), ada_decode(), ada_encode_1(), ada_is_ignored_field(), ada_is_parent_field(), ada_is_wrapper_field(), ada_lookup_name_info::ada_lookup_name_info(), ada_remove_trailing_digits(), ada_variant_discrim_name(), add_to_thread_list(), advance_wild_match(), amd64_skip_prologue(), amd64_windows_skip_trampoline_code(), amd64obsd_trapframe_cache(), amd64obsd_trapframe_sniffer(), arc_arch_is_em(), arc_arch_is_hs(), arm_pe_skip_trampoline_code(), arm_skip_prologue(), arm_skip_stack_protector(), arm_skip_stub(), bsd_uthread_solib_loaded(), c_type_print_base_1(), c_type_print_base_struct_union(), catch_ada_assert_command_split(), catch_ada_exception_command_split(), catch_syscall_completer(), catch_syscall_split_args(), check_modifier(), check_stub_method(), check_stub_method_group(), coff_locate_sections(), coff_symfile_read(), coff_symtab_read(), continue_command(), core_process_module_section(), cp_find_first_component_aux(), cp_lookup_symbol_via_imports(), cp_search_name_hash(), decode_frame_entry_1(), default_search_name_hash(), do_rmdir(), regcache::dump(), dwarf2_frame_find_quirks(), dwarf2_name(), elf_symtab_read(), explicit_location_lex_one(), extract_identifier(), field_alignment(), field_name_match(), find_methods(), find_toplevel_string(), full_match(), gcore_copy_callback(), gdb_mangle_name(), gdb_sysroot_changed(), get_offsets(), get_selected_pc_producer_options(), gnuv2_is_constructor_name(), gnuv2_is_destructor_name(), gnuv2_is_operator_name(), gnuv3_is_operator_name(), gnuv3_is_vtable_name(), gnuv3_rtti_type(), goto_bookmark_command(), handle_exception(), handle_line_of_input(), handle_notification(), handle_output_debug_string(), i386_pe_skip_trampoline_code(), i386_skip_prologue(), i386obsd_trapframe_cache(), i386obsd_trapframe_sniffer(), initialize_current_architecture(), interrupt_command(), is_ada_operator(), is_import_fixup_symbol(), is_target_filename(), is_type_conversion_operator(), is_vtable_name(), lesseq_defined_than(), linespec_lexer_lex_string(), linux_proc_pending_signals(), linux_proc_pid_get_state(), locate_arg(), m2_record_fields(), macho_symfile_offsets(), maint_print_c_tdesc_cmd(), make_output_phdrs(), mips_find_abi_section(), mips_find_long_section(), mips_in_frame_stub(), mips_sde_elf_osabi_sniff_abi_tag_sections(), mips_skip_mips16_trampoline_code(), mips_skip_pic_trampoline_code(), mips_stub_frame_sniffer(), msp430_in_return_stub(), nbsd_pc_in_sigtramp(), net_open(), new_symbol_full(), old_renaming_is_invisible(), operator_chars(), parse_tracepoint_definition(), pascal_type_print_base(), pascal_type_print_method_args(), ppc_linux_spu_section(), process_next_line(), process_structure_scope(), producer_is_gcc(), producer_is_icc(), producer_is_realview(), read_base_type(), read_ofile_symtab(), minimal_symbol_reader::record_full(), remote_check_symbols(), remote_get_noisy_reply(), remote_parse_stop_reply(), remote_serial_open(), remote_vcont_probe(), restore_command(), rs6000_in_solib_return_trampoline(), scan_xcoff_symtab(), search_struct_method(), serial_open(), skip_abi_tag(), skip_prologue_function(), sparc32nbsd_sigcontext_frame_sniffer(), sparc64nbsd_sigtramp_frame_sniffer(), strace_command(), subset_compare(), tfile_interp_line(), tfile_open(), tui_partial_win_by_name(), typy_lookup_typename(), tyscm_lookup_typename(), unpack_mangled_go_symbol(), value_struct_elt_for_reference(), and watch_command_1().

## ◆ string_appendf()

char char int std::string std::string void string_appendf | ( | std::string & | dest,
|  | const char * | fmt,
|  |  | ...
| ) |  |

## ◆ string_printf()

char char int std::string string_printf | ( | const char * | fmt,
|  |  | ...
| ) |  |

## ◆ string_vappendf()

char char int std::string std::string void void string_vappendf | ( | std::string & | dest,
|  | const char * | fmt,
|  | va_list | args
| ) |  |

## ◆ string_vprintf()

char char int std::string std::string string_vprintf | ( | const char * | fmt,
|  | va_list | args
| ) |  |

## ◆ stringify_argv()

std::string stringify_argv | ( | const std::vector< char *> & | argv | ) |

Definition at line 392 of file common-utils.c.

References string.

## ◆ strtoulst()

ULONGEST strtoulst | ( | const char * | num,
|  | const char ** | trailer,
|  | int | base
| ) |  |

Definition at line 266 of file common-utils.c.

References digit_to_int(), HIGH_BYTE_POSN, and is_digit_in_base().

Referenced by generic_load(), get_insn_number(), info_spu_event_command(), info_spu_signal_command(), linux_info_proc(), linux_vsyscall_range_raw(), read_mapping(), read_maps_entry(), spu_pseudo_register_read_spu(), spu_symbol_file_add_from_memory(), spu_xfer_partial(), trace_pass_command(), and xml_parse_unsigned_integer().

## ◆ xfree()

template<typename T >

static void xfree | ( | T * | ptr | ) |
| static

Definition at line 54 of file common-utils.h.

References free().

## ◆ xsnprintf()

char char int xsnprintf | ( | char * | str,
|  | size_t | size,
|  | const char * | format,
|  |  | ...
| ) |  |

## ◆ xstrprintf()

char* xstrprintf | ( | const char * | format,
|  |  | ...
| ) |  |

## ◆ xstrvprintf()

char char* xstrvprintf | ( | const char * | format,
|  | va_list | ap
| ) |  |

## ◆ xzalloc()

void* xzalloc | ( | size_t |  | ) |

Definition at line 92 of file common-utils.c.

References size, and xcalloc().

Referenced by allocate_value_contents(), new_bvect(), replace_operator_with_call(), and solib_target_relocate_section_addresses().