From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13939 invoked by alias); 19 Sep 2014 21:24:45 -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 13915 invoked by uid 48); 19 Sep 2014 21:24:44 -0000 From: "simon.marchi at ericsson dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/17416] New: -var-list-children fails with "set print object on" and invalid/NULL value Date: Fri, 19 Sep 2014 21:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: simon.marchi at ericsson 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-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: 2014-q3/txt/msg00713.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17416 Bug ID: 17416 Summary: -var-list-children fails with "set print object on" and invalid/NULL value Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simon.marchi at ericsson dot com Created attachment 7796 --> https://sourceware.org/bugzilla/attachment.cgi?id=7796&action=edit Test program When - "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. -var-list-children returns an error. GDB tries to dereference the top-level pointer to get the value of the child one, in order to go determine the real type of the pointed object using RTTI. In the process, value_ind in value_rtti_indirect_type throws an error that is never caught. What happens then is that the variable object for the child is half-created. If the top-level pointer is set to a sensible value and we try to do -var-list-children again, we get a "Duplicate variable object name" error. The attached test case shows the problem. -- You are receiving this mail because: You are on the CC list for the bug.