1

I have a problem with the "pretty printer" option of IDE NSight (eclipse) when I try to debug. I have googled but I have not found a solution to my problem.

When I start to debug, appears the next message:

Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py", line 64, in <module>
    register_libstdcxx_printers(gdb.current_objfile())
  File "/usr/lib/x86_64-linux-gnu/../../share/gcc-5/python/libstdcxx/v6/__init__.py", line 33, in register_libstdcxx_printers
    register_libstdcxx_xmethods(obj)
  File "/usr/lib/x86_64-linux-gnu/../../share/gcc-5/python/libstdcxx/v6/xmethods.py", line 600, in register_libstdcxx_xmethods
    gdb.xmethod.register_xmethod_matcher(locus, ArrayMethodsMatcher())
  File "/usr/share/gdb/python/gdb/xmethod.py", line 266, in register_xmethod_matcher
    index = _lookup_xmethod_matcher(locus, matcher.name)
  File "/usr/share/gdb/python/gdb/xmethod.py", line 236, in _lookup_xmethod_matcher
    for i in range(0, len(locus.xmethods)):
AttributeError: 'gdb.Objfile' object has no attribute 'xmethods'

I'm not sure where is the problem but the variables values doesn't appear and the only solution is to disable the pretty print option.

I'm using Ubuntu 16.04 and the cuda toolkit was installed from repositories.

If anyone can help, I will be very grateful.

Eric Hein
  • 351
  • 2
  • 10
SolidusAbi
  • 43
  • 9
  • 1
    I have just encountered this issue as well. It has nothing to do with eclipse or nsight, it happens even when I run from the command line. – Eric Hein Aug 04 '16 at 20:19

1 Answers1

0

This sounds like a bug in your gdb installation. gdb.Objfile.xmethods is something that should be provided by the gdb core, which implements gdb.Objfile. So, examining it from /usr/share/gdb/python/gdb/xmethod.py should be ok -- because that is also a file that comes with gdb.

Tom Tromey
  • 21,507
  • 2
  • 45
  • 63
  • So perhaps Ubuntu 16.04 has a bugged gdb install? – Eric Hein Aug 04 '16 at 20:26
  • I couldn't say, but that's one possibility. Another is that somehow you're running one version of gdb with another gdb's python library. – Tom Tromey Aug 05 '16 at 01:42
  • 1
    That sounds right, this is cuda-gdb using python pretty printers from vanilla gdb. There's no good reason for this not to work, it's probably just a version mismatch. Someone should file a bug on the cuda-gdb package in Ubuntu 16.04. – Eric Hein Aug 05 '16 at 17:53