GDB (API)
Defines | Typedefs | Functions
/home/stan/gdb/src/gdb/value.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "gdb_string.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "gdbcore.h"
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
#include "language.h"
#include "demangle.h"
#include "doublest.h"
#include "gdb_assert.h"
#include "regcache.h"
#include "block.h"
#include "dfp.h"
#include "objfiles.h"
#include "valprint.h"
#include "cli/cli-decode.h"
#include "exceptions.h"
#include "python/python.h"
#include <ctype.h>
#include "tracepoint.h"
#include "cp-abi.h"
#include "user-regs.h"

Go to the source code of this file.

Defines

#define VALUE_HISTORY_CHUNK   60

Typedefs

typedef struct range range_s

Functions

void _initialize_values (void)
 DEF_VEC_O (range_s)
int value_bytes_available (const struct value *value, int offset, int length)
int value_entirely_available (struct value *value)
int value_entirely_unavailable (struct value *value)
void mark_value_bytes_unavailable (struct value *value, int offset, int length)
int value_available_contents_eq (const struct value *val1, int offset1, const struct value *val2, int offset2, int length)
struct value * allocate_value_lazy (struct type *type)
struct value * allocate_value (struct type *type)
struct value * allocate_repeat_value (struct type *type, int count)
struct value * allocate_computed_value (struct type *type, const struct lval_funcs *funcs, void *closure)
struct value * allocate_optimized_out_value (struct type *type)
struct value * value_next (struct value *value)
struct typevalue_type (const struct value *value)
void deprecated_set_value_type (struct value *value, struct type *type)
int value_offset (const struct value *value)
void set_value_offset (struct value *value, int offset)
int value_bitpos (const struct value *value)
void set_value_bitpos (struct value *value, int bit)
int value_bitsize (const struct value *value)
void set_value_bitsize (struct value *value, int bit)
struct value * value_parent (struct value *value)
void set_value_parent (struct value *value, struct value *parent)
gdb_bytevalue_contents_raw (struct value *value)
gdb_bytevalue_contents_all_raw (struct value *value)
struct typevalue_enclosing_type (struct value *value)
struct typevalue_actual_type (struct value *value, int resolve_simple_types, int *real_type_found)
void error_value_optimized_out (void)
const gdb_bytevalue_contents_for_printing (struct value *value)
const gdb_bytevalue_contents_for_printing_const (const struct value *value)
const gdb_bytevalue_contents_all (struct value *value)
void value_contents_copy_raw (struct value *dst, int dst_offset, struct value *src, int src_offset, int length)
void value_contents_copy (struct value *dst, int dst_offset, struct value *src, int src_offset, int length)
int value_lazy (struct value *value)
void set_value_lazy (struct value *value, int val)
int value_stack (struct value *value)
void set_value_stack (struct value *value, int val)
const gdb_bytevalue_contents (struct value *value)
gdb_bytevalue_contents_writeable (struct value *value)
int value_contents_equal (struct value *val1, struct value *val2)
int value_optimized_out (struct value *value)
int value_optimized_out_const (const struct value *value)
void set_value_optimized_out (struct value *value, int val)
int value_entirely_optimized_out (const struct value *value)
int value_bits_valid (const struct value *value, int offset, int length)
int value_bits_synthetic_pointer (const struct value *value, int offset, int length)
int value_embedded_offset (struct value *value)
void set_value_embedded_offset (struct value *value, int val)
int value_pointed_to_offset (struct value *value)
void set_value_pointed_to_offset (struct value *value, int val)
struct lval_funcsvalue_computed_funcs (const struct value *v)
void * value_computed_closure (const struct value *v)
enum lval_typedeprecated_value_lval_hack (struct value *value)
enum lval_type value_lval_const (const struct value *value)
CORE_ADDR value_address (const struct value *value)
CORE_ADDR value_raw_address (struct value *value)
void set_value_address (struct value *value, CORE_ADDR addr)
struct internalvar ** deprecated_value_internalvar_hack (struct value *value)
struct frame_iddeprecated_value_frame_id_hack (struct value *value)
short * deprecated_value_regnum_hack (struct value *value)
int deprecated_value_modifiable (struct value *value)
struct value * value_mark (void)
void value_incref (struct value *val)
void value_free (struct value *val)
void value_free_to_mark (struct value *mark)
void free_all_values (void)
void free_value_chain (struct value *v)
void release_value (struct value *val)
void release_value_or_incref (struct value *val)
struct value * value_release_to_mark (struct value *mark)
struct value * value_copy (struct value *arg)
struct value * value_non_lval (struct value *arg)
void set_value_component_location (struct value *component, const struct value *whole)
int record_latest_value (struct value *val)
struct value * access_value_history (int num)
struct internalvar * lookup_only_internalvar (const char *name)
 VEC (char_ptr)
