From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17392 invoked by alias); 22 May 2009 07:49:57 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 17381 invoked by uid 22791); 22 May 2009 07:49:56 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <8ac60eac0905211539n21d9b01ex7f5af97a51a4042@mail.gmail.com> References: <41aa4e6c0905201017j68b44350s2141ef8af6895701@mail.gmail.com> <4A147E6B.6000708@redhat.com> <41aa4e6c0905210244n3dc5ed65m2f42a7c78658b778@mail.gmail.com> <4A158648.1080004@redhat.com> <41aa4e6c0905211001x21a17ab7gebece0b238177061@mail.gmail.com> <8ac60eac0905211539n21d9b01ex7f5af97a51a4042@mail.gmail.com> Date: Fri, 22 May 2009 07:49:00 -0000 Message-ID: <41aa4e6c0905220049p716787c9odd8e936ff4a9b99d@mail.gmail.com> Subject: Re: Archer in Cygwin help From: Sreejith To: Paul Pluzhnikov Cc: Phil Muldoon , archer@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2009-q2/txt/msg00107.txt.bz2 2009/5/22 Paul Pluzhnikov : > On Thu, May 21, 2009 at 10:01 AM, Sreejith = wrote: > >> (gdb) python import gdb.libstdcxx.v6.printers >> Traceback (most recent call last): >> =A0File "", line 1, in >> =A0File "/home/sreejith/archer/install/share/gdb/python/gdb/libstdcxx/v6= /printers >> .py", line 19, in >> =A0 =A0import itertools >> ImportError: No module named itertools >> Error while executing Python code. >> (gdb) > > Please see this message and thread: > http://sources.redhat.com/ml/archer/2008-q4/msg00463.html > > I think you have to either install Python in a place GDB expects it, > or set PYTHONPATH appropriately. Thanks Paul. Before I try your suggestions, I did make install once again for the branch: http://sourceware.org/git/gitweb.cgi?p=3Darcher.git;a=3Dtree;h=3Drefs/heads= /archer-tromey-python;hb=3Darcher-tromey-python This time I could import gdb.libstdcxx.v6.printers which Phil suggested. Still for STL containers, 'print' is not behaving as expected. Please see the log: (gdb) python print 10 10 (gdb) python import gdb.libstdcxx.v6.printers (gdb) (gdb) l 1 #include 2 3 using namespace std; 4 5 int main() 6 { 7 list myList; 8 for(int i=3D0; i<10; i++) 9 { 10 myList.push_back(i); (gdb) l 11 } 12 return 0; 13 } 14 (gdb) break 12 Breakpoint 1 at 0x401139: file list.cpp, line 12. (gdb) run Starting program: /cygdrive/c/eclipse/archer-build/src/a.exe [New Thread 3912.0x172c] [New Thread 3912.0x104c] Breakpoint 1, main () at list.cpp:12 12 return 0; (gdb) python print myList Traceback (most recent call last): File "", line 1, in NameError: name 'myList' is not defined Error while executing Python code. (gdb) print myList $1 =3D {<_List_base >> =3D { _M_impl =3D { >> =3D { >> =3D {}, }, _M_node =3D { _M_next =3D 0x682150, _M_prev =3D 0x6821e0}}}, } (gdb) Looks like libstdcxx.v6.printers are not known to gdb. I am wondering how importing libstdcxx.v6.printers alone tells gdb to use new python printers for STL. Do I need to execute some register command after importing libstdcxx.v6.printers? Please give your suggestions. -Sreejith