Loading python support in gdb

I am having trouble getting python specific commands working in gdb. I have general python support:

(gdb) python print(True)
True

I have standard scripts installed:

$ ls /usr/share/gdb/python/gdb/
command  FrameDecorator.py  FrameIterator.py  frames.py  function  __init__.py  printer  printing.py  prompt.py  __pycache__  types.py  unwinder.py  xmethod.py

I made sure that the download is enabled with all the paths that I could:

$ cat ~/.gdbinit 
add-auto-load-safe-path /usr/share/gdb/python/gdb/
add-auto-load-safe-path /usr/share/gdb/python/
add-auto-load-safe-path /usr/share/gdb/
set auto-load python-scripts on

But for some reason gdb still doesn't like it:

(gdb) info auto-load 
gdb-scripts:  No auto-load scripts.
guile-scripts:  No auto-load scripts.
libthread-db:  No auto-loaded libthread-db.
local-gdbinit:  Local .gdbinit file was not found.
python-scripts:  No auto-load scripts.

I want the team to py-btwork after loading gdb.

+4
source share

Source: https://habr.com/ru/post/1659667/


All Articles