From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43526 invoked by alias); 20 Apr 2015 22:04:25 -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 43503 invoked by uid 48); 20 Apr 2015 22:04:25 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Subject: [Bug exp/18285] New: ptype expr-with-xmethod -> SEGV Date: Mon, 20 Apr 2015 22:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: exp X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at google 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 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: 2015-q2/txt/msg00078.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18285 Bug ID: 18285 Summary: ptype expr-with-xmethod -> SEGV Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: exp Assignee: unassigned at sourceware dot org Reporter: dje at google dot com gdb unique-ptr (gdb) start (gdb) pt *foo # foo is a std::unique_ptr<> object -> segv The problem, I think, is in value_x_unop: if (noside == EVAL_AVOID_SIDE_EFFECTS) { struct type *return_type; return_type = TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0]))); => return value_zero (return_type, VALUE_LVAL (arg1)); } if (TYPE_CODE (value_type (argvec[0])) == TYPE_CODE_XMETHOD) { /* Static xmethods are not supported yet. */ gdb_assert (static_memfuncp == 0); return call_xmethod (argvec[0], 1, argvec + 1); } else return call_function_by_hand (argvec[0], nargs, argvec + 1); (top-gdb) p argvec[0]->type->main_type->code $6 = TYPE_CODE_XMETHOD xmethods don't have TYPE_TARGET_TYPE, it's NULL. The user would want the result of the ptype command to be the type of the result of the xmethod, not the type of the xmethod. Check for xmethods before EVAL_AVOID_SIDE_EFFECTS? OTOH, the xmethod may well have side effects. Propagate EVAL_AVOID_SIDE_EFFECTS into the xmethod? -- You are receiving this mail because: You are on the CC list for the bug.