From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27394 invoked by alias); 7 May 2013 06:16:47 -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 27346 invoked by uid 48); 7 May 2013 06:16:46 -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:16: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/msg00196.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12127 --- Comment #5 from asmwarrior 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.