GDBserver
Macros | Functions
common-utils.c File Reference
#include "common-defs.h"
#include "common-utils.h"
#include "host-defs.h"
#include <ctype.h>

Go to the source code of this file.

Macros

#define HIGH_BYTE_POSN   ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
 

Functions

PTR xmalloc (size_t size)
 
PTR xrealloc (PTR ptr, size_t size)
 
PTR xcalloc (size_t number, size_t size)
 
void * xzalloc (size_t size)
 
void xmalloc_failed (size_t size)
 
char * xstrprintf (const char *format,...)
 
char * xstrvprintf (const char *format, va_list ap)
 
int xsnprintf (char *str, size_t size, const char *format,...)
 
std::string string_printf (const char *fmt,...)
 
std::string string_vprintf (const char *fmt, va_list args)
 
void string_appendf (std::string &str, const char *fmt,...)
 
void string_vappendf (std::string &str, const char *fmt, va_list args)
 
char * savestring (const char *ptr, size_t len)
 
static int is_digit_in_base (unsigned char digit, int base)
 
static int digit_to_int (unsigned char c)
 
ULONGEST strtoulst (const char *num, const char **trailer, int base)
 
char * skip_spaces (char *chp)
 
const char * skip_spaces (const char *chp)
 
const char * skip_to_space (const char *chp)
 
char * skip_to_space (char *chp)
 
void free_vector_argv (std::vector< char *> &v)
 
std::string stringify_argv (const std::vector< char *> &args)
 

Macro Definition Documentation

◆ HIGH_BYTE_POSN

#define HIGH_BYTE_POSN   ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)

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

Referenced by strtoulst().

Function Documentation

◆ digit_to_int()

static int digit_to_int ( unsigned char  c)
static

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

Referenced by strtoulst().

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

◆ is_digit_in_base()

static int is_digit_in_base ( unsigned char  digit,
int  base 
)
static

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

Referenced by strtoulst().

◆ savestring()

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 *  chp)

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 *  chp)

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

◆ skip_to_space() [1/2]

const char* skip_to_space ( const char *  chp)

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

Referenced by skip_to_space().

◆ skip_to_space() [2/2]

char* skip_to_space ( char *  chp)

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

References skip_to_space().

◆ string_appendf()

void string_appendf ( std::string str,
const char *  fmt,
  ... 
)

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

References string_vappendf().

◆ string_printf()

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

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

References string, and vsnprintf().

Referenced by handle_qxfer_libraries().

◆ string_vappendf()

void string_vappendf ( std::string str,
const char *  fmt,
va_list  args 
)

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

References vsnprintf().

Referenced by string_appendf().

◆ string_vprintf()

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

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

References string, and vsnprintf().

◆ stringify_argv()

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

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

◆ xcalloc()

PTR xcalloc ( size_t  number,
size_t  size 
)

◆ xmalloc()

PTR xmalloc ( size_t  size)

◆ xmalloc_failed()

void xmalloc_failed ( size_t  size)

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

References malloc_failure().

◆ xrealloc()

PTR xrealloc ( PTR  ptr,
size_t  size 
)

◆ xsnprintf()

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

◆ xstrprintf()

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

◆ xstrvprintf()

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

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

References _, internal_error(), and vasprintf().

Referenced by ATTRIBUTE_PRINTF(), and xstrprintf().

◆ xzalloc()

void* xzalloc ( size_t  size)

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

References xcalloc().