public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/66069] New: New -fkeep-all-method-instances
@ 2015-05-08 8:11 jan.kratochvil at redhat dot com
2015-05-08 8:44 ` [Bug debug/66069] " jan.kratochvil at redhat dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2015-05-08 8:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66069
Bug ID: 66069
Summary: New -fkeep-all-method-instances
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: jan.kratochvil at redhat dot com
Target Milestone: ---
Target: x86_64-linux-gnu
For debugging (-O0 -g) code there could be a way to provide all instantiable
methods for TYPE when anything from template<TYPE> gets used. The problem:
-------------------------------------------------------------------------------
1 #include <memory>
2 class C { public: int i; };
3 int main() {
4 std::unique_ptr<C> cp(new C());
5 return cp->i;
6 }
(gdb) p cp
$1 = std::unique_ptr<C> containing 0x603010
(gdb) p *cp
Could not find operator*.
-------------------------------------------------------------------------------
compiled-in:
std::unique_ptr<C, std::default_delete<C> >::get() const
std::unique_ptr<C, std::default_delete<C> >::get_deleter()
std::unique_ptr<C, std::default_delete<C> >::operator->() const
std::unique_ptr<C, std::default_delete<C> >::unique_ptr(C*)
std::unique_ptr<C, std::default_delete<C> >::~unique_ptr()
-------------------------------------------------------------------------------
The current workaround:
-------------------------------------------------------------------------------
1 #include <memory>
2 class C { public: int i; };
3 int main() {
4 std::unique_ptr<C> cp(new C());
5 __attribute__((unused)) const C &gdbstub(*cp);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 return cp->i;
7 }
(gdb) p *cp
$1 = (C &) @0x603010: {i = 0}
-------------------------------------------------------------------------------
added method:
std::unique_ptr<C, std::default_delete<C> >::operator*() const
-------------------------------------------------------------------------------
Similar problems are with operator[], operator-> for maps etc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug debug/66069] New -fkeep-all-method-instances
2015-05-08 8:11 [Bug debug/66069] New: New -fkeep-all-method-instances jan.kratochvil at redhat dot com
@ 2015-05-08 8:44 ` jan.kratochvil at redhat dot com
2015-05-08 13:04 ` manu at gcc dot gnu.org
2015-05-08 13:17 ` jan.kratochvil at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2015-05-08 8:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66069
Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Version|6.0 |5.1.1
Resolution|--- |INVALID
--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
PASS: gcc-5.1.1-1.fc22.x86_64
FAIL: gcc-4.9.2-6.fc21.x86_64
It is in fact already fixed thanks to Python xmethods.
The option would still make some sense for custom non-libstdc++ templates if
one does not write xmethods for them but that has probably only marginal
usefulness.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug debug/66069] New -fkeep-all-method-instances
2015-05-08 8:11 [Bug debug/66069] New: New -fkeep-all-method-instances jan.kratochvil at redhat dot com
2015-05-08 8:44 ` [Bug debug/66069] " jan.kratochvil at redhat dot com
@ 2015-05-08 13:04 ` manu at gcc dot gnu.org
2015-05-08 13:17 ` jan.kratochvil at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu.org @ 2015-05-08 13:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66069
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Jan Kratochvil from comment #1)
> The option would still make some sense for custom non-libstdc++ templates if
> one does not write xmethods for them but that has probably only marginal
> usefulness.
'compile print' in C++ will fix that, no?
>From gcc-bugs-return-485847-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 08 13:05:10 2015
Return-Path: <gcc-bugs-return-485847-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 72082 invoked by alias); 8 May 2015 13:05:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 71886 invoked by uid 48); 8 May 2015 13:05:06 -0000
From: "rstrankle1 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66072] New: Trying to compile a makefile in c++, error in Description
Date: Fri, 08 May 2015 13:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rstrankle1 at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-66072-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg00687.txt.bz2
Content-length: 694
https://gcc.gnu.org/bugzilla/show_bug.cgi?idf072
Bug ID: 66072
Summary: Trying to compile a makefile in c++, error in
Description
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rstrankle1 at gmail dot com
Target Milestone: ---
#0 0x00007ffff75079bc in free () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x0000000000401359 in addPolicy(int, int (*) [5], int&) ()
#2 0x00000000004017c0 in fillUpPolicyRiskTable(int (*) [5], int&) ()
#3 0x0000000000401b29 in main ()
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug debug/66069] New -fkeep-all-method-instances
2015-05-08 8:11 [Bug debug/66069] New: New -fkeep-all-method-instances jan.kratochvil at redhat dot com
2015-05-08 8:44 ` [Bug debug/66069] " jan.kratochvil at redhat dot com
2015-05-08 13:04 ` manu at gcc dot gnu.org
@ 2015-05-08 13:17 ` jan.kratochvil at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2015-05-08 13:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66069
Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pmuldoon at redhat dot com
--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
I think so but that would require the source files available.
So far 'compile print' (for C) generates all the context only from DWARF - this
case was this PR's goal.
The source files may not match well for *-debuginfo.rpm packaged binaries but
IMO there is no chance for more complex debugging due to the -O2 -g debug info
limitations.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-08 13:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-08 8:11 [Bug debug/66069] New: New -fkeep-all-method-instances jan.kratochvil at redhat dot com
2015-05-08 8:44 ` [Bug debug/66069] " jan.kratochvil at redhat dot com
2015-05-08 13:04 ` manu at gcc dot gnu.org
2015-05-08 13:17 ` jan.kratochvil at redhat 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).