This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/12127] gdb with python support still get crash on showing uninitialized local variables
- From: "asmwarrior at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 07 May 2013 06:16:45 +0000
- Subject: [Bug python/12127] gdb with python support still get crash on showing uninitialized local variables
- Auto-submitted: auto-generated
- References: <bug-12127-4717 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12127
--- Comment #5 from asmwarrior <asmwarrior at gmail dot com> 2013-05-07 06:16:45 UTC ---
gdb/python/py-prettyprint.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index b50e757..e0dd92b 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -332,7 +332,9 @@ print_string_repr (PyObject *printer, const char *hint,
gdbpy_extract_lazy_string (py_str, &addr, &type,
&length, &encoding);
- local_opts.addressprint = 0;
+ if (length > local_opts.print_max)
+ length = local_opts.print_max;
+ local_opts.addressprint = 0;
val_print_string (type, encoding, addr, (int) length,
stream, &local_opts);
}
-------------------------
The above patch fix the crash problem, but I'm not sure it was good or just a
workaround.
Yuanhui Zhang
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.