public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb
@ 2015-12-20 22:35 Artemiy Volkov
  2015-12-20 22:35 ` [PATCH 06/11] [PR gdb/14441] gdb: print: implement correct printing of rvalue reference types and values Artemiy Volkov
                   ` (12 more replies)
  0 siblings, 13 replies; 109+ messages in thread
From: Artemiy Volkov @ 2015-12-20 22:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Artemiy Volkov

Hi all,

this is my take on fixing gdb/14441 which deals with C++0x rvalue references.

The approach is rather straightforward and the work for the most part consisted
of mimicking the behavior for regular references. In gdbtypes.c, several helper
functions were introduced and some parameterized by the reference kind to
simplify the access to reference type objects API.

The only interesting part is the addition of overloading resolution rules
with regard to rvalue references. All of the cases introduced in 13.3.3.1.4 and
13.3.3.2 were accounted for at the beginning of rank_one_type(). 

With this patch it is now also possible to fix the evaluation of decltype,
which should return a plain type object, an lvalue reference or an rvalue
reference depending on a type category of the type of its operand. However,
this would require introduction of the type catyegory notion to gdb, which I
think only needs adding a new constant to lval_type and propagating the type
category through different parts of an expression in gdb/valops.c. I'm willing
to do this if this patchset turns out to be OK.

Artemiy Volkov (11):
  gdb: gdbtypes: add definitions for rvalue reference type
  gdb: gdbtypes: change {lookup,make}_reference_type() API
  gdb: valops: add ability to return rvalue reference values from
    value_ref()
  gdb: parse: support rvalue reference type
  gdb: demangle: implement demangling for rvalue reference typenames
  gdb: print: implement correct printing of rvalue reference types and
    values
  gdb: dwarf2read: support DW_AT_rvalue_reference type
  gdb: convert lvalue reference type check to general reference type
    check
  gdb: gdbtypes: add rvalue references to overloading resolution
  gdb: python: support rvalue references in the gdb module
  gdb: testsuite: add rvalue reference tests

 gdb/aarch64-tdep.c                    |   5 +-
 gdb/ada-lang.c                        |   2 +-
 gdb/amd64-tdep.c                      |   2 +-
 gdb/amd64-windows-tdep.c              |   1 +
 gdb/arm-tdep.c                        |   5 +-
 gdb/ax-gdb.c                          |   2 +
 gdb/c-exp.y                           |   6 +-
 gdb/c-typeprint.c                     |  10 +-
 gdb/c-valprint.c                      |  13 ++-
 gdb/c-varobj.c                        |  10 +-
 gdb/compile/compile-c-symbols.c       |   2 +-
 gdb/completer.c                       |   3 +-
 gdb/cp-name-parser.y                  |   4 +
 gdb/cp-support.c                      |   3 +-
 gdb/darwin-nat-info.c                 |   2 +-
 gdb/dwarf2loc.c                       |   4 +-
 gdb/dwarf2read.c                      |  15 ++-
 gdb/eval.c                            |  16 ++--
 gdb/f-exp.y                           |   2 +-
 gdb/findvar.c                         |   6 +-
 gdb/gdbtypes.c                        |  96 ++++++++++++++++---
 gdb/gdbtypes.h                        |  21 ++++-
 gdb/guile/scm-type.c                  |   2 +-
 gdb/guile/scm-value.c                 |   2 +-
 gdb/hppa-tdep.c                       |   1 +
 gdb/infcall.c                         |   5 +-
 gdb/language.c                        |   3 +-
 gdb/m32c-tdep.c                       |   8 +-
 gdb/m88k-tdep.c                       |   1 +
 gdb/mn10300-tdep.c                    |   1 +
 gdb/msp430-tdep.c                     |   2 +-
 gdb/parse.c                           |  41 ++++----
 gdb/parser-defs.h                     |   1 +
 gdb/ppc-sysv-tdep.c                   |  10 +-
 gdb/printcmd.c                        |   4 +-
 gdb/python/lib/gdb/command/explore.py |  21 +++++
 gdb/python/lib/gdb/types.py           |   4 +-
 gdb/python/py-type.c                  |  14 ++-
 gdb/python/py-value.c                 |  45 +++++++--
 gdb/python/py-xmethods.c              |  19 +++-
 gdb/s390-linux-tdep.c                 |   2 +-
 gdb/sparc-tdep.c                      |   1 +
 gdb/sparc64-tdep.c                    |   1 +
 gdb/spu-tdep.c                        |   1 +
 gdb/stabsread.c                       |   2 +-
 gdb/symtab.c                          |   3 +-
 gdb/testsuite/gdb.cp/casts.cc         |   8 +-
 gdb/testsuite/gdb.cp/casts.exp        |  34 ++++++-
 gdb/testsuite/gdb.cp/cpsizeof.cc      |   4 +
 gdb/testsuite/gdb.cp/cpsizeof.exp     |   2 +-
 gdb/testsuite/gdb.cp/demangle.exp     | 172 +++++++++++++++++++++++++++++++++-
 gdb/testsuite/gdb.cp/overload.cc      |   9 ++
 gdb/testsuite/gdb.cp/overload.exp     |  14 ++-
 gdb/testsuite/gdb.cp/ref-params.cc    |  29 +++++-
 gdb/testsuite/gdb.cp/ref-params.exp   |  20 +++-
 gdb/testsuite/gdb.cp/ref-types.cc     |  24 +++++
 gdb/testsuite/gdb.cp/ref-types.exp    | 136 ++++++++++++++++++++++++++-
 gdb/typeprint.c                       |   4 +-
 gdb/valarith.c                        |   6 +-
 gdb/valops.c                          |  68 +++++++-------
 gdb/valprint.c                        |   5 +-
 gdb/value.c                           |  12 ++-
 gdb/value.h                           |   2 +-
 gdb/varobj.c                          |   2 +-
 libiberty/cplus-dem.c                 |  14 ++-
 65 files changed, 805 insertions(+), 184 deletions(-)

-- 
2.6.4

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

end of thread, other threads:[~2016-06-20 19:07 UTC | newest]

Thread overview: 109+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20 22:35 [PATCH 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb Artemiy Volkov
2015-12-20 22:35 ` [PATCH 06/11] [PR gdb/14441] gdb: print: implement correct printing of rvalue reference types and values Artemiy Volkov
2015-12-20 22:35 ` [PATCH 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Artemiy Volkov
2015-12-20 22:35 ` [PATCH 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_AT_rvalue_reference type Artemiy Volkov
2015-12-20 22:35 ` [PATCH 05/11] [PR gdb/14441] gdb: demangle: implement demangling for rvalue reference typenames Artemiy Volkov
2015-12-30 19:17   ` Pedro Alves
2015-12-20 22:35 ` [PATCH 02/11] [PR gdb/14441] gdb: gdbtypes: change {lookup,make}_reference_type() API Artemiy Volkov
2015-12-20 22:35 ` [PATCH 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type Artemiy Volkov
2015-12-20 22:35 ` [PATCH 08/11] [PR gdb/14441] gdb: convert lvalue reference type check to general reference type check Artemiy Volkov
2015-12-20 22:35 ` [PATCH 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests Artemiy Volkov
2015-12-20 22:35 ` [PATCH 09/11] [PR gdb/14441] gdb: gdbtypes: add rvalue references to overloading resolution Artemiy Volkov
2015-12-20 22:35 ` [PATCH 10/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module Artemiy Volkov
2015-12-20 22:35 ` [PATCH 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref() Artemiy Volkov
2015-12-28 21:09 ` [PATCH 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb Artemiy Volkov
2016-01-20  9:42   ` Yao Qi
2016-01-19 18:54 ` [PATCH v2 " Artemiy Volkov
2016-01-19 18:54   ` [PATCH v2 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref() Artemiy Volkov
2016-02-19 18:52     ` Keith Seitz
2016-01-19 18:54   ` [PATCH v2 05/11] [PR gdb/14441] gdb: demangle: implement demangling for rvalue reference typenames Artemiy Volkov
2016-02-19 18:54     ` Keith Seitz
2016-01-19 18:54   ` [PATCH v2 06/11] [PR gdb/14441] gdb: print: implement correct printing of rvalue reference types and values Artemiy Volkov
2016-02-19 18:56     ` Keith Seitz
2016-01-19 18:54   ` [PATCH v2 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Artemiy Volkov
2016-02-19 18:49     ` Keith Seitz
2016-02-23  7:04       ` Artemiy Volkov
2016-02-25  1:22         ` Keith Seitz
2016-02-25  1:32           ` Artemiy Volkov
2016-02-25  1:41             ` Keith Seitz
2016-02-25  1:45               ` Artemiy Volkov
2016-01-19 18:54   ` [PATCH v2 02/11] [PR gdb/14441] gdb: gdbtypes: change {lookup,make}_reference_type() API Artemiy Volkov
2016-02-19 18:50     ` Keith Seitz
2016-01-19 18:54   ` [PATCH v2 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type Artemiy Volkov
2016-02-19 18:53     ` Keith Seitz
2016-01-19 18:55   ` [PATCH v2 08/11] [PR gdb/14441] gdb: convert lvalue reference type check to general reference type check Artemiy Volkov
2016-02-19 19:01     ` Keith Seitz
2016-02-26  5:08       ` Artemiy Volkov
2016-01-19 18:55   ` [PATCH v2 09/11] [PR gdb/14441] gdb: gdbtypes: add rvalue references to overloading resolution Artemiy Volkov
2016-02-19 19:46     ` Keith Seitz
2016-01-19 18:55   ` [PATCH v2 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_AT_rvalue_reference type Artemiy Volkov
2016-02-19 18:57     ` Keith Seitz
2016-01-19 18:55   ` [PATCH v2 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests Artemiy Volkov
2016-02-19 20:05     ` Keith Seitz
2016-01-19 18:55   ` [PATCH v2 10/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module Artemiy Volkov
2016-02-19 19:48     ` Keith Seitz
2016-02-19 18:49   ` [PATCH v2 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb Keith Seitz
2016-02-23  6:04     ` Artemiy Volkov
2016-03-05  3:20   ` [PATCH v3 " Artemiy Volkov
2016-03-05  3:20     ` [PATCH v3 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref() Artemiy Volkov
2016-03-16 22:22       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 06/11] [PR gdb/14441] gdb: print: implement correct printing of rvalue reference types and values Artemiy Volkov
2016-03-16 22:26       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 09/11] [PR gdb/14441] gdb: convert lvalue reference type check to general reference type check Artemiy Volkov
2016-03-16 22:41       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 10/11] [PR gdb/14441] gdb: gdbtypes: add rvalue references to overloading resolution Artemiy Volkov
2016-03-16 22:45       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests Artemiy Volkov
2016-03-16 22:48       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module Artemiy Volkov
2016-03-16 22:32       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Artemiy Volkov
2016-03-16 22:08       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 05/11] [PR gdb/14441] gdb: demangle: implement demangling for rvalue reference typenames Artemiy Volkov
2016-03-16 22:25       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_AT_rvalue_reference type Artemiy Volkov
2016-03-16 22:28       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type Artemiy Volkov
2016-03-16 22:23       ` Keith Seitz
2016-03-05  3:20     ` [PATCH v3 02/11] [PR gdb/14441] gdb: gdbtypes: change {lookup,make}_reference_type() API Artemiy Volkov
2016-03-16 22:19       ` Keith Seitz
2016-03-20 12:10         ` Artemiy Volkov
2016-03-21 21:02     ` [PATCH v4 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 06/11] [PR gdb/14441] gdb: print: implement correct printing of rvalue reference types and values Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref() Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_TAG_rvalue_reference type Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 02/11] [PR gdb/14441] gdb: gdbtypes: change {lookup,make}_reference_type() API Artemiy Volkov
2016-03-21 21:02       ` [PATCH v4 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module Artemiy Volkov
2016-03-31 20:35         ` Keith Seitz
2016-04-02  8:28           ` Artemiy Volkov
2016-04-02  8:45             ` Artemiy Volkov
2016-03-21 21:03       ` [PATCH v4 05/11] [PR gdb/14441] gdb: demangle: implement demangling for rvalue reference typenames Artemiy Volkov
2016-03-21 21:03       ` [PATCH v4 09/11] [PR gdb/14441] gdb: convert lvalue reference type check to general reference type check Artemiy Volkov
2016-03-31 20:37         ` Keith Seitz
2016-04-02  8:42           ` Artemiy Volkov
2016-03-21 21:03       ` [PATCH v4 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests Artemiy Volkov
2016-03-21 21:15       ` [PATCH v4 10/11] [PR gdb/14441] gdb: gdbtypes: add rvalue references to overloading resolution Artemiy Volkov
2016-03-31 20:35       ` [PATCH v4 00/11] [PR gdb/14441] Support C++0x rvalue references in gdb Keith Seitz
2016-04-02  8:48         ` Artemiy Volkov
2016-04-05 18:23           ` Pedro Alves
2016-04-06  8:31             ` Artemiy Volkov
2016-04-12 11:49               ` Pedro Alves
2016-04-19 15:51                 ` Artemiy Volkov
2016-04-22 11:31                   ` Pedro Alves
2016-06-06 19:22       ` [PATCH v5 00/11] [PR gdb/14441] Support C++11 " Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 02/11] [PR gdb/14441] gdb: gdbtypes: change {lookup,make}_reference_type() API Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 05/11] [PR gdb/14441] gdb: demangle: implement demangling for rvalue reference typenames Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 10/11] [PR gdb/14441] gdb: gdbtypes: add rvalue references to overloading resolution Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 06/11] [PR gdb/14441] gdb: print: implement correct printing of rvalue reference types and values Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_TAG_rvalue_reference type Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests Artemiy Volkov
2016-06-20 19:04           ` Pedro Alves
2016-06-06 19:23         ` [PATCH v5 09/11] [PR gdb/14441] gdb: convert lvalue reference type check to general reference type check Artemiy Volkov
2016-06-06 19:23         ` [PATCH v5 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module Artemiy Volkov
2016-06-20 19:07           ` Pedro Alves
2016-06-06 19:23         ` [PATCH v5 03/11] [PR gdb/14441] gdb: valops: add ability to return rvalue reference values from value_ref() Artemiy Volkov
2016-06-19 15:08         ` [PATCH v5 00/11] [PR gdb/14441] Support C++11 rvalue references in gdb Artemiy Volkov

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).