Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
value.c File Reference
#include <glib.h>
#include "glib_wrapper.h"
#include "target_api.h"
#include "target.h"
#include "memcache.h"
#include "dwdebug.h"
#include "dwdebug_priv.h"
Include dependency graph for value.c:

Go to the source code of this file.

Macros

#define Lsnprintf(...)
 
#define VSBP(msg)
 
#define VSBPA(msg,...)
 

Functions

int value_set_addr (struct value *value, ADDR addr)
 
int value_set_mmap (struct value *value, ADDR addr, struct memcache_mmap_entry *mme, char *offset_ptr)
 
int value_set_reg (struct value *value, REG reg)
 
int value_set_child (struct value *value, struct value *parent_value, ADDR addr)
 
void value_set_strlen (struct value *value, int len)
 
void value_set_const (struct value *value)
 
struct valuevalue_create_raw (struct target *target, struct target_thread *tthread, struct memrange *range, int len)
 
struct valuevalue_create_type (struct target_thread *thread, struct memrange *range, struct symbol *type)
 
struct valuevalue_create (struct target_thread *thread, struct memrange *range, struct lsymbol *lsymbol, struct symbol *type)
 
struct valuevalue_create_noalloc (struct target_thread *thread, struct memrange *range, struct lsymbol *lsymbol, struct symbol *type)
 
struct valuevalue_clone (struct value *in)
 
struct valuevalue_reload_as_type (struct value *in, struct symbol *type, int force)
 
void value_free (struct value *value)
 
ADDR value_addr (struct value *value)
 
int value_refresh (struct value *value, int recursive)
 
int value_refresh_diff (struct value *value, int recurse, value_diff_t *vdiff, char **old_buf, int *old_bufsiz, value_hash_t *old_vhash)
 
signed char v_c (struct value *v)
 
unsigned char v_uc (struct value *v)
 
wchar_t v_wc (struct value *v)
 
uint8_t v_u8 (struct value *v)
 
uint16_t v_u16 (struct value *v)
 
uint32_t v_u32 (struct value *v)
 
uint64_t v_u64 (struct value *v)
 
int8_t v_i8 (struct value *v)
 
int16_t v_i16 (struct value *v)
 
int32_t v_i32 (struct value *v)
 
int64_t v_i64 (struct value *v)
 
num_t v_num (struct value *v)
 
unum_t v_unum (struct value *v)
 
float v_f (struct value *v)
 
double v_d (struct value *v)
 
long double v_dd (struct value *v)
 
ADDR v_addr (struct value *v)
 
char * v_string (struct value *v)
 
int value_update (struct value *value, const char *buf, int bufsiz)
 
int value_update_zero (struct value *value, const char *buf, int bufsiz)
 
int value_update_c (struct value *value, signed char v)
 
int value_update_uc (struct value *value, unsigned char v)
 
int value_update_wc (struct value *value, wchar_t v)
 
int value_update_u8 (struct value *value, uint8_t v)
 
int value_update_u16 (struct value *value, uint16_t v)
 
int value_update_u32 (struct value *value, uint32_t v)
 
int value_update_u64 (struct value *value, uint64_t v)
 
int value_update_i8 (struct value *value, int8_t v)
 
int value_update_i16 (struct value *value, int16_t v)
 
int value_update_i32 (struct value *value, int32_t v)
 
int value_update_i64 (struct value *value, int64_t v)
 
int value_update_f (struct value *value, float v)
 
int value_update_d (struct value *value, double v)
 
int value_update_dd (struct value *value, long double v)
 
int value_update_addr (struct value *value, ADDR v)
 
int value_update_num (struct value *value, num_t v)
 
int value_update_unum (struct value *value, unum_t v)
 
int value_snprintf (struct value *value, char *buf, int buflen)
 
void __value_dump (struct value *value, struct dump_info *ud)
 
void value_dump_simple (struct value *value, struct dump_info *ud)
 
void value_dump (struct value *value, struct dump_info *ud)
 
signed char rv_c (void *buf)
 
unsigned char rv_uc (void *buf)
 
wchar_t rv_wc (void *buf)
 
uint8_t rv_u8 (void *buf)
 
uint16_t rv_u16 (void *buf)
 
uint32_t rv_u32 (void *buf)
 
uint64_t rv_u64 (void *buf)
 
int8_t rv_i8 (void *buf)
 
int16_t rv_i16 (void *buf)
 
int32_t rv_i32 (void *buf)
 
int64_t rv_i64 (void *buf)
 
float rv_f (void *buf)
 
double rv_d (void *buf)
 
long double rv_dd (void *buf)
 
ADDR rv_addr (void *buf)
 

