Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Tom Tromey (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>,
	gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [review] infcall, c++: collect more pass-by-reference information
Date: Tue, 29 Oct 2019 22:13:00 -0000	[thread overview]
Message-ID: <20191029221302.7108420AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571406803000.Ic05bd98a962d07ec3c1ad041f709687eabda3bb9@gnutoolchain-gerrit.osci.io>

Tom Tromey has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/137
......................................................................


Patch Set 1: Code-Review+1

(3 comments)

Thank you.  I appreciate what you've done here (in particular the comment
on the test case, but really all of it looks quite good).
There were some nits in this one so I am marking it +1.

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/137/1/gdb/gnu-v3-abi.c 
File gdb/gnu-v3-abi.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/137/1/gdb/gnu-v3-abi.c@1321 
PS1, Line 1321: 
1296 | is_copy_or_move_constructor_type (struct type *class_type,
     | ...
1316 |      then this is not a copy or move constructor, but just a
1317 |      constructor.  */
1318 |   for (int i = 2; i < TYPE_NFIELDS (method_type); i++)
1319 |     {
1320 |       arg_type = TYPE_FIELD_TYPE (method_type, i);
1321 |       /* FIXME taktemur/2019-04-23: As of this date, neither
1322 | 	 clang++-7.0.0 nor g++-8.2.0 produce a DW_AT_default_value
1323 | 	 attribute.  GDB is also not set to read this attribute, yet.
1324 | 	 Hence, we immediately return false if there are more than
1325 | 	 2 parameters.  */

It would be good to ensure that there is a gcc bug report
for this, and then link to the bug from this comment.


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/137/1/gdb/gnu-v3-abi.c@1413 
PS1, Line 1413: 
1371 | gnuv3_pass_by_reference (struct type *type)
     | ...
1404 |       has_cc_attr = true;
1405 |       is_pass_by_value = false;
1406 |     }
1407 | 
1408 |   /* A dynamic class has a non-trivial copy constructor.
1409 |      See c++98 section 12.8 Copying class objects [class.copy].  */
1410 |   if (gnuv3_dynamic_class (type))
1411 |     is_dynamic = true;
1412 | 
1413 |   /* FIXME taktemur/2019-04-23: What if there are multiple copy ctors?

I think it would be good to answer this before landing.
Maybe we need to do overload resolution?


https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/137/1/gdb/gnu-v3-abi.c@1495 
PS1, Line 1495: 
1371 | gnuv3_pass_by_reference (struct type *type)
     | ...
1486 |      about recursive loops here, since we are only looking at members
1487 |      of complete class type.  Also ignore any static members.  */
1488 |   for (fieldnum = 0; fieldnum < TYPE_NFIELDS (type); fieldnum++)
1489 |     if (!field_is_static (&TYPE_FIELD (type, fieldnum)))
1490 |       {
1491 | 	struct type *field_type = TYPE_FIELD_TYPE (type, fieldnum);
1492 | 
1493 | 	/* For arrays, make the decision based on the element type.  */
1494 | 	if (TYPE_CODE (field_type) == TYPE_CODE_ARRAY)
1495 | 	  field_type = field_type->main_type->target_type;

I think it's more usual to use the TYPE_TARGET_TYPE
accessor here.  Also normally one must call check_typedef
on the result.



-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ic05bd98a962d07ec3c1ad041f709687eabda3bb9
Gerrit-Change-Number: 137
Gerrit-PatchSet: 1
Gerrit-Owner: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Tue, 29 Oct 2019 22:13:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


  parent reply	other threads:[~2019-10-29 22:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 13:53 Tankut Baris Aktemur (Code Review)
2019-10-18 14:08 ` Tankut Baris Aktemur (Code Review)
2019-10-29 22:13 ` Tom Tromey (Code Review) [this message]
2019-11-12 15:22 ` Tankut Baris Aktemur (Code Review)
2019-12-09 17:45 ` [review v2] " Tankut Baris Aktemur (Code Review)
2019-12-09 17:55 ` Tankut Baris Aktemur (Code Review)
2019-12-13 21:33 ` Tom Tromey (Code Review)
2019-12-20 16:47 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-20 16:53 ` Sourceware to Gerrit sync (Code Review)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191029221302.7108420AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    --cc=tankut.baris.aktemur@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox