aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-14 17:53:16 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-14 17:53:16 +0000
commit9a619af0d3152e742fbd290baeae96a32f0abf04 (patch)
tree6e52a14dd92f9b11874ecc3aa8d83f63f6d6699b /gdb/dwarf2loc.c
parent88d4aea7473bf93d98ba72a5f955f428cd365431 (diff)
downloadgdb-9a619af0d3152e742fbd290baeae96a32f0abf04.zip
gdb-9a619af0d3152e742fbd290baeae96a32f0abf04.tar.gz
gdb-9a619af0d3152e742fbd290baeae96a32f0abf04.tar.bz2
2010-05-14 Michael Snyder <msnyder@vmware.com>
* dbxread.c: White space. * dcache.c: White space. * disasm.c: White space. * doublest.c: White space. * dsrec.c: White space. * dummy-frame.c: White space. * dwarf2expr.c: White space. * dwarf2-frame.c: White space. * dwarf2loc.c: White space. * dwarf2read.c: White space.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index a67e073..c137b97 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -192,6 +192,7 @@ dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc,
else
{
struct dwarf2_locexpr_baton *symbaton;
+
symbaton = SYMBOL_LOCATION_BATON (framefunc);
if (symbaton != NULL)
{
@@ -214,6 +215,7 @@ static CORE_ADDR
dwarf_expr_frame_cfa (void *baton)
{
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
+
return dwarf2_frame_cfa (debaton->frame);
}
@@ -270,6 +272,7 @@ read_pieced_value (struct value *v)
for (i = 0; i < c->n_pieces; i++)
{
struct dwarf_expr_piece *p = &c->pieces[i];
+
switch (p->location)
{
case DWARF_VALUE_REGISTER:
@@ -308,6 +311,7 @@ read_pieced_value (struct value *v)
{
struct gdbarch *gdbarch = get_type_arch (value_type (v));
size_t n = p->size;
+
if (n > c->addr_size)
n = c->addr_size;
store_unsigned_integer (contents + offset, n,
@@ -319,6 +323,7 @@ read_pieced_value (struct value *v)
case DWARF_VALUE_LITERAL:
{
size_t n = p->size;
+
if (n > p->v.literal.length)
n = p->v.literal.length;
memcpy (contents + offset, p->v.literal.data, n);
@@ -351,6 +356,7 @@ write_pieced_value (struct value *to, struct value *from)
for (i = 0; i < c->n_pieces; i++)
{
struct dwarf_expr_piece *p = &c->pieces[i];
+
switch (p->location)
{
case DWARF_VALUE_REGISTER:
@@ -469,6 +475,7 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
struct gdbarch *arch = get_frame_arch (frame);
CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0);
int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, dwarf_regnum);
+
if (gdb_regnum != -1)
retval = value_from_register (type, gdb_regnum, frame);
else
@@ -544,6 +551,7 @@ static CORE_ADDR
needs_frame_read_reg (void *baton, int regnum)
{
struct needs_frame_baton *nf_baton = baton;
+
nf_baton->needs_frame = 1;
return 1;
}
@@ -574,6 +582,7 @@ static CORE_ADDR
needs_frame_frame_cfa (void *baton)
{
struct needs_frame_baton *nf_baton = baton;
+
nf_baton->needs_frame = 1;
return 1;
}
@@ -583,6 +592,7 @@ static CORE_ADDR
needs_frame_tls_address (void *baton, CORE_ADDR offset)
{
struct needs_frame_baton *nf_baton = baton;
+
nf_baton->needs_frame = 1;
return 1;
}
@@ -671,6 +681,7 @@ dwarf2_tracepoint_var_loc (struct symbol *symbol,
else if (data[0] == DW_OP_regx)
{
ULONGEST reg;
+
data = read_uleb128 (data + 1, end, &reg);
loc->kind = axs_lvalue_register;
loc->reg = gdbarch_dwarf2_reg_to_regnum (gdbarch, reg);
@@ -902,6 +913,7 @@ locexpr_read_variable (struct symbol *symbol, struct frame_info *frame)
{
struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
struct value *val;
+
val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, dlbaton->data,
dlbaton->size, dlbaton->per_cu);
@@ -913,6 +925,7 @@ static int
locexpr_read_needs_frame (struct symbol *symbol)
{
struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
+
return dwarf2_loc_desc_needs_frame (dlbaton->data, dlbaton->size,
dlbaton->per_cu);
}
@@ -1037,6 +1050,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
data + 1,
data + size - 1,
addr_size);
+
fprintf_filtered (stream,
_("a thread-local variable at offset %s "
"in the thread-local storage for `%s'"),