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:01:09 +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 #4 from asmwarrior <asmwarrior at gmail dot com> 2013-05-07 06:01:09 UTC ---
(gdb) up
#4 0x0046ecfe in print_string_repr (printer=0x31075f8,
hint=0x58a91e8 "string", stream=0x2ec2f68, recurse=1, options=0x298f9d4,
language=0x7ee360 <cplus_language_defn>, gdbarch=0x2ebd520)
at ../../gdb/gdb/python/py-prettyprint.c:336
336 val_print_string (type, encoding, addr, (int) length,
(gdb) l
331 make_cleanup (free_current_contents, &encoding);
332 gdbpy_extract_lazy_string (py_str, &addr, &type,
333 &length, &encoding);
334
335 local_opts.addressprint = 0;
336 val_print_string (type, encoding, addr, (int) length,
337 stream, &local_opts);
338 }
339 else
340 {
(gdb) p length
$9 = 2009291924
(gdb) p local_opts
$10 = {pretty = Val_pretty_default, prettyprint_arrays = 0,
prettyprint_structs = 0, vtblprint = 0, unionprint = 1, addressprint = 0,
objectprint = 0, print_max = 200, repeat_count_threshold = 10,
output_format = 0, format = 0, stop_print_at_null = 0,
print_array_indexes = 0, deref_ref = 0, static_field_print = 1,
pascal_static_field_print = 1, raw = 0, summary = 0, symbol_print = 1}
(gdb)
See the log above, it looks like the gdbpy_extract_lazy_string gives the wrong
value "length = 2009291924", and the local_opts.print_max = 200. So in this
case, do we need to compare those two values, and set length to
local_opts.print_max?
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.