/* Definitions for values of C expressions, for GDB.
- Copyright (C) 1986-2022 Free Software Foundation, Inc.
+ Copyright (C) 1986-2023 Free Software Foundation, Inc.
This file is part of GDB.
const struct value *val2, LONGEST offset2,
LONGEST length);
+/* An overload of value_contents_eq that compares the entirety of both
+ values. */
+
+extern bool value_contents_eq (const struct value *val1,
+ const struct value *val2);
+
/* Read LENGTH addressable memory units starting at MEMADDR into BUFFER,
which is (or will be copied to) VAL's contents buffer offset by
BIT_OFFSET bits. Marks value contents ranges as unavailable if
#include "gdbtypes.h"
#include "expression.h"
-struct frame_info;
+class frame_info_ptr;
struct fn_field;
extern int print_address_demangle (const struct value_print_options *,
extern struct value *value_from_component (struct value *, struct type *,
LONGEST);
+
+/* Create a new value by extracting it from WHOLE. TYPE is the type
+ of the new value. BIT_OFFSET and BIT_LENGTH describe the offset
+ and field width of the value to extract from WHOLE -- BIT_LENGTH
+ may differ from TYPE's length in the case where WHOLE's type is
+ packed.
+
+ When the value does come from a non-byte-aligned offset or field
+ width, it will be marked non_lval. */
+
+extern struct value *value_from_component_bitsize (struct value *whole,
+ struct type *type,
+ LONGEST bit_offset,
+ LONGEST bit_length);
+
extern struct value *value_at (struct type *type, CORE_ADDR addr);
extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
+/* Like value_at, but ensures that the result is marked not_lval.
+ This can be important if the memory is "volatile". */
+extern struct value *value_at_non_lval (struct type *type, CORE_ADDR addr);
+
extern struct value *value_from_contents_and_address_unresolved
(struct type *, const gdb_byte *, CORE_ADDR);
extern struct value *value_from_contents_and_address (struct type *,
struct frame_id frame_id);
extern void read_frame_register_value (struct value *value,
- struct frame_info *frame);
+ frame_info_ptr frame);
extern struct value *value_from_register (struct type *type, int regnum,
- struct frame_info *frame);
+ frame_info_ptr frame);
extern CORE_ADDR address_from_register (int regnum,
- struct frame_info *frame);
+ frame_info_ptr frame);
extern struct value *value_of_variable (struct symbol *var,
const struct block *b);
extern struct value *address_of_variable (struct symbol *var,
const struct block *b);
-extern struct value *value_of_register (int regnum, struct frame_info *frame);
+extern struct value *value_of_register (int regnum, frame_info_ptr frame);
-struct value *value_of_register_lazy (struct frame_info *frame, int regnum);
+struct value *value_of_register_lazy (frame_info_ptr frame, int regnum);
/* Return the symbol's reading requirement. */
extern struct value *read_var_value (struct symbol *var,
const struct block *var_block,
- struct frame_info *frame);
+ frame_info_ptr frame);
extern struct value *allocate_value (struct type *type);
extern struct value *allocate_value_lazy (struct type *type);
extern void print_variable_and_value (const char *name,
struct symbol *var,
- struct frame_info *frame,
+ frame_info_ptr frame,
struct ui_file *stream,
int indent);