This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/11567] New: GDB should only print namespace of types when there is an ambiguity by default
- From: "k04jg02 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 4 May 2010 19:00:05 -0000
- Subject: [Bug c++/11567] New: GDB should only print namespace of types when there is an ambiguity by default
- Reply-to: sourceware-bugzilla at sourceware dot org
One of the issues that makes C++ template code hard to read is that often the
templates and their type parameters are nested several levels deep in
namespaces. For example, here is an excerpt from a recent stack trace:
#8 0x0806a7fb in shmarmy::GarbageCollector<shmarmy::SHMStream<MyStreamNodeTest,
shmarmy::WriteSegment, 4u, 5u>, shmarmy::SHMStream<MyStreamUpdate,
shmarmy::WriteSegment, 4u, 5u>
>::tryDeleteHead<shmarmy::SHMStream<MyStreamNodeTest, shmarmy::WriteSegment, 4u,
5u>, MyStreamNodeTest> (this=0x80845a0, stream=..., head=0xf1e094f8,
prev_deleted_item=@0x8083f70, dont_delete=0x0)
In my app the only time there is any class or template named GarbageCollector or
WriteSegment or SHMStream is inside the shmarmy namespace. As long as there's no
ambiguity, it would be much easier to read if it looked like this:
#8 0x0806a7fb in GarbageCollector<SHMStream<MyStreamNodeTest, WriteSegment, 4u,
5u>, SHMStream<MyStreamUpdate, WriteSegment, 4u, 5u>
>::tryDeleteHead<SHMStream<MyStreamNodeTest, WriteSegment, 4u, 5u>,
MyStreamNodeTest> (this=0x80845a0, stream=..., head=0xf1e094f8,
prev_deleted_item=@0x8083f70, dont_delete=0x0)
Knowing the namespace even with no ambiguity could maybe be useful (maybe if
you're not sure which file you included somehow? not sure), so I'd suggest
having the current behavior be an option.
--
Summary: GDB should only print namespace of types when there is
an ambiguity by default
Product: gdb
Version: 6.8
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at sourceware dot org
ReportedBy: k04jg02 at gmail dot com
CC: gdb-prs at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=11567
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.