From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14619 invoked by alias); 22 Dec 2007 05:24:22 -0000 Received: (qmail 14610 invoked by uid 22791); 22 Dec 2007 05:24:22 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.182) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 22 Dec 2007 05:24:17 +0000 Received: by wa-out-1112.google.com with SMTP id l35so946189waf.12 for ; Fri, 21 Dec 2007 21:24:16 -0800 (PST) Received: by 10.114.88.1 with SMTP id l1mr2363083wab.79.1198301056310; Fri, 21 Dec 2007 21:24:16 -0800 (PST) Received: by 10.114.122.3 with HTTP; Fri, 21 Dec 2007 21:24:16 -0800 (PST) Message-ID: <8b685e3f0712212124n64194bc7je86bede3a21c3826@mail.gmail.com> Date: Sat, 22 Dec 2007 05:24:00 -0000 From: "jian shen" To: gdb@sourceware.org Subject: gdb cannot understand some type with STL MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00163.txt.bz2 Hi gdb version: 6.6 gcc version: 3.3.6 qt version: 3.1 Everything is correct when I use qt container: testcase 1: ----- qt.cpp ----- #include #include #include int main() { QValueList l; l.push_back(1); l.push_back(2); QMap m; m["a1"] = 1; m["a2"] = 2; } ----- qt.cpp ----- (gdb) whatis QValueList type = QValueList (gdb) whatis QValueList* type = QValueList * (gdb) whatis QValueListNode type = QValueListNode (gdb) whatis QValueListNode* type = QValueListNode * (gdb) whatis QMap type = QMap (gdb) whatis QMap* type = QMap * (gdb) whatis QMapNode type = QMapNode (gdb) whatis QMapNode* type = QMapNode * but some problems in stl container: testcase 2: ----- stl.cpp ----- #include #include #include int main() { std::list l; l.push_back(1); l.push_back(2); std::map m; m["a1"] = 1; m["a2"] = 2; } ----- stl.cpp ----- (gdb) whatis std::list No symbol "list" in namespace "std". (gdb) whatis std::list* A syntax error in expression, near `'. (gdb) whatis std::_List_node type = std::_List_node (gdb) whatis std::_List_node* A syntax error in expression, near `'. (gdb) whatis std::map No symbol "map" in namespace "std". (gdb) whatis std::map* A syntax error in expression, near `'. (gdb) whatis std::_Rb_tree_node > type = std::_Rb_tree_node > (gdb) whatis std::_Rb_tree_node > * A syntax error in expression, near `'. Most of the type become unidentifiable, which makes me difficult to write a gdb script, for example, with qt, I can: (gdb) set $a=(QValueListNode*)0 (gdb) p $a $1 = (QValueListNode *) 0x0 but with stl: (gdb) set $a=(std::_List_node*)0 A syntax error in expression, near `)0'. Is this a bug in gdb or gcc? Any other choice I can try for this problem? Thanks, Jian