GDBserver

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().

Referenced by handle_v_run().

## ◆ 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.

## ◆ safe_strerror()

char* safe_strerror | ( | int |  | ) |

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

References strerror(), and xsnprintf().

Referenced by fork_inferior(), linux_ptrace_attach_fail_reason_string(), linux_ptrace_test_ret_to_nx(), maybe_disable_address_space_randomization::maybe_disable_address_space_randomization(), trace_start_error_with_name(), 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_tracepoint_action().

## ◆ skip_spaces() [1/2]

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

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

Referenced by parse_proc_status_state().

## ◆ 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 skip_to_space().

## ◆ startswith()

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

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

Referenced by captured_main(), cmd_qtframe(), cmd_qtnotes(), cmd_qtstatus(), handle_btrace_conf_general_set(), handle_btrace_general_set(), handle_general_set(), handle_monitor_command(), handle_notif_ack(), handle_output_debug_string(), handle_query(), handle_qxfer(), handle_tracepoint_general_set(), handle_tracepoint_query(), handle_v_requests(), handle_vFile(), hex_or_minus_one(), linux_proc_pid_get_state(), linux_qxfer_libraries_svr4(), look_up_one_symbol(), process_point_options(), relocate_instruction(), tracepoint_send_agent(), and x86_linux_process_qsupported().

## ◆ 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.

Referenced by linux_create_inferior(), lynx_create_inferior(), nto_create_inferior(), spu_create_inferior(), and win32_create_inferior().

## ◆ strtoulst()

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

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

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

## ◆ xfree()

template<typename T >

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

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

References free().

Referenced by aarch64_linux_delete_process(), aarch64_linux_delete_thread(), agent_mem_read_string(), append_insns(), arm_delete_process(), arm_delete_thread(), ATTRIBUTE_PRINTF(), btrace_data_append(), btrace_data_fini(), buffer_free(), catcher_pop(), gdb_environ::clear(), cmd_qtnotes(), command_from_pid(), commandline_from_pid(), discard_my_cleanups(), do_my_cleanups(), free_char_ptr_vec(), free_vector_argv(), gdb_event_xfree(), handle_general_set(), handle_monitor_command(), handle_notif_ack(), handle_v_run(), linux_common_core_of_thread(), linux_grandchild_function(), linux_ptrace_attach_fail_reason_string(), linux_qxfer_libraries_svr4(), linux_xfer_osdata_fds(), linux_xfer_osdata_processes(), linux_xfer_osdata_processgroups(), linux_xfer_osdata_threads(), make_cleanup_close(), mips_linux_delete_process(), mips_linux_delete_thread(), notif_event_xfree(), gdb::xfree_deleter< T >::operator()(), gdb::xfree_deleter< T[]>::operator()(), prepare_resume_reply(), pull_pid_from_list(), remove_tracepoint(), set_inferior_cwd(), set_raw_breakpoint_at(), startup_inferior(), gdb_environ::unset(), x86_linux_delete_process(), x86_linux_delete_thread(), and target_desc::~target_desc().

## ◆ 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 xcalloc().