struct internalvar * create_internalvar (const char *name)
struct internalvar * create_internalvar_type_lazy (const char *name, const struct internalvar_funcs *funcs, void *data)
int compile_internalvar_to_ax (struct internalvar *var, struct agent_expr *expr, struct axs_value *value)
struct internalvar * lookup_internalvar (const char *name)
struct value * value_of_internalvar (struct gdbarch *gdbarch, struct internalvar *var)
int get_internalvar_integer (struct internalvar *var, LONGEST *result)
void set_internalvar_component (struct internalvar *var, int offset, int bitpos, int bitsize, struct value *newval)
void set_internalvar (struct internalvar *var, struct value *val)
void set_internalvar_integer (struct internalvar *var, LONGEST l)
void set_internalvar_string (struct internalvar *var, const char *string)
void clear_internalvar (struct internalvar *var)
char * internalvar_name (struct internalvar *var)
char * value_internal_function_name (struct value *val)
struct value * call_internal_function (struct gdbarch *gdbarch, const struct language_defn *language, struct value *func, int argc, struct value **argv)
void add_internal_function (const char *name, const char *doc, internal_function_fn handler, void *cookie)
void preserve_one_value (struct value *value, struct objfile *objfile, htab_t copied_types)
void preserve_values (struct objfile *objfile)
LONGEST value_as_long (struct value *val)
DOUBLEST value_as_double (struct value *val)
CORE_ADDR value_as_address (struct value *val)
LONGEST unpack_long (struct type *type, const gdb_byte *valaddr)
DOUBLEST unpack_double (struct type *type, const gdb_byte *valaddr, int *invp)
CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr)
struct value * value_static_field (struct type *type, int fieldno)
void set_value_enclosing_type (struct value *val, struct type *new_encl_type)
struct value * value_primitive_field (struct value *arg1, int offset, int fieldno, struct type *arg_type)
struct value * value_field (struct value *arg1, int fieldno)
struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, int offset)
int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, int embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result)
int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, int embedded_offset, int fieldno, const struct value *val, LONGEST *result)
LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno)
struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, int embedded_offset, const struct value *val)
void modify_field (struct type *type, gdb_byte *addr, LONGEST fieldval, int bitpos, int bitsize)
void pack_long (gdb_byte *buf, struct type *type, LONGEST num)
struct value * value_from_longest (struct type *type, LONGEST num)
struct value * value_from_ulongest (struct type *type, ULONGEST num)
struct value * value_from_pointer (struct type *type, CORE_ADDR addr)
struct value * value_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address)
struct value * value_from_contents (struct type *type, const gdb_byte *contents)
struct value * value_from_double (struct type *type, DOUBLEST num)
struct value * value_from_decfloat (struct type *type, const gdb_byte *dec)
struct value * value_from_history_ref (char *h, char **endp)
struct value * coerce_ref_if_computed (const struct value *arg)
struct value * readjust_indirect_value_type (struct value *value, struct type *enc_type, struct type *original_type, struct value *original_value)
struct value * coerce_ref (struct value *arg)
struct value * coerce_array (struct value *arg)
enum return_value_convention struct_return_convention (struct gdbarch *gdbarch, struct value *function, struct type *value_type)
int using_struct_return (struct gdbarch *gdbarch, struct value *function, struct type *value_type)
void set_value_initialized (struct value *val, int status)
int value_initialized (struct value *val)
int value_fetch_lazy (struct value *val)

Define Documentation

#define VALUE_HISTORY_CHUNK   60

Definition at line 649 of file value.c.


Typedef Documentation

typedef struct range range_s

Definition at line 77 of file value.c.


Function Documentation

void _initialize_values ( void  )
struct value* access_value_history ( int  num) [read]

Definition at line 1553 of file value.c.

void add_internal_function ( const char *  name,
const char *  doc,
internal_function_fn  handler,
void *  cookie 
)

Definition at line 2192 of file value.c.

struct value* allocate_computed_value ( struct type type,
const struct lval_funcs funcs,
void *  closure 
) [read]

Definition at line 750 of file value.c.

struct value* allocate_optimized_out_value ( struct type type) [read]

Definition at line 766 of file value.c.

struct value* allocate_repeat_value ( struct type type,
int  count 
) [read]

Definition at line 738 of file value.c.

struct value* allocate_value ( struct type type) [read]

Definition at line 725 of file value.c.

