* dwarf2loc.c (locexpr_tracepoint_var_ref)
authorPedro Alves <palves@redhat.com>
Thu, 1 Jul 2010 15:45:31 +0000 (15:45 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 1 Jul 2010 15:45:31 +0000 (15:45 +0000)
(loclist_tracepoint_var_ref): Handle optimized out values.

gdb/ChangeLog
gdb/dwarf2loc.c

index f6c878195265b44ffcf5d38db8bb21e16f94f84e..dcdcee7b0431597a7064fb25e74ad49b1b00f223 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-01  Pedro Alves  <pedro@codesourcery.com>
+
+       * dwarf2loc.c (locexpr_tracepoint_var_ref)
+       (loclist_tracepoint_var_ref): Handle optimized out values.
+
 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
 
        * breakpoint.c (update_watchpoint, _initialize_breakpoint): Remove
index 196502279c8875d3279ca93baef6cf1f4646abd5..f26b46e2bbba47289e33addf03079babf51e2537 100644 (file)
@@ -2416,9 +2416,12 @@ locexpr_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
   struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
   unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
 
-  compile_dwarf_to_ax (ax, value, gdbarch, addr_size,
-                      dlbaton->data, dlbaton->data + dlbaton->size,
-                      dlbaton->per_cu);
+  if (dlbaton->data == NULL || dlbaton->size == 0)
+    value->optimized_out = 1;
+  else
+    compile_dwarf_to_ax (ax, value, gdbarch, addr_size,
+                        dlbaton->data, dlbaton->data + dlbaton->size,
+                        dlbaton->per_cu);
 }
 
 /* The set of location functions used with the DWARF-2 expression
@@ -2568,9 +2571,11 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
   unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
 
   data = find_location_expression (dlbaton, &size, ax->scope);
-
-  compile_dwarf_to_ax (ax, value, gdbarch, addr_size, data, data + size,
-                      dlbaton->per_cu);
+  if (data == NULL || size == 0)
+    value->optimized_out = 1;
+  else
+    compile_dwarf_to_ax (ax, value, gdbarch, addr_size, data, data + size,
+                        dlbaton->per_cu);
 }
 
 /* The set of location functions used with the DWARF-2 expression