public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Sreejith <sreejithsmadhavan@gmail.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: Phil Muldoon <pmuldoon@redhat.com>, archer@sourceware.org
Subject: Re: Archer in Cygwin help
Date: Fri, 22 May 2009 07:49:00 -0000	[thread overview]
Message-ID: <41aa4e6c0905220049p716787c9odd8e936ff4a9b99d@mail.gmail.com> (raw)
In-Reply-To: <8ac60eac0905211539n21d9b01ex7f5af97a51a4042@mail.gmail.com>

2009/5/22 Paul Pluzhnikov <ppluzhnikov@google.com>:
> On Thu, May 21, 2009 at 10:01 AM, Sreejith <sreejithsmadhavan@gmail.com> wrote:
>
>> (gdb) python import gdb.libstdcxx.v6.printers
>> Traceback (most recent call last):
>>  File "<string>", line 1, in <module>
>>  File "/home/sreejith/archer/install/share/gdb/python/gdb/libstdcxx/v6/printers
>> .py", line 19, in <module>
>>    import 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=archer.git;a=tree;h=refs/heads/archer-tromey-python;hb=archer-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 <list>
2
3       using namespace std;
4
5       int main()
6       {
7               list<int> myList;
8               for(int i=0; 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 "<string>", line 1, in <module>
NameError: name 'myList' is not defined
Error while executing Python code.
(gdb) print myList
$1 = {<_List_base<int, std::allocator<int> >> = {
    _M_impl = {<allocator<std::_List_node<int> >> =
{<new_allocator<std::_List_node<int> >> = {<No data fields>}, <No data
fields>}, _M_node = {
        _M_next = 0x682150, _M_prev = 0x6821e0}}}, <No data fields>}
(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

  reply	other threads:[~2009-05-22  7:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 17:18 Sreejith
2009-05-20 22:04 ` Phil Muldoon
2009-05-21  9:44   ` Sreejith
2009-05-21 16:50     ` Phil Muldoon
2009-05-21 17:02       ` Sreejith
2009-05-21 22:40         ` Paul Pluzhnikov
2009-05-22  7:49           ` Sreejith [this message]
2009-05-22  8:26             ` Phil Muldoon
2009-05-22  8:42               ` Sreejith
2009-05-22 15:33                 ` Sreejith
2009-05-27 17:07                   ` Tom Tromey
2009-05-28 13:58                     ` Sreejith
2009-06-01 16:39                       ` Tom Tromey
2009-06-04 11:34                         ` Sreejith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41aa4e6c0905220049p716787c9odd8e936ff4a9b99d@mail.gmail.com \
    --to=sreejithsmadhavan@gmail.com \
    --cc=archer@sourceware.org \
    --cc=pmuldoon@redhat.com \
    --cc=ppluzhnikov@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).