]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/guile/scm-symbol.c
DWARF: handle non-local references in nested functions
[thirdparty/binutils-gdb.git] / gdb / guile / scm-symbol.c
index 01c9eb13f3cbaf2a8325663a3b4e51bc12592536..0970a72bdccb87bdbfce6cd457c5356eb54b5b7c 100644 (file)
@@ -550,7 +550,11 @@ gdbscm_symbol_value (SCM self, SCM rest)
       if (symbol_read_needs_frame (symbol) && frame_info == NULL)
        error (_("Symbol requires a frame to compute its value"));
 
-      value = read_var_value (symbol, frame_info);
+      /* TODO: currently, we have no way to recover the block in which SYMBOL
+        was found, so we have no block to pass to read_var_value.  This will
+        yield an incorrect value when symbol is not local to FRAME_INFO (this
+        can happen with nested functions).  */
+      value = read_var_value (symbol, NULL, frame_info);
     }
   CATCH (except, RETURN_MASK_ALL)
     {