decomp2dbg icon indicating copy to clipboard operation
decomp2dbg copied to clipboard

Tab completion broken in Archlinux gdb

Open ysf opened this issue 3 years ago • 6 comments

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.

ysf avatar Oct 07 '22 18:10 ysf

Hi @ysf, could you clarify a few things:

  1. You are absolutely certain you are not sourcing anything else?
  2. 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?
  3. Was there any crash from d2d, and do you currently have a binary loaded?

mahaloz avatar Oct 07 '22 18:10 mahaloz

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 avatar Oct 07 '22 19:10 ysf

@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:

  1. Run py print("hello world") to verify your gdb is installed with Python
  2. Try some other plugin like GEF, lmk if you also get this tab error
  3. Maybe tell me how I can get this same version. Hopefully through some distro docker container.

Ty.

mahaloz avatar Oct 07 '22 19:10 mahaloz

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 avatar Oct 07 '22 21:10 ysf

@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.

mahaloz avatar Oct 08 '22 19:10 mahaloz

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.

ysf avatar Oct 09 '22 09:10 ysf

I'm closing this since it seems to have gone stale.

mahaloz avatar Jul 18 '24 17:07 mahaloz