Bug 11907 - cp_demangled_name_to_comp reports syntax error if template_arg is a function decl
Summary: cp_demangled_name_to_comp reports syntax error if template_arg is a function ...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.1
: P3 normal
Target Milestone: 15.1
Assignee: Tom Tromey
URL:
Keywords:
: 22411 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-11 21:29 UTC by Robert Pintarelli
Modified: 2024-05-14 20:02 UTC (History)
3 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Pintarelli 2010-08-11 21:29:47 UTC
if cp_demangled_name_to_comp with demangled_name 
"std::deque<boost::function<void()>, std::allocator<boost::function<void()> > >"
then a 'syntax error' error message is generated.

how to reproduce:
install python pretty-printers as described here: 
http://sourceware.org/gdb/wiki/STLSupport

test-program:
#include <deque>
#include <boost/function.hpp>

int main() {
        std::deque<boost::function<void()> > dek;
        return dek.size();
}

debug program and try to 'print dek'

suggested solution:

adding "function" to the alternatives of the
template_arg production in cp-name-parser.y should fix this problem
Comment 1 Tom Tromey 2024-04-20 16:44:51 UTC
*** Bug 22411 has been marked as a duplicate of this bug. ***
Comment 2 Sourceware Commits 2024-05-14 20:01:17 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3b099df59c47c4f09da0941c096098dde00a87dc

commit 3b099df59c47c4f09da0941c096098dde00a87dc
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Apr 20 10:44:13 2024 -0600

    Allow function types as template parameters in name canonicalizer
    
    This adds function types as template parameters in the C++ name
    canonicalizer.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=11907
    Approved-By: John Baldwin <jhb@FreeBSD.org>
Comment 3 Tom Tromey 2024-05-14 20:02:12 UTC
Fixed.