Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 663388 - dev-util/crash: want USE=python
Summary: dev-util/crash: want USE=python
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords: Goal
Depends on:
Blocks:
 
Reported: 2018-08-11 21:32 UTC by Richard Yao (RETIRED)
Modified: 2018-08-11 22:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2018-08-11 21:32:49 UTC
Trying to run a python helper that I have for gdb gives me this lovely message:

> Python scripting is not supported in this copy of GDB.

The makefile has the configure option for the bundled gdb version hard set to turn off python support. I'd like a USE flag for this. That way I can use this lovely script to aid with debugging:

define lx-add-module-symbols
        set $current = modules.next
        set $offset =  ((int)&((struct module *)0).list)
 
    while($current.next != modules.next)
                eval "python from subprocess import check_output; info = check_output(\"modinfo -k %s -n %s\", shell=True).strip().decode(\"ascii\"); gdb.execute('add-symbol-file ' + info + ' %p' )\n", \
                        init_uts_ns.name.release, \
                        ((struct module *) (((void *) ($current)) - $offset ) )->name ,\
                        ((struct module *) (((void *) ($current)) - $offset ) )->core_layout.base
                set $current = $current.next 
        end
end
Comment 1 Richard Yao (RETIRED) gentoo-dev 2018-08-11 22:46:35 UTC
Turning on python support has problems because the bundled gdb will use the python bits from the system gdb:

Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/__init__.py", line 144, in auto_load_packages
    __import__(modname)
  File "/usr/share/gdb/python/gdb/command/explore.py", line 756, in <module>
    Explorer.init_env()
  File "/usr/share/gdb/python/gdb/command/explore.py", line 135, in init_env
    gdb.TYPE_CODE_RVALUE_REF : ReferenceExplorer,
AttributeError: 'module' object has no attribute 'TYPE_CODE_RVALUE_REF'

There is also another issue involving COMPLETE_EXPRESSION, but that can be remedied by putting `python gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL` into ~/.gdbinit.

crash uses a bundled gdb 7.6, so having gdb 8.1 like I have breaks things. This will need changes to install its own bits and use those if python support is added.
Comment 2 Richard Yao (RETIRED) gentoo-dev 2018-08-11 22:52:53 UTC
I am going to close this. The `mod` command will do what I want. I had forgotten about it.