longld / peda

PEDA - Python Exploit Development Assistance for GDB
Other
5.87k stars 806 forks source link

undefined command...peda help #144

Open Janette88 opened 4 years ago

Janette88 commented 4 years ago

hi, i have a problem. when i was debugging a program using gdb-peda, i got a feedback like this: gdb-peda$ attach 1584 'Undefined command: c\x00\x00\x00o\x00\x00\x00n\x00\x00\x00t\x00\x00\x00e\x00\x00\x00x\x00\x00\x00t\x00\x00\x00. Try "peda help"' 'Undefined command: s\x00\x00\x00e\x00\x00\x00s\x00\x00\x00s\x00\x00\x00i\x00\x00\x00o\x00\x00\x00n\x00\x00\x00. Try "peda help"'

before debugging, i fininshed the installation of peda: git clone https://github.com/longld/peda.git ~/peda echo "source ~/peda/peda.py" >> ~/.gdbinit

what's wrong with my peda? please help me!

Janette88 commented 4 years ago

my python version is : Python 2.7.2+ (default, Oct 4 2011, 20:03:08) gdb version is: fusion@fusion:~$ gdb -v GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08

bb33bb commented 4 years ago

my python version is : Python 2.7.2+ (default, Oct 4 2011, 20:03:08) gdb version is: fusion@fusion:~$ gdb -v GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08

我猜测根本原因在于编译python的时候你忘了添加一个选项。最初我也遇到了这个错误,编译python的时候,添加上这句话 ../configure --prefix=/usr/local --enable-optimizations --enable-unicode=ucs4