This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] varobj.c: Reset string_print [Re: [obv] varobj.c: Fix GCC false warning]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Andreas Schwab <schwab at linux-m68k dot org>
- Date: Sun, 17 Oct 2010 13:53:58 +0200
- Subject: [patch] varobj.c: Reset string_print [Re: [obv] varobj.c: Fix GCC false warning]
- References: <20101017084541.GA32723@host1.dyn.jankratochvil.net> <m21v7p6stb.fsf@whitebox.home>
On Sun, 17 Oct 2010 12:02:08 +0200, Andreas Schwab wrote:
> What happens if string_print is set but gdbpy_extract_lazy_string was
> not called?
I agree.
BTW this is unrelated to the [obv] fix, in fact GCC warned on a falsely
uninitialized value <! HAVE_PYTHON> and GCC missed a real uninitialized value
<HAVE_PYTHON>.
I guess this patch should fix it.
No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu.
Thanks,
Jan
gdb/
2010-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* varobj.c (value_get_print_value): Reset STRING_PRINT if STR_ADDR is
not set.
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -2557,9 +2557,14 @@ value_get_print_value (struct value *value, enum varobj_display_formats format,
make_cleanup (xfree, thevalue);
}
else
- gdbpy_print_stack ();
+ {
+ gdbpy_print_stack ();
+ string_print = 0;
+ }
}
}
+ else
+ string_print = 0;
if (replacement)
value = replacement;
}