public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285
@ 2015-04-21 22:32 dje at google dot com
  2015-04-21 23:38 ` [Bug libstdc++/65839] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dje at google dot com @ 2015-04-21 22:32 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/65839] xmethods need updating once gdb decides how to fix 18285
  2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
@ 2015-04-21 23:38 ` redi at gcc dot gnu.org
  2015-04-21 23:48 ` dje at google dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-21 23:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-21
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I don't think there are many users of xmethods yet, so changing them in
libstdc++ to add a return_type method should be fine.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/65839] xmethods need updating once gdb decides how to fix 18285
  2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
  2015-04-21 23:38 ` [Bug libstdc++/65839] " redi at gcc dot gnu.org
@ 2015-04-21 23:48 ` dje at google dot com
  2015-04-27 22:40 ` dje at google dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dje at google dot com @ 2015-04-21 23:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839

--- Comment #2 from Doug Evans <dje at google dot com> ---
Re: changing xmethods.
The thought was that they'd be changed in an upward compatible manner,
but it's good to know we have a bit of freedom. Thanks!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/65839] xmethods need updating once gdb decides how to fix 18285
  2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
  2015-04-21 23:38 ` [Bug libstdc++/65839] " redi at gcc dot gnu.org
  2015-04-21 23:48 ` dje at google dot com
@ 2015-04-27 22:40 ` dje at google dot com
  2015-04-29 22:51 ` devans at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dje at google dot com @ 2015-04-27 22:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839

--- Comment #3 from Doug Evans <dje at google dot com> ---
[fyi]
Here's the tentative patch for gdb.
https://sourceware.org/ml/gdb-patches/2015-04/msg00947.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/65839] xmethods need updating once gdb decides how to fix 18285
  2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
                   ` (2 preceding siblings ...)
  2015-04-27 22:40 ` dje at google dot com
@ 2015-04-29 22:51 ` devans at gcc dot gnu.org
  2015-05-26 21:29 ` devans at gcc dot gnu.org
  2015-05-26 21:46 ` dje at google dot com
  5 siblings, 0 replies; 7+ messages in thread
From: devans at gcc dot gnu.org @ 2015-04-29 22:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839

--- Comment #4 from devans at gcc dot gnu.org ---
Author: devans
Date: Wed Apr 29 22:50:31 2015
New Revision: 222599

URL: https://gcc.gnu.org/viewcvs?rev=222599&root=gcc&view=rev
Log:
        PR libstdc++/65839
        * python/libstdcxx/v6/xmethods.py (get_bool_type): New function.
        Replace all lookups of "bool" with this.
        (get_std_size_type): New function.  Replace all lookups of std::size_t
        with this.
        (*Worker): New method get_result_type.
        (DequeWorkerBase.__init__): New arg val_type.  All callers updated.
        (ListWorkerBase.__init__): New arg val_type.  All callers updated.
        (UniquePtrGetWorker.__init__): New arg elem_type.  All callers updated.
        Delete setting of name, enabled.
        (UniquePtrDerefWorker.__init__): New arg elem_type.  All callers
        updated.  Delete setting of name.
        (UniquePtrMethodsMatcher): Rewrite for consistency with all other
        libstdc++ xmethod matchers.
        * testsuite/libstdc++-xmethods/array.cc: Add whatis tests.
        * testsuite/libstdc++-xmethods/associative-containers.cc: Ditto.
        * testsuite/libstdc++-xmethods/deque.cc: Ditto.
        * testsuite/libstdc++-xmethods/forwardlist.cc: Ditto.
        * testsuite/libstdc++-xmethods/list.cc: Ditto.
        * testsuite/libstdc++-xmethods/unique_ptr.cc: Ditto.
        * testsuite/libstdc++-xmethods/vector.cc: Ditto.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/python/libstdcxx/v6/xmethods.py
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/array.cc
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/associative-containers.cc
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/deque.cc
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/forwardlist.cc
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/list.cc
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc
    trunk/libstdc++-v3/testsuite/libstdc++-xmethods/vector.cc


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/65839] xmethods need updating once gdb decides how to fix 18285
  2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
                   ` (3 preceding siblings ...)
  2015-04-29 22:51 ` devans at gcc dot gnu.org
@ 2015-05-26 21:29 ` devans at gcc dot gnu.org
  2015-05-26 21:46 ` dje at google dot com
  5 siblings, 0 replies; 7+ messages in thread
From: devans at gcc dot gnu.org @ 2015-05-26 21:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839

--- Comment #5 from devans at gcc dot gnu.org ---
Author: devans
Date: Tue May 26 21:28:42 2015
New Revision: 223719

URL: https://gcc.gnu.org/viewcvs?rev=223719&root=gcc&view=rev
Log:
        PR libstdc++/65839
        * python/libstdcxx/v6/xmethods.py (get_bool_type): New function.
        Replace all lookups of "bool" with this.
        (get_std_size_type): New function.  Replace all lookups of std::size_t
        with this.
        (*Worker): New method get_result_type.
        (DequeWorkerBase.__init__): New arg val_type.  All callers updated.
        (ListWorkerBase.__init__): New arg val_type.  All callers updated.
        (UniquePtrGetWorker.__init__): New arg elem_type.  All callers updated.
        Delete setting of name, enabled.
        (UniquePtrDerefWorker.__init__): New arg elem_type.  All callers
        updated.  Delete setting of name.
        (UniquePtrMethodsMatcher): Rewrite for consistency with all other
        libstdc++ xmethod matchers.
        * testsuite/libstdc++-xmethods/array.cc: Add whatis tests.
        * testsuite/libstdc++-xmethods/associative-containers.cc: Ditto.
        * testsuite/libstdc++-xmethods/deque.cc: Ditto.
        * testsuite/libstdc++-xmethods/forwardlist.cc: Ditto.
        * testsuite/libstdc++-xmethods/list.cc: Ditto.
        * testsuite/libstdc++-xmethods/unique_ptr.cc: Ditto.
        * testsuite/libstdc++-xmethods/vector.cc: Ditto.

Modified:
    branches/gcc-5-branch/libstdc++-v3/ChangeLog
    branches/gcc-5-branch/libstdc++-v3/python/libstdcxx/v6/xmethods.py
    branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/array.cc
   
branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/associative-containers.cc
    branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/deque.cc
   
branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/forwardlist.cc
    branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/list.cc
   
branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc
    branches/gcc-5-branch/libstdc++-v3/testsuite/libstdc++-xmethods/vector.cc


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/65839] xmethods need updating once gdb decides how to fix 18285
  2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
                   ` (4 preceding siblings ...)
  2015-05-26 21:29 ` devans at gcc dot gnu.org
@ 2015-05-26 21:46 ` dje at google dot com
  5 siblings, 0 replies; 7+ messages in thread
From: dje at google dot com @ 2015-05-26 21:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65839

Doug Evans <dje at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Doug Evans <dje at google dot com> ---
patches committed to gcc and gdb.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-26 21:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 22:32 [Bug libstdc++/65839] New: xmethods need updating once gdb decides how to fix 18285 dje at google dot com
2015-04-21 23:38 ` [Bug libstdc++/65839] " redi at gcc dot gnu.org
2015-04-21 23:48 ` dje at google dot com
2015-04-27 22:40 ` dje at google dot com
2015-04-29 22:51 ` devans at gcc dot gnu.org
2015-05-26 21:29 ` devans at gcc dot gnu.org
2015-05-26 21:46 ` dje at google dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).