struct value* allocate_value_lazy ( struct type type) [read]

Definition at line 675 of file value.c.

struct value* call_internal_function ( struct gdbarch *  gdbarch,
const struct language_defn language,
struct value *  func,
int  argc,
struct value **  argv 
) [read]

Definition at line 2154 of file value.c.

void clear_internalvar ( struct internalvar *  var)

Definition at line 2096 of file value.c.

struct value* coerce_array ( struct value *  arg) [read]

Definition at line 3366 of file value.c.

struct value* coerce_ref ( struct value *  arg) [read]

Definition at line 3342 of file value.c.

struct value* coerce_ref_if_computed ( const struct value *  arg) [read]

Definition at line 3306 of file value.c.

int compile_internalvar_to_ax ( struct internalvar *  var,
struct agent_expr expr,
struct axs_value value 
)

Definition at line 1827 of file value.c.

struct internalvar* create_internalvar ( const char *  name) [read]

Definition at line 1792 of file value.c.

struct internalvar* create_internalvar_type_lazy ( const char *  name,
const struct internalvar_funcs funcs,
void *  data 
) [read]

Definition at line 1812 of file value.c.

void deprecated_set_value_type ( struct value *  value,
struct type type 
)

Definition at line 789 of file value.c.

struct frame_id* deprecated_value_frame_id_hack ( struct value *  value) [read]

Definition at line 1236 of file value.c.

struct internalvar** deprecated_value_internalvar_hack ( struct value *  value) [read]

Definition at line 1230 of file value.c.

enum lval_type* deprecated_value_lval_hack ( struct value *  value)

Definition at line 1189 of file value.c.

int deprecated_value_modifiable ( struct value *  value)

Definition at line 1248 of file value.c.

short* deprecated_value_regnum_hack ( struct value *  value)

Definition at line 1242 of file value.c.

void error_value_optimized_out ( void  )

Definition at line 911 of file value.c.

void free_all_values ( void  )

Definition at line 1326 of file value.c.

void free_value_chain ( struct value *  v)

Definition at line 1344 of file value.c.

int get_internalvar_integer ( struct internalvar *  var,
LONGEST result 
)

Definition at line 1948 of file value.c.

char* internalvar_name ( struct internalvar *  var)

Definition at line 2123 of file value.c.

struct internalvar* lookup_internalvar ( const char *  name) [read]

Definition at line 1847 of file value.c.

struct internalvar* lookup_only_internalvar ( const char *  name) [read]

Definition at line 1753 of file value.c.

void mark_value_bytes_unavailable ( struct value *  value,
int  offset,
int  length 
)

Definition at line 382 of file value.c.

void modify_field ( struct type type,
gdb_byte addr,
LONGEST  fieldval,
int  bitpos,
int  bitsize 
)

Definition at line 3040 of file value.c.

void pack_long ( gdb_byte buf,
struct type type,
LONGEST  num 
)

Definition at line 3087 of file value.c.

void preserve_one_value ( struct value *  value,
struct objfile objfile,
htab_t  copied_types 
)

Definition at line 2211 of file value.c.

void preserve_values ( struct objfile objfile)

Definition at line 2250 of file value.c.

struct value* readjust_indirect_value_type ( struct value *  value,
struct type enc_type,
struct type original_type,
struct value *  original_value 
) [read]

Definition at line 3326 of file value.c.

int record_latest_value ( struct value *  val)

Definition at line 1511 of file value.c.

void release_value ( struct value *  val)

Definition at line 1359 of file value.c.

void release_value_or_incref ( struct value *  val)

Definition at line 1389 of file value.c.

void set_internalvar ( struct internalvar *  var,
struct value *  val 
)

Definition at line 2011 of file value.c.

void set_internalvar_component ( struct internalvar *  var,
int  offset,
int  bitpos,
int  bitsize,
struct value *  newval 
)

Definition at line 1986 of file value.c.

void set_internalvar_integer ( struct internalvar *  var,
LONGEST  l 
)

Definition at line 2063 of file value.c.

void set_internalvar_string ( struct internalvar *  var,
const char *  string 
)

Definition at line 2074 of file value.c.

void set_value_address ( struct value *  value,
CORE_ADDR  addr 
)

Definition at line 1222 of file value.c.

void set_value_bitpos ( struct value *  value,
int  bit 
)

Definition at line 811 of file value.c.

void set_value_bitsize ( struct value *  value,
int  bit 
)

Definition at line 822 of file value.c.

void set_value_component_location ( struct value *  component,
const struct value *  whole 
)

Definition at line 1484 of file value.c.

void set_value_embedded_offset ( struct value *  value,
int  val 
)

Definition at line 1155 of file value.c.

void set_value_enclosing_type ( struct value *  val,
struct type new_encl_type 
)

Definition at line 2646 of file value.c.

void set_value_initialized ( struct value *  val,
int  status 
)

Definition at line 3424 of file value.c.

void set_value_lazy ( struct value *  value,
int  val 
)

Definition at line 1037 of file value.c.

void set_value_offset ( struct value *  value,
int  offset 
)

Definition at line 800 of file value.c.

void set_value_optimized_out ( struct value *  value,
int  val 
)

Definition at line 1108 of file value.c.

void set_value_parent ( struct value *  value,
struct value *  parent 
)

Definition at line 836 of file value.c.

void set_value_pointed_to_offset ( struct value *  value,
int  val 
)

Definition at line 1167 of file value.c.

void set_value_stack ( struct value *  value,
int  val 
)

Definition at line 1049 of file value.c.

enum return_value_convention struct_return_convention ( struct gdbarch *  gdbarch,
struct value *  function,
struct type value_type 
)

Definition at line 3391 of file value.c.

DOUBLEST unpack_double ( struct type type,
const gdb_byte valaddr,
int invp 
)

Definition at line 2517 of file value.c.

LONGEST unpack_field_as_long ( struct type type,
const gdb_byte valaddr,
int  fieldno 
)

Definition at line 2997 of file value.c.

LONGEST unpack_long ( struct type type,
const gdb_byte valaddr 
)

Definition at line 2467 of file value.c.

CORE_ADDR unpack_pointer ( struct type type,
const gdb_byte valaddr 
)

Definition at line 2584 of file value.c.

int unpack_value_bits_as_long ( struct type field_type,
const gdb_byte valaddr,
int  embedded_offset,
int  bitpos,
int  bitsize,
const struct value *  original_value,
LONGEST result 
)

Definition at line 2944 of file value.c.

int unpack_value_field_as_long ( struct type type,
const gdb_byte valaddr,
int  embedded_offset,
int  fieldno,
const struct value *  val,
LONGEST result 
)

Definition at line 2981 of file value.c.

int using_struct_return ( struct gdbarch *  gdbarch,
struct value *  function,
struct type value_type 
)

Definition at line 3409 of file value.c.

struct type* value_actual_type ( struct value *  value,
int  resolve_simple_types,
int real_type_found 
) [read]

Definition at line 869 of file value.c.

CORE_ADDR value_address ( const struct value *  value)

Definition at line 1201 of file value.c.

CORE_ADDR value_as_address ( struct value *  val)

Definition at line 2349 of file value.c.

DOUBLEST value_as_double ( struct value *  val)

Definition at line 2334 of file value.c.

LONGEST value_as_long ( struct value *  val)

Definition at line 2324 of file value.c.

int value_available_contents_eq ( const struct value *  val1,
int  offset1,
const struct value *  val2,
int  offset2,
int  length 
)

Definition at line 566 of file value.c.

int value_bitpos ( const struct value *  value)

Definition at line 806 of file value.c.

int value_bits_synthetic_pointer ( const struct value *  value,
int  offset,
int  length 
)

Definition at line 1137 of file value.c.

int value_bits_valid ( const struct value *  value,
int  offset,
int  length 
)

Definition at line 1125 of file value.c.

int value_bitsize ( const struct value *  value)

Definition at line 817 of file value.c.

int value_bytes_available ( const struct value *  value,
int  offset,
int  length 
)

Definition at line 341 of file value.c.

void* value_computed_closure ( const struct value *  v)

Definition at line 1181 of file value.c.

struct lval_funcs* value_computed_funcs ( const struct value *  v) [read]

Definition at line 1173 of file value.c.

const gdb_byte* value_contents ( struct value *  value)

Definition at line 1055 of file value.c.

const gdb_byte* value_contents_all ( struct value *  value)

Definition at line 951 of file value.c.

gdb_byte* value_contents_all_raw ( struct value *  value)

Definition at line 854 of file value.c.

void value_contents_copy ( struct value *  dst,
int  dst_offset,
struct value *  src,
int  src_offset,
int  length 
)

Definition at line 1019 of file value.c.

void value_contents_copy_raw ( struct value *  dst,
int  dst_offset,
struct value *  src,
int  src_offset,
int  length 
)

Definition at line 970 of file value.c.

int value_contents_equal ( struct value *  val1,
struct value *  val2 
)

Definition at line 1076 of file value.c.

const gdb_byte* value_contents_for_printing ( struct value *  value)

Definition at line 936 of file value.c.

Definition at line 944 of file value.c.

gdb_byte* value_contents_raw ( struct value *  value)

Definition at line 847 of file value.c.

gdb_byte* value_contents_writeable ( struct value *  value)

Definition at line 1064 of file value.c.

struct value* value_copy ( struct value *  arg) [read]

Definition at line 1423 of file value.c.

int value_embedded_offset ( struct value *  value)

Definition at line 1149 of file value.c.

struct type* value_enclosing_type ( struct value *  value) [read]

Definition at line 861 of file value.c.

int value_entirely_available ( struct value *  value)

Definition at line 349 of file value.c.

int value_entirely_optimized_out ( const struct value *  value)

Definition at line 1114 of file value.c.

int value_entirely_unavailable ( struct value *  value)

Definition at line 362 of file value.c.

int value_fetch_lazy ( struct value *  val)

Definition at line 3452 of file value.c.

struct value* value_field ( struct value *  arg1,
int  fieldno 
) [read]

Definition at line 2791 of file value.c.

struct value* value_field_bitfield ( struct type type,
int  fieldno,
const gdb_byte valaddr,
int  embedded_offset,
const struct value *  val 
) [read]

Definition at line 3012 of file value.c.

struct value* value_fn_field ( struct value **  arg1p,
struct fn_field *  f,
int  j,
struct type type,
int  offset 
) [read]

Definition at line 2804 of file value.c.

void value_free ( struct value *  val)

Definition at line 1276 of file value.c.

void value_free_to_mark ( struct value *  mark)

Definition at line 1307 of file value.c.

struct value* value_from_contents ( struct type type,
const gdb_byte contents 
) [read]

Definition at line 3217 of file value.c.

struct value* value_from_contents_and_address ( struct type type,
const gdb_byte valaddr,
CORE_ADDR  address 
) [read]

Definition at line 3198 of file value.c.

struct value* value_from_decfloat ( struct type type,
const gdb_byte dec 
) [read]

Definition at line 3244 of file value.c.

struct value* value_from_double ( struct type type,
DOUBLEST  num 
) [read]

Definition at line 3227 of file value.c.

struct value* value_from_history_ref ( char *  h,
char **  endp 
) [read]

Definition at line 3257 of file value.c.

struct value* value_from_longest ( struct type type,
LONGEST  num 
) [read]

Definition at line 3159 of file value.c.

struct value* value_from_pointer ( struct type type,
CORE_ADDR  addr 
) [read]

Definition at line 3184 of file value.c.

struct value* value_from_ulongest ( struct type type,
ULONGEST  num 
) [read]

Definition at line 3171 of file value.c.

void value_incref ( struct value *  val)

Definition at line 1266 of file value.c.

int value_initialized ( struct value *  val)

Definition at line 3432 of file value.c.

char* value_internal_function_name ( struct value *  val)

Definition at line 2141 of file value.c.

int value_lazy ( struct value *  value)

Definition at line 1031 of file value.c.

enum lval_type value_lval_const ( const struct value *  value)

Definition at line 1195 of file value.c.

struct value* value_mark ( void  ) [read]

Definition at line 1257 of file value.c.

struct value* value_next ( struct value *  value) [read]

Definition at line 778 of file value.c.

struct value* value_non_lval ( struct value *  arg) [read]

Definition at line 1466 of file value.c.

struct value* value_of_internalvar ( struct gdbarch *  gdbarch,
struct internalvar *  var 
) [read]

Definition at line 1862 of file value.c.

int value_offset ( const struct value *  value)

Definition at line 795 of file value.c.

int value_optimized_out ( struct value *  value)

Definition at line 1091 of file value.c.

int value_optimized_out_const ( const struct value *  value)

Definition at line 1102 of file value.c.

struct value* value_parent ( struct value *  value) [read]

Definition at line 828 of file value.c.

int value_pointed_to_offset ( struct value *  value)

Definition at line 1161 of file value.c.

struct value* value_primitive_field ( struct value *  arg1,
int  offset,
int  fieldno,
struct type arg_type 
) [read]

Definition at line 2661 of file value.c.

CORE_ADDR value_raw_address ( struct value *  value)

Definition at line 1213 of file value.c.

struct value* value_release_to_mark ( struct value *  mark) [read]

Definition at line 1399 of file value.c.

int value_stack ( struct value *  value)

Definition at line 1043 of file value.c.

struct value* value_static_field ( struct type type,
int  fieldno 
) [read]

Definition at line 2597 of file value.c.

struct type* value_type ( const struct value *  value) [read]

Definition at line 784 of file value.c.

VEC ( char_ptr  )

Definition at line 1768 of file value.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines