Tab completion broken in Archlinux gdb
After sourcing decomp2dbg in my gdbinit I have the commands available but it's not possible anymore to use tab-completion to look for help or alike. This happens with a naked gdb with source ~/.decomp2dbg.py as only entry.
Hi @ysf, could you clarify a few things:
- You are absolutely certain you are not sourcing anything else?
- When you say you can't tab-complete things anymore, can you give some examples?
- Is it symbols that don't tab complete?
- Is it gdb commands that don't tab complete?
- Is it file names?
- Was there any crash from d2d, and do you currently have a binary loaded?
Hey, thanks for the quick reply.
- I'm absolutely certain that nothing else but decomp2dbg is loaded. Neither systems gdbinit nor this of my user has any further lines.
- I'm not connected to a decompiler (binja) yet.
- I can't complete anything, when I hit tab, an original tab is expressed. means, 8 spaces appear between what I've written so far and the new cursor position.
- no file names, no command help, no symbols.
- i did it with and without binary loaded, and it did not work either way.
- I have no crash output or alike from d2d. Do I have to enable them?
- GDB 12.1
@ysf I see. Is this a gdb that is installed in some OS by default? On Ubuntu 22.04 I see 12.0.90. I'm not able to reproduce this on my version with only d2d loaded in vanilla in gdb.
Would you be able to do this:
- Run
py print("hello world")to verify your gdb is installed with Python - Try some other plugin like GEF, lmk if you also get this tab error
- Maybe tell me how I can get this same version. Hopefully through some distro docker container.
Ty.
Hey @mahaloz
I'm using Archlinux with LTS-Kernel. Everything uptodate.
Maybe this is of help to you for debugging: If I comment out the imports from elftools.elf.elffile import ELFFile it works. I don't think that elffile is broken, but maybe something when d2d is using it?
@ysf unfortunately, I still can't reproduce this issue. I've made a Dockerfile to replicate your system:
from archlinux
ENV DEBIAN_FRONTEND=noninteractive
run yes | pacman -Syu
run yes | pacman -Sy python3 python-pip gdb
copy . /d2d
run pip install -e /d2d
run echo "source /d2d/decomp2dbg.py" >> ~/.gdbinit
Place that Dockerfile in the root or decomp2dbg then run:
docker build . -t d2d && docker run -it --rm d2d
I then load a binary, and autocomplete still works gdb /bin/true. The system gdb on this image is 12.1 as well.
Without being able to replicate it I can only say it seems to be something with your individual system. Maybe try making a new python virtual env and then installing and running gdb. It may be some strange package conflict.
However, if you can reproduce it on this docker image lmk and I can look into it.
Thanks a lot @mahaloz I will investigate this when I've time and report. Sorry for bothering you when it seems to be a local issue.
I'm closing this since it seems to have gone stale.