Macro Definition Documentation

#define Lsnprintf (   ...)
Value:
snprintf((buf != NULL) ? buf + nrc : NULL,(buflen != 0) ? buflen - nrc : 0, \
## __VA_ARGS__)
char * buf
Definition: target_api.h:3298
#define VSBP (   msg)
Value:
do { \
int _trc = 0; \
_trc = snprintf((buf != NULL) ? buf + nrc : NULL, \
(buflen != 0) ? buflen - nrc : 0, \
"<"msg"::"); \
if (_trc < 0) \
return -1; \
nrc += _trc; \
_trc = ((value->bufsiz * 2) > (buflen - nrc - 1)) \
? (buflen - nrc - 1) / 2 : value->bufsiz; \
__d2hs(value->buf,_trc,buf + nrc); \
nrc += _trc * 2; \
if (nrc < (buflen - 1)) { \
buf[nrc++] = '>'; \
buf[nrc++] = '\0'; \
} \
else if (nrc < buflen) \
buf[nrc++] = '\0'; \
else \
buf[buflen - 1] = '\0'; \
} \
while (0)
int bufsiz
Definition: target_api.h:3297
char * buf
Definition: target_api.h:3298
#define VSBPA (   msg,
  ... 
)
Value:
do { \
int _trc = 0; \
_trc = snprintf((buf != NULL) ? buf + nrc : NULL, \
(buflen != 0) ? buflen - nrc : 0, \
"<"msg"::", ## __VA_ARGS__); \
if (_trc < 0) \
return -1; \
nrc += _trc; \
_trc = ((value->bufsiz * 2) > (buflen - nrc - 1)) \
? (buflen - nrc - 1) / 2 : value->bufsiz; \
__d2hs(value->buf,_trc,buf + nrc); \
nrc += _trc * 2; \
if (nrc < (buflen - 1)) { \
buf[nrc++] = '>'; \
buf[nrc++] = '\0'; \
} \
else if (nrc < buflen) \
buf[nrc++] = '\0'; \
else \
buf[buflen - 1] = '\0'; \
} \
while (0)
int bufsiz
Definition: target_api.h:3297
char * buf
Definition: target_api.h:3298

Function Documentation

void __value_dump ( struct value value,
struct dump_info ud 
)

Definition at line 992 of file value.c.

ADDR rv_addr ( void *  buf)

Definition at line 1350 of file value.c.

signed char rv_c ( void *  buf)

Quick raw value converters

Definition at line 1336 of file value.c.

double rv_d ( void *  buf)

Definition at line 1348 of file value.c.

long double rv_dd ( void *  buf)

Definition at line 1349 of file value.c.

float rv_f ( void *  buf)

Definition at line 1347 of file value.c.

int16_t rv_i16 ( void *  buf)

Definition at line 1344 of file value.c.

int32_t rv_i32 ( void *  buf)

Definition at line 1345 of file value.c.

int64_t rv_i64 ( void *  buf)

Definition at line 1346 of file value.c.

int8_t rv_i8 ( void *  buf)

Definition at line 1343 of file value.c.

uint16_t rv_u16 ( void *  buf)

Definition at line 1340 of file value.c.

uint32_t rv_u32 ( void *  buf)

Definition at line 1341 of file value.c.

uint64_t rv_u64 ( void *  buf)

Definition at line 1342 of file value.c.

uint8_t rv_u8 ( void *  buf)

Definition at line 1339 of file value.c.

unsigned char rv_uc ( void *  buf)

Definition at line 1337 of file value.c.

wchar_t rv_wc ( void *  buf)

Definition at line 1338 of file value.c.

ADDR v_addr ( struct value v)

Definition at line 429 of file value.c.

signed char v_c ( struct value v)

Quick value converters

Definition at line 385 of file value.c.

double v_d ( struct value v)

Definition at line 427 of file value.c.

long double v_dd ( struct value v)

Definition at line 428 of file value.c.

float v_f ( struct value v)

Definition at line 426 of file value.c.

int16_t v_i16 ( struct value v)

Definition at line 393 of file value.c.

int32_t v_i32 ( struct value v)

Definition at line 394 of file value.c.

int64_t v_i64 ( struct value v)

Definition at line 395 of file value.c.

int8_t v_i8 ( struct value v)

Definition at line 392 of file value.c.

num_t v_num ( struct value v)

Definition at line 396 of file value.c.

char* v_string ( struct value v)

Definition at line 430 of file value.c.

uint16_t v_u16 ( struct value v)

Definition at line 389 of file value.c.

uint32_t v_u32 ( struct value v)

Definition at line 390 of file value.c.

uint64_t v_u64 ( struct value v)

Definition at line 391 of file value.c.

uint8_t v_u8 ( struct value v)

Definition at line 388 of file value.c.

unsigned char v_uc ( struct value v)

Definition at line 386 of file value.c.

unum_t v_unum ( struct value v)

Definition at line 411 of file value.c.

wchar_t v_wc ( struct value v)

Definition at line 387 of file value.c.

ADDR value_addr ( struct value value)

Definition at line 302 of file value.c.

struct value* value_clone ( struct value in)

Value functions.

Definition at line 195 of file value.c.

struct value* value_create ( struct target_thread thread,
struct memrange range,
struct lsymbol lsymbol,
struct symbol type 
)

Definition at line 138 of file value.c.

struct value* value_create_noalloc ( struct target_thread thread,
struct memrange range,
struct lsymbol lsymbol,
struct symbol type 
)

Definition at line 153 of file value.c.

struct value* value_create_raw ( struct target target,
struct target_thread thread,
struct memrange range,
int  len 
)

Value loading functions.

Definition at line 77 of file value.c.

struct value* value_create_type ( struct target_thread thread,
struct memrange range,
struct symbol type 
)

Definition at line 102 of file value.c.

void value_dump ( struct value value,
struct dump_info ud 
)

Definition at line 1294 of file value.c.

void value_dump_simple ( struct value value,
struct dump_info ud 
)

Definition at line 1289 of file value.c.

void value_free ( struct value value)

Definition at line 282 of file value.c.

int value_refresh ( struct value value,
int  recursive 
)

Definition at line 329 of file value.c.

int value_refresh_diff ( struct value value,
int  recurse,
value_diff_t vdiff,
char **  old_buf,
int *  old_bufsiz,
value_hash_t old_vhash 
)

Definition at line 378 of file value.c.

struct value* value_reload_as_type ( struct value in,
struct symbol type,
int  force 
)

Definition at line 224 of file value.c.

int value_set_addr ( struct value value,
ADDR  addr 
)

Definition at line 28 of file value.c.

int value_set_child ( struct value value,
struct value parent_value,
ADDR  addr 
)

Definition at line 53 of file value.c.

void value_set_const ( struct value value)

Definition at line 73 of file value.c.

int value_set_mmap ( struct value value,
ADDR  addr,
struct memcache_mmap_entry mme,
char *  offset_ptr 
)

Definition at line 35 of file value.c.

int value_set_reg ( struct value value,
REG  reg 
)

Definition at line 45 of file value.c.

void value_set_strlen ( struct value value,
int  len 
)

Definition at line 68 of file value.c.

int value_snprintf ( struct value value,
char *  buf,
int  buflen 
)

Definition at line 639 of file value.c.

int value_update ( struct value value,
const char *  buf,
int  bufsiz 
)

Value update functions.

Definition at line 432 of file value.c.

int value_update_addr ( struct value value,
ADDR  v 
)

Definition at line 577 of file value.c.

int value_update_c ( struct value value,
signed char  v 
)

Definition at line 465 of file value.c.

int value_update_d ( struct value value,
double  v 
)

Definition at line 561 of file value.c.

int value_update_dd ( struct value value,
long double  v 
)

Definition at line 569 of file value.c.

int value_update_f ( struct value value,
float  v 
)

Definition at line 553 of file value.c.

int value_update_i16 ( struct value value,
int16_t  v 
)

Definition at line 529 of file value.c.

int value_update_i32 ( struct value value,
int32_t  v 
)

Definition at line 537 of file value.c.

int value_update_i64 ( struct value value,
int64_t  v 
)

Definition at line 545 of file value.c.

int value_update_i8 ( struct value value,
int8_t  v 
)

Definition at line 521 of file value.c.

int value_update_num ( struct value value,
num_t  v 
)

Definition at line 586 of file value.c.

int value_update_u16 ( struct value value,
uint16_t  v 
)

Definition at line 497 of file value.c.

int value_update_u32 ( struct value value,
uint32_t  v 
)

Definition at line 505 of file value.c.

int value_update_u64 ( struct value value,
uint64_t  v 
)

Definition at line 513 of file value.c.

int value_update_u8 ( struct value value,
uint8_t  v 
)

Definition at line 489 of file value.c.

int value_update_uc ( struct value value,
unsigned char  v 
)

Definition at line 473 of file value.c.

int value_update_unum ( struct value value,
unum_t  v 
)

Definition at line 601 of file value.c.

int value_update_wc ( struct value value,
wchar_t  v 
)

Definition at line 481 of file value.c.

int value_update_zero ( struct value value,
const char *  buf,
int  bufsiz 
)

Definition at line 447 of file value.c.