aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-03-18 18:43:33 +0000
committerPedro Alves <palves@redhat.com>2011-03-18 18:43:33 +0000
commit79e1a869ac109293fb60c1909c085ea8c6c7cd12 (patch)
tree9d03b7cecb1f565497d4ff32574192921576f891 /gdb/dwarf2loc.c
parent8dccd430c9de0e6cf747ae4bb1bf9d944fe3397c (diff)
downloadgdb-79e1a869ac109293fb60c1909c085ea8c6c7cd12.zip
gdb-79e1a869ac109293fb60c1909c085ea8c6c7cd12.tar.gz
gdb-79e1a869ac109293fb60c1909c085ea8c6c7cd12.tar.bz2
gdb/
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Catch NOT_AVAILABLE_ERROR when evaluating the location expression.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 285081e..9fd8df0 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1076,6 +1076,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
struct dwarf_expr_context *ctx;
struct cleanup *old_chain;
struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
+ volatile struct gdb_exception ex;
if (byte_offset < 0)
invalid_synthetic_pointer ();
@@ -1106,7 +1107,22 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
ctx->get_tls_address = dwarf_expr_tls_address;
ctx->dwarf_call = dwarf_expr_dwarf_call;
- dwarf_expr_eval (ctx, data, size);
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
+ {
+ dwarf_expr_eval (ctx, data, size);
+ }
+ if (ex.reason < 0)
+ {
+ if (ex.error == NOT_AVAILABLE_ERROR)
+ {
+ retval = allocate_value (type);
+ mark_value_bytes_unavailable (retval, 0, TYPE_LENGTH (type));
+ return retval;
+ }
+ else
+ throw_exception (ex);
+ }
+
if (ctx->num_pieces > 0)
{
struct piece_closure *c;