Skip to content

Python exception "AttributeError: module 'gdb' has no attribute 'Register'" #44

Description

@agentzh

First of all, thank you for creating this debugger!

I'm trying out pycrash on Fedora 30 using the latest master branches of libdumpfile and this project but hit by a weird Python exception:

$ ./pycrash -m ~/tmp ~/tmp/./usr/lib/debug/lib/modules/2.6.32-754.24.3.el6.x86_64/vmlinux ~/tmp/bad-centos6-test2.core
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "./build/lib/crash/__init__.py", line 5, in <module>
    import kdump.target
  File "./build/lib/kdump/target.py", line 16, in <module>
    TargetFetchRegisters = Callable[[gdb.InferiorThread, gdb.Register], None]
AttributeError: module 'gdb' has no attribute 'Register'
./test-gdb-compatibility.gdbinit:16: Error in sourced command file:
Error while executing Python code.
fatal: crash-python cannot initialize

How to work around this please? Thanks for your attention!

Activity

  1. tehcaster commented on May 7, 2020

    @tehcaster
    Member

    Hi, sounds like you don't have the patched gdb that's required?

  2. problame commented on Feb 18, 2021

    @problame

    I am hitting the same issue on Debian bullseye.

    cs@debian-zfs-devel:[~/src/crash-python]: dpkg -l gdb
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version      Architecture Description
    +++-==============-============-============-=================================
    ii  gdb            10.1-1.7     amd64        GNU Debugger
    

    The docs only mention that gdb with python extensions and python >= 3.6 is required. AFAIK that is the case on my system. Still, I get that error.

  3. tehcaster commented on Feb 23, 2021

    @tehcaster
    Member

    It's a bit unclear but it doesn't mean the standard python API in gdb, but extended with more patches, with a link to https://github.com/crash-python/gdb-python/tree/gdb-9.1-target that has them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions