X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fvalue.h;h=6dee80af339b1abd1e7a65fe35172d64ec41f892;hb=6a2c1b8790e58ce0688507b5b1f8369aa621a665;hp=440bc2dda9f2ea80192296266c057914aadcabf5;hpb=2f408ecb929bd56613e94cf1e84ace4692c78257;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/value.h b/gdb/value.h index 440bc2dda9..6dee80af33 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1,6 +1,6 @@ /* Definitions for values of C expressions, for GDB. - Copyright (C) 1986-2016 Free Software Foundation, Inc. + Copyright (C) 1986-2017 Free Software Foundation, Inc. This file is part of GDB. @@ -434,13 +434,21 @@ extern void set_value_address (struct value *, CORE_ADDR); extern struct internalvar **deprecated_value_internalvar_hack (struct value *); #define VALUE_INTERNALVAR(val) (*deprecated_value_internalvar_hack (val)) -/* Frame register value is relative to. This will be described in the - lval enum above as "lval_register". */ -extern struct frame_id *deprecated_value_frame_id_hack (struct value *); -#define VALUE_FRAME_ID(val) (*deprecated_value_frame_id_hack (val)) +/* Frame ID of "next" frame to which a register value is relative. A + register value is indicated by VALUE_LVAL being set to lval_register. + So, if the register value is found relative to frame F, then the + frame id of F->next will be stored in VALUE_NEXT_FRAME_ID. */ +extern struct frame_id *deprecated_value_next_frame_id_hack (struct value *); +#define VALUE_NEXT_FRAME_ID(val) (*deprecated_value_next_frame_id_hack (val)) + +/* Frame ID of frame to which a register value is relative. This is + similar to VALUE_NEXT_FRAME_ID, above, but may not be assigned to. + Note that VALUE_FRAME_ID effectively undoes the "next" operation + that was performed during the assignment to VALUE_NEXT_FRAME_ID. */ +#define VALUE_FRAME_ID(val) (get_prev_frame_id_by_id (VALUE_NEXT_FRAME_ID (val))) /* Register number if the value is from a register. */ -extern short *deprecated_value_regnum_hack (struct value *); +extern int *deprecated_value_regnum_hack (struct value *); #define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val)) /* Return value after lval_funcs->coerce_ref (after check_typedef). Return @@ -573,12 +581,11 @@ extern int value_contents_eq (const struct value *val1, LONGEST offset1, /* Read LENGTH addressable memory units starting at MEMADDR into BUFFER, which is (or will be copied to) VAL's contents buffer offset by - EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]). - Marks value contents ranges as unavailable if the corresponding - memory is likewise unavailable. STACK indicates whether the memory - is known to be stack memory. */ + BIT_OFFSET bits. Marks value contents ranges as unavailable if + the corresponding memory is likewise unavailable. STACK indicates + whether the memory is known to be stack memory. */ -extern void read_value_memory (struct value *val, LONGEST embedded_offset, +extern void read_value_memory (struct value *val, LONGEST bit_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length); @@ -637,6 +644,8 @@ extern struct value *value_from_double (struct type *type, DOUBLEST num); extern struct value *value_from_decfloat (struct type *type, const gdb_byte *decbytes); extern struct value *value_from_history_ref (const char *, const char **); +extern struct value *value_from_component (struct value *, struct type *, + LONGEST); extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); @@ -704,6 +713,38 @@ extern struct value *value_mark (void); extern void value_free_to_mark (const struct value *mark); +/* A helper class that uses value_mark at construction time and calls + value_free_to_mark in the destructor. This is used to clear out + temporary values created during the lifetime of this object. */ +class scoped_value_mark +{ + public: + + scoped_value_mark () + : m_value (value_mark ()) + { + } + + ~scoped_value_mark () + { + free_to_mark (); + } + + /* Free the values currently on the value stack. */ + void free_to_mark () + { + if (m_value != NULL) + { + value_free_to_mark (m_value); + m_value = NULL; + } + } + + private: + + const struct value *m_value; +}; + extern struct value *value_cstring (const char *ptr, ssize_t len, struct type *char_type); extern struct value *value_string (const char *ptr, ssize_t len, @@ -733,7 +774,7 @@ extern struct value *value_ind (struct value *arg1); extern struct value *value_addr (struct value *arg1); -extern struct value *value_ref (struct value *arg1); +extern struct value *value_ref (struct value *arg1, enum type_code refcode); extern struct value *value_assign (struct value *toval, struct value *fromval); @@ -886,7 +927,8 @@ extern struct internalvar *lookup_only_internalvar (const char *name); extern struct internalvar *create_internalvar (const char *name); -extern VEC (char_ptr) *complete_internalvar (const char *name); +extern void complete_internalvar (completion_tracker &tracker, + const char *name); /* An internalvar can be dynamically computed by supplying a vector of function pointers to perform various operations. */ @@ -1016,10 +1058,10 @@ extern void value_print_array_elements (struct value *val, extern struct value *value_release_to_mark (const struct value *mark); -extern void val_print (struct type *type, const gdb_byte *valaddr, +extern void val_print (struct type *type, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, + struct value *val, const struct value_print_options *options, const struct language_defn *language);