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
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.
I am going to close this. The `mod` command will do what I want. I had forgotten about it.