Cleanup of the dwarf_expr_context constructor

Move the initial values for dwarf_expr_context class data members
to the class declaration in expr.h.

gdb/ChangeLog:

        * dwarf2/expr.c (dwarf_expr_context::dwarf_expr_context):
        Remove initial data members values.
        * dwarf2/expr.h (dwarf_expr_context): Add initial values
        to the class data members.
This commit is contained in:
Zoran Zaric 2021-02-26 10:14:53 +00:00 committed by Zoran Zaric
parent 183657edcd
commit fb4cdecb7e
2 changed files with 9 additions and 18 deletions

View file

@ -90,16 +90,7 @@ dwarf_expr_context::address_type () const
/* Create a new context for the expression evaluator. */
dwarf_expr_context::dwarf_expr_context (dwarf2_per_objfile *per_objfile)
: gdbarch (NULL),
addr_size (0),
ref_addr_size (0),
recursion_depth (0),
max_recursion_depth (0x100),
location (DWARF_VALUE_MEMORY),
len (0),
data (NULL),
initialized (0),
per_objfile (per_objfile)
: per_objfile (per_objfile)
{
}

View file

@ -132,32 +132,32 @@ struct dwarf_expr_context
std::vector<dwarf_stack_value> stack;
/* Target architecture to use for address operations. */
struct gdbarch *gdbarch;
struct gdbarch *gdbarch = nullptr;
/* Target address size in bytes. */
int addr_size;
int addr_size = 0;
/* DW_FORM_ref_addr size in bytes. If -1 DWARF is executed from a frame
context and operations depending on DW_FORM_ref_addr are not allowed. */
int ref_addr_size;
int ref_addr_size = 0;
/* The current depth of dwarf expression recursion, via DW_OP_call*,
DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum
depth we'll tolerate before raising an error. */
int recursion_depth, max_recursion_depth;
int recursion_depth = 0, max_recursion_depth = 0x100;
/* Location of the value. */
enum dwarf_value_location location;
dwarf_value_location location = DWARF_VALUE_MEMORY;
/* For DWARF_VALUE_LITERAL, the current literal value's length and
data. For DWARF_VALUE_IMPLICIT_POINTER, LEN is the offset of the
target DIE of sect_offset kind. */
ULONGEST len;
const gdb_byte *data;
ULONGEST len = 0;
const gdb_byte *data = nullptr;
/* Initialization status of variable: Non-zero if variable has been
initialized; zero otherwise. */
int initialized;
int initialized = 0;
/* A vector of pieces.