evaluated. ADDR_STACK is a context (location of a variable) and
might be needed to evaluate the location expression.
- PUSH_INITIAL_VALUE is true if the first address from ADDR_STACK, should
- be pushed on the DWARF expression evaluation stack before evaluating the
- expression; this is required by certain forms of DWARF expression. When
- PUSH_INITIAL_VALUE is true ADDR_STACK can't be nullptr.
+ PUSH_VALUES is an array of values to be pushed to the expression stack
+ before evaluation starts. PUSH_VALUES[0] is pushed first, then
+ PUSH_VALUES[1], and so on.
Returns 1 on success, 0 otherwise. */
struct frame_info *frame,
const struct property_addr_info *addr_stack,
CORE_ADDR *valp,
- bool push_initial_value,
+ gdb::array_view<CORE_ADDR> push_values,
bool *is_reference)
{
if (dlbaton == NULL || dlbaton->size == 0)
value *result;
scoped_value_mark free_values;
- if (push_initial_value)
- {
- gdb_assert (addr_stack != nullptr);
- ctx.push_address (addr_stack->addr, false);
- }
+ /* Place any initial values onto the expression stack. */
+ for (const auto &val : push_values)
+ ctx.push_address (val, false);
try
{
struct frame_info *frame,
const struct property_addr_info *addr_stack,
CORE_ADDR *value,
- bool push_initial_value)
+ gdb::array_view<CORE_ADDR> push_values)
{
if (prop == NULL)
return false;
bool is_reference = baton->locexpr.is_reference;
if (dwarf2_locexpr_baton_eval (&baton->locexpr, frame, addr_stack,
- value, push_initial_value, &is_reference))
+ value, push_values, &is_reference))
{
if (is_reference)
{
Returns true if PROP could be converted and the static value is passed
back into VALUE, otherwise returns false.
- If PUSH_INITIAL_VALUE is true, then the top value of ADDR_STACK
- will be pushed before evaluating a location expression. */
+ Any values in PUSH_VALUES will be pushed before evaluating the location
+ expression, PUSH_VALUES[0] will be pushed first, then PUSH_VALUES[1],
+ etc. This means the during evaluation PUSH_VALUES[0] will be at the
+ bottom of the stack. */
bool dwarf2_evaluate_property (const struct dynamic_prop *prop,
struct frame_info *frame,
const struct property_addr_info *addr_stack,
CORE_ADDR *value,
- bool push_initial_value = false);
+ gdb::array_view<CORE_ADDR> push_values = {});
/* A helper for the compiler interface that compiles a single dynamic
property to C code.