New: Wrong debug info for variable accessed non-locally
5 answers - 927 bytes -
The subject says it all: void foo(void) { int a = 0; void bar(void) { a = 1; } bar (); a = a + 1; } int main(void) { foo (); } GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux"Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) b t.c:11 Breakpoint 1 at 0x8048389: file t.c, line 11. (gdb) run Starting program: /home/eric/gnat/bugs/F318-004/t Breakpoint 1, foo () at t.c:11 11 a = a + 1; (gdb) p a $1 = -12412 (gdb) next 12 } (gdb) p a $2 = -12412
No.1 | | 91 bytes | |
Comment #3 from ebotcazou at gcc dot gnu dot org 2006-05-13 18:55 Patch in preparation.
No.2 | | 205 bytes | |
Comment #4 from patchapp at dberlin dot org 2006-05-14 03:02 Subject: Bug number PR debug/26754 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is
No.3 | | 267 bytes | |
Comment #5 from mmitchel at gcc dot gnu dot org 2006-06-04 18:16 The idea of this patch seems K, but let's find a way to avoid duplicating the declare_tmp_vars code, perhaps by making another small routine to find the outermost BIND_EXPR in a function?
No.4 | | 977 bytes | |
Comment #7 from ebotcazou at gcc dot gnu dot org 2006-06-13 08:55 Subject: Bug 26754
Author: ebotcazou Date: Tue Jun 13 08:55:40 2006 New Revision: 114605
URL: Log: PR debug/26754 * gimplify.c (declare_tmp_vars): Rename into declare_vars. Add debug_info parameter. Chain the vars to the BLCK instead of the BIND_EXPR if debug info are requested for them. (pop_gimplify_context): Adjust for above change. (gimple_add_tmp_var): Likewise. * tree-gimple.h (declare_tmp_vars): Rename into declare_vars. Add bool parameter. * tree-nested.c (convert_nonlocal_reference): Adjust for above change. (convert_local_reference): Likewise. (get_local_debug_decl): Set DECL_IGNRED_P on the original variable. (finalize_nesting_tree_1): Request that debug info be emitted for debug_var_chain.