From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2192 invoked by alias); 23 Jan 2015 18:01:06 -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 2027 invoked by uid 55); 23 Jan 2015 18:01:01 -0000 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/17416] -var-list-children fails with "set print object on" and invalid/NULL value Date: Fri, 23 Jan 2015 18:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00115.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17416 --- Comment #2 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Simon Marchi : https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f7e5394d614db4456fc0d9598bbfa936cc7941af commit f7e5394d614db4456fc0d9598bbfa936cc7941af Author: Simon Marchi Date: Fri Jan 23 12:59:24 2015 -0500 Catch exception in value_rtti_indirect_type In the situation described in bug 17416 [1]: * "set print object" is on; * The variable object is a pointer to a struct, and it contains an invalid value (e.g. NULL, or random uninitialized value); * The variable object (struct) has a child which is also a pointer to a struct; * We try to use "-var-list-children". ... an exception thrown in value_ind can propagate too far and leave an half-built variable object, leading to a wrong state. This patch adds a TRY_CATCH to catch it and makes value_rtti_indirect_type return NULL in that case, meaning that the type of the pointed object could not be found. A test for the fix is also added. New in v2: * Added test. * Restructured "catch" code. * Added details about the bug in commit log. gdb/Changelog: * valops.c (value_rtti_indirect_type): Catch exception thrown by value_ind. gdb/testsuite/ChangeLog * gdb.mi/mi-var-list-children-invalid-grandchild.c: New file. * gdb.mi/mi-var-list-children-invalid-grandchild.exp: New file. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=17416 -- You are receiving this mail because: You are on the CC list for the bug.