This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/2] PR debug/63240 Add DWARF representation for C++11 defaulted member function.
- From: Siva Chandra <sivachandra at google dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Cary Coutant <ccoutant at google dot com>, Mark Wielaard <mjw at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>, Dodji Seketeli <dodji at redhat dot com>
- Date: Tue, 7 Oct 2014 06:36:31 -0700
- Subject: Re: [PATCH 2/2] PR debug/63240 Add DWARF representation for C++11 defaulted member function.
- Authentication-results: sourceware.org; auth=none
- References: <1412341922-7891-1-git-send-email-mjw at redhat dot com> <1412341922-7891-2-git-send-email-mjw at redhat dot com> <542EB00A dot 8040605 at redhat dot com> <1412346943 dot 5933 dot 36 dot camel at bordewijk dot wildebeest dot org> <542EB895 dot 2020705 at redhat dot com> <1412357525 dot 5933 dot 38 dot camel at bordewijk dot wildebeest dot org> <CAHACq4qATvGbJ6AdAM5_piksfUOaTfsif9Wpq6vDwOfszQtFQw at mail dot gmail dot com> <542EFCE2 dot 703 at redhat dot com> <CAGyQ6gwLqZnMv1PmMq=qg_aoKMJ3Ttd44vmn6kFJc3c9wyOzDg at mail dot gmail dot com> <543038ED dot 3030201 at redhat dot com> <CAGyQ6gzic=A2pkE2RjJV+B=EvCL+DxscPWs4Yqx2NF+dPH9oDw at mail dot gmail dot com> <54333A0D dot 8020700 at redhat dot com>
On Mon, Oct 6, 2014 at 5:55 PM, Jason Merrill <email@example.com> wrote:
> On 10/06/2014 08:50 PM, Siva Chandra wrote:
>> But, the question is whether it is required to determine the parameter
>> passing ABI. If there is no special marker to indicate that the user
>> declared 'tor is explicitly defaulted, then GDB could (in the absence
>> of other properties which make the 'tor non-trivial) incorrectly
>> conclude that the the 'tor is user defined, and hence not-trivial.
> I've been thinking that we should just mark the 'tor as trivial or not
> directly rather than hint at it. Does GDB have enough information to
> determine triviality if we just add defaulted info?
Barring some incompleteness, for which patches are very close to
getting committed, I believe GDB has the rest of the information.
After those patches are committed, the algorithm used by GDB to
determine whether a value is returned in a hidden param or not is as
1. If the value is of a dynamic class (as in, has virtual bases or
virtual functions), return in hidden param.
2. Else, go over all methods that are found in the DWARF:
----2a. If a method is marked artificial, ignore it.
----2b. If the method is a copy-constructor or a destructor, conclude
that a pointer to the value is to be returned in the hidden first
-------- This is because, presence of a copy-ctor or dtor which are
nor artificial indicates that they were user declared and not
3. If a decision was not made in 2, do 1 and 2 for base class
subobjects and non-static members.
4. If a decision was not made in 3, then conclude that it should not
be passed in a hidden param.
If an explicitly defaulted copy-ctor or dtor is not marked as such,
step 2 is broken.