/* DWARF 2 location expression support for GDB.
- Copyright (C) 2003, 2005, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2007-2012 Free Software Foundation, Inc.
Contributed by Daniel Jacobowitz, MontaVista Software, Inc.
/* An end-of-list entry. */
if (low == 0 && high == 0)
- return NULL;
+ {
+ *locexpr_length = 0;
+ return NULL;
+ }
/* Otherwise, a location expression entry. */
low += base_address;
const gdb_byte **start, size_t *length)
{
if (SYMBOL_LOCATION_BATON (framefunc) == NULL)
- *start = NULL;
+ *length = 0;
else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_loclist_funcs)
{
struct dwarf2_loclist_baton *symbaton;
*start = symbaton->data;
}
else
- *start = NULL;
+ *length = 0;
}
- if (*start == NULL)
+ if (*length == 0)
error (_("Could not find the frame base for \"%s\"."),
SYMBOL_NATURAL_NAME (framefunc));
}
return sym;
}
-/* Define VEC (CORE_ADDR) functions. */
-DEF_VEC_I (CORE_ADDR);
-
/* Verify function with entry point exact address ADDR can never call itself
via its tail calls (incl. transitively). Throw NO_ENTRY_VALUE_ERROR if it
can call itself via tail calls.
struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
- if (dlbaton->data == NULL || dlbaton->size == 0)
+ if (dlbaton->size == 0)
value->optimized_out = 1;
else
dwarf2_compile_expr_to_ax (ax, value, gdbarch, addr_size,
CORE_ADDR pc = frame ? get_frame_address_in_block (frame) : 0;
data = dwarf2_find_location_expression (dlbaton, &size, pc);
- if (data == NULL)
- val = allocate_optimized_out_value (SYMBOL_TYPE (symbol));
- else
- val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, data, size,
- dlbaton->per_cu);
+ val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, data, size,
+ dlbaton->per_cu);
return val;
}
unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
data = dwarf2_find_location_expression (dlbaton, &size, ax->scope);
- if (data == NULL || size == 0)
+ if (size == 0)
value->optimized_out = 1;
else
dwarf2_compile_expr_to_ax (ax, value, gdbarch, addr_size, data, data + size,