GDB (API)
Functions
/home/stan/gdb/src/gdb/common/common-utils.c File Reference
#include "defs.h"
#include "gdb_assert.h"
#include "gdb_string.h"
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

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 xfree (void *ptr)
char * xstrprintf (const char *format,...)
char * xstrvprintf (const char *format, va_list ap)
int xsnprintf (char *str, size_t size, const char *format,...)
char * savestring (const char *ptr, size_t len)

Function Documentation

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.

Parameters:
ptrpointer to the string to be copied
lenmaximum 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.

PTR xcalloc ( size_t  number,
size_t  size 
)

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

void xfree ( void *  ptr)

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

PTR xmalloc ( size_t  size)

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

PTR xrealloc ( PTR  ptr,
size_t  size 
)

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

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

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

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

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

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

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

void* xzalloc ( size_t  size)

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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines