From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91337 invoked by alias); 21 Apr 2015 22:32:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 91314 invoked by uid 48); 21 Apr 2015 22:32:12 -0000 From: "dje at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 Date: Tue, 21 Apr 2015 22:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01764.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839 Bug ID: 65839 Summary: xmethods need updating once gdb decides how to fix 18285 Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: dje at google dot com https://sourceware.org/bugzilla/show_bug.cgi?id=18285 documents a mea culpa: ptype on an xmethod expression segvs gdb. Bleah. Once we decide how to handle this in gdb, libstdc++'s xmethods will need updating. I can think of a way to fix the gdb side that doesn't involve changing libstdc++'s xmethods. Maybe it's a reasonable way to go. The issue is that currently, in order to know what the type of the result of the xmethod is, we have to invoke the xmethod. But for "ptype" we don't want any side-effects. GDB evaluates such expressions with EVAL_AVOID_SIDE_EFFECTS, and while many xmethods typically don't have side-effects some can. And, for completeness sake, even reading target memory can have a side-effect. A better solution would be a way to get the type of the result of the xmethod without having to invoke it, and that will require changes to the source.