summaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-09-07 16:16:01 +0000
committerJim Blandy <jimb@codesourcery.com>2004-09-07 16:16:01 +0000
commitd5e4480e10392e731e45755d60b604722234be82 (patch)
tree5a770bfcb29abd621f7deaf968de095278e10918 /gdb/dwarf2loc.c
parent40dd33a331138de88780ebfd6f08fd1030ecf773 (diff)
downloadgdb-cvs/master-UNNAMED-BRANCH.tar.gz
* rs6000-tdep.c: #include "dwarf2expr.h".master-UNNAMED-BRANCHcvs/master-UNNAMED-BRANCH
(dwarf_piece_is_ev_upper_reg, dwarf_piece_is_gpr) (e500_dwarf_simplify_register_pieces): New functions. (rs6000_gdbarch_init): If the architecture is E500, register e500_dwarf_simplify_register_pieces. * Makefile.in (rs6000-tdep.o): Update dependencies. * gdbarch.sh (dwarf_simplify_register_pieces): New method. Add forward declaration for 'struct dwarf_expr_piece'. * gdbarch.c, gdbarch.h: Regenerated. * dwarf2loc.c (dwarf2_evaluate_loc_desc): Try to simplify multi-piece expression results before giving up. * arch-utils.c (dwarf_never_simplify_pieces): New function. * arch-utils.h (struct dwarf_expr_piece): Forward decl for struct type, used in ... (dwarf_never_simplify_pieces): New declaration.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index ed2744f7aca..42820a65d3b 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -231,11 +231,18 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
if (ctx->num_pieces > 0)
{
- /* We haven't implemented splicing together pieces from
- arbitrary sources yet. */
- error ("The value of variable '%s' is distributed across several\n"
- "locations, and GDB cannot access its value.\n",
- SYMBOL_NATURAL_NAME (var));
+ CORE_ADDR simplified
+ = gdbarch_dwarf_simplify_register_pieces (arch, ctx->num_pieces,
+ ctx->pieces);
+ if (simplified >= 0)
+ retval = value_from_register (SYMBOL_TYPE (var), simplified, frame);
+
+ /* We haven't implemented the more complex case of splicing
+ together pieces from arbitrary sources yet. */
+ else
+ error ("The value of variable '%s' is distributed across several\n"
+ "locations, and GDB cannot access its value.\n",
+ SYMBOL_NATURAL_NAME (var));
}
else if (ctx->in_reg)
CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0);