From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20552 invoked by alias); 7 May 2013 06:01:10 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 20519 invoked by uid 48); 7 May 2013 06:01:10 -0000 From: "asmwarrior at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/12127] gdb with python support still get crash on showing uninitialized local variables Date: Tue, 07 May 2013 06:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: asmwarrior at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-q2/txt/msg00195.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12127 --- Comment #4 from asmwarrior 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 , 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.