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.