Open aNaoy opened 6 months ago
can confirm. Arch, gdb 14.2:
$ cat .gdbinit
set debuginfod enabled on
set disassembly-flavor intel
source ~/.peda/peda.py
$ gdb
/home/olk/.peda/peda.py:151: SyntaxWarning: invalid escape sequence '\['
p = re.compile("(.*)\[(.*)\]") # DWORD PTR [esi+eax*1]
/home/olk/.peda/peda.py:373: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*exec file:\s*`(.*)'")
/home/olk/.peda/peda.py:550: SyntaxWarning: invalid escape sequence '\d'
p = re.compile("^(\d*)\s*(.*breakpoint)\s*(keep|del)\s*(y|n)\s*(0x[^ ]*)\s*(.*)")
/home/olk/.peda/peda.py:554: SyntaxWarning: invalid escape sequence '\d'
p = re.compile("^(\d*)\s*(.*point)\s*(keep|del)\s*(y|n)\s*(.*)")
/home/olk/.peda/peda.py:567: SyntaxWarning: invalid escape sequence '\d'
m = re.match("in.*at(.*:\d*)", what)
/home/olk/.peda/peda.py:596: SyntaxWarning: invalid escape sequence '\d'
m = re.match("^(\d*).*", line)
/home/olk/.peda/peda.py:916: SyntaxWarning: invalid escape sequence '\s'
p = re.compile("\s*(0x[^ ]*).*?:\s*([^ ]*)\s*(.*)")
/home/olk/.peda/peda.py:918: SyntaxWarning: invalid escape sequence '\s'
p = re.compile("(.*?)\s*<.*?>\s*([^ ]*)\s*(.*)")
/home/olk/.peda/peda.py:937: SyntaxWarning: invalid escape sequence '\['
p = re.compile(".*mov.*\[esp(.*)\],")
/home/olk/.peda/peda.py:969: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(":\s*([^ ]*)\s*(.*),")
/home/olk/.peda/peda.py:1116: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?:\s*(.*)")
/home/olk/.peda/peda.py:1223: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?:\s*[^ ]*\s*(.* PTR ).*(0x[^ ]*)")
/home/olk/.peda/peda.py:1226: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?:\s.*\s(0x[^ ]*|\w+)")
/home/olk/.peda/peda.py:1235: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?:\s*[^ ]*\s*(.* PTR ).*\[(.*)\]")
/home/olk/.peda/peda.py:1430: SyntaxWarning: invalid escape sequence '\s'
pattern = re.compile("([^\n]*)\s* ([0-9a-f][^-\s]*)-([^\s]*) \[.*\]\s([^/]*).* (.*)")
/home/olk/.peda/peda.py:2096: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?0x[^ ]*?\s(.*)")
/home/olk/.peda/peda.py:2114: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?0x[^ ]*?\s(.*)")
/home/olk/.peda/peda.py:2214: SyntaxWarning: invalid escape sequence '\s'
p = re.compile("Entry point: ([^\s]*)")
/home/olk/.peda/peda.py:2242: SyntaxWarning: invalid escape sequence '\s'
p = re.compile("\s*(0x[^-]*)->(0x[^ ]*) at (0x[^:]*):\s*([^ ]*)\s*(.*)")
/home/olk/.peda/peda.py:2316: SyntaxWarning: invalid escape sequence '\s'
m = re.findall(".*(0x[^ ]*)\s*%s" % re.escape(symname), out)
/home/olk/.peda/peda.py:2416: SyntaxWarning: invalid escape sequence '\['
p = re.compile(".*\[.*\] (\.[^ ]*) [^0-9]* ([^ ]*) [^ ]* ([^ ]*)(.*)")
/home/olk/.peda/peda.py:2474: SyntaxWarning: invalid escape sequence '\s'
p = re.compile("[^\n]*\s*(0x[^ ]*) - (0x[^ ]*) is (\.[^ ]*) in (.*)")
/home/olk/.peda/peda.py:2681: SyntaxWarning: invalid escape sequence '\ '
if re.search(re.escape(asmcode).replace("\ ",".*").replace("\?",".*"), asmcode_rs)\
/home/olk/.peda/peda.py:2681: SyntaxWarning: invalid escape sequence '\?'
if re.search(re.escape(asmcode).replace("\ ",".*").replace("\?",".*"), asmcode_rs)\
/home/olk/.peda/peda.py:2832: SyntaxWarning: invalid escape sequence '\ '
pattern = re.compile(b'|'.join(JMPCALL).replace(b' ', b'\ '))
/home/olk/.peda/peda.py:3414: SyntaxWarning: invalid escape sequence '\['
m = re.search(".*\[(.*)\]|.*?s:(0x[^ ]*)", exp)
/home/olk/.peda/peda.py:3519: SyntaxWarning: invalid escape sequence '\['
sock = re.search("socket:\[(.*)\]", rpath)
/home/olk/.peda/peda.py:3529: SyntaxWarning: invalid escape sequence '\s'
ppid = re.search("PPid:\s*([^\s]*)", status).group(1)
/home/olk/.peda/peda.py:3531: SyntaxWarning: invalid escape sequence '\s'
uid = re.search("Uid:\s*([^\n]*)", status).group(1)
/home/olk/.peda/peda.py:3533: SyntaxWarning: invalid escape sequence '\s'
gid = re.search("Gid:\s*([^\n]*)", status).group(1)
/home/olk/.peda/peda.py:4125: SyntaxWarning: invalid escape sequence '\s'
p = re.compile(".*?:\s*[^ ]*\s*([^,]*),(.*)")
Traceback (most recent call last):
File "/home/olk/.peda/peda.py", line 30, in <module>
from six.moves import range
ModuleNotFoundError: No module named 'six.moves'
(gdb)
can confirm. Arch, gdb 14.2:
$ cat .gdbinit set debuginfod enabled on set disassembly-flavor intel source ~/.peda/peda.py $ gdb /home/olk/.peda/peda.py:151: SyntaxWarning: invalid escape sequence '\[' p = re.compile("(.*)\[(.*)\]") # DWORD PTR [esi+eax*1] /home/olk/.peda/peda.py:373: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*exec file:\s*`(.*)'") /home/olk/.peda/peda.py:550: SyntaxWarning: invalid escape sequence '\d' p = re.compile("^(\d*)\s*(.*breakpoint)\s*(keep|del)\s*(y|n)\s*(0x[^ ]*)\s*(.*)") /home/olk/.peda/peda.py:554: SyntaxWarning: invalid escape sequence '\d' p = re.compile("^(\d*)\s*(.*point)\s*(keep|del)\s*(y|n)\s*(.*)") /home/olk/.peda/peda.py:567: SyntaxWarning: invalid escape sequence '\d' m = re.match("in.*at(.*:\d*)", what) /home/olk/.peda/peda.py:596: SyntaxWarning: invalid escape sequence '\d' m = re.match("^(\d*).*", line) /home/olk/.peda/peda.py:916: SyntaxWarning: invalid escape sequence '\s' p = re.compile("\s*(0x[^ ]*).*?:\s*([^ ]*)\s*(.*)") /home/olk/.peda/peda.py:918: SyntaxWarning: invalid escape sequence '\s' p = re.compile("(.*?)\s*<.*?>\s*([^ ]*)\s*(.*)") /home/olk/.peda/peda.py:937: SyntaxWarning: invalid escape sequence '\[' p = re.compile(".*mov.*\[esp(.*)\],") /home/olk/.peda/peda.py:969: SyntaxWarning: invalid escape sequence '\s' p = re.compile(":\s*([^ ]*)\s*(.*),") /home/olk/.peda/peda.py:1116: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?:\s*(.*)") /home/olk/.peda/peda.py:1223: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?:\s*[^ ]*\s*(.* PTR ).*(0x[^ ]*)") /home/olk/.peda/peda.py:1226: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?:\s.*\s(0x[^ ]*|\w+)") /home/olk/.peda/peda.py:1235: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?:\s*[^ ]*\s*(.* PTR ).*\[(.*)\]") /home/olk/.peda/peda.py:1430: SyntaxWarning: invalid escape sequence '\s' pattern = re.compile("([^\n]*)\s* ([0-9a-f][^-\s]*)-([^\s]*) \[.*\]\s([^/]*).* (.*)") /home/olk/.peda/peda.py:2096: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?0x[^ ]*?\s(.*)") /home/olk/.peda/peda.py:2114: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?0x[^ ]*?\s(.*)") /home/olk/.peda/peda.py:2214: SyntaxWarning: invalid escape sequence '\s' p = re.compile("Entry point: ([^\s]*)") /home/olk/.peda/peda.py:2242: SyntaxWarning: invalid escape sequence '\s' p = re.compile("\s*(0x[^-]*)->(0x[^ ]*) at (0x[^:]*):\s*([^ ]*)\s*(.*)") /home/olk/.peda/peda.py:2316: SyntaxWarning: invalid escape sequence '\s' m = re.findall(".*(0x[^ ]*)\s*%s" % re.escape(symname), out) /home/olk/.peda/peda.py:2416: SyntaxWarning: invalid escape sequence '\[' p = re.compile(".*\[.*\] (\.[^ ]*) [^0-9]* ([^ ]*) [^ ]* ([^ ]*)(.*)") /home/olk/.peda/peda.py:2474: SyntaxWarning: invalid escape sequence '\s' p = re.compile("[^\n]*\s*(0x[^ ]*) - (0x[^ ]*) is (\.[^ ]*) in (.*)") /home/olk/.peda/peda.py:2681: SyntaxWarning: invalid escape sequence '\ ' if re.search(re.escape(asmcode).replace("\ ",".*").replace("\?",".*"), asmcode_rs)\ /home/olk/.peda/peda.py:2681: SyntaxWarning: invalid escape sequence '\?' if re.search(re.escape(asmcode).replace("\ ",".*").replace("\?",".*"), asmcode_rs)\ /home/olk/.peda/peda.py:2832: SyntaxWarning: invalid escape sequence '\ ' pattern = re.compile(b'|'.join(JMPCALL).replace(b' ', b'\ ')) /home/olk/.peda/peda.py:3414: SyntaxWarning: invalid escape sequence '\[' m = re.search(".*\[(.*)\]|.*?s:(0x[^ ]*)", exp) /home/olk/.peda/peda.py:3519: SyntaxWarning: invalid escape sequence '\[' sock = re.search("socket:\[(.*)\]", rpath) /home/olk/.peda/peda.py:3529: SyntaxWarning: invalid escape sequence '\s' ppid = re.search("PPid:\s*([^\s]*)", status).group(1) /home/olk/.peda/peda.py:3531: SyntaxWarning: invalid escape sequence '\s' uid = re.search("Uid:\s*([^\n]*)", status).group(1) /home/olk/.peda/peda.py:3533: SyntaxWarning: invalid escape sequence '\s' gid = re.search("Gid:\s*([^\n]*)", status).group(1) /home/olk/.peda/peda.py:4125: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".*?:\s*[^ ]*\s*([^,]*),(.*)") Traceback (most recent call last): File "/home/olk/.peda/peda.py", line 30, in <module> from six.moves import range ModuleNotFoundError: No module named 'six.moves' (gdb)
can confirm the invalid sequence warnings. regarding the error for module six I recommend force reinstalling the peda package from pacman
you can fix this by adding r to the strings eg
p = re.compile(r"(.*)\[(.*)\]") # DWORD PTR [esi+eax*1]
to make it raw string, pull request #178 fixes this.
six.moves
not foundyou can use
pip install six
or if using arch, install from the repos
sudo pacman -S python-six
and remove the six.py
in the lib
so it uses the global ones and not the local one found in lib
I have the similar issue, it seems to be the new python's behavior. see https://stackoverflow.com/questions/52335970/how-to-fix-syntaxwarning-invalid-escape-sequence-in-python.
Need to update the code!!!
You can also disable this warnings by using export PYTHONWARNINGS="ignore"
, see https://stackoverflow.com/questions/14463277/how-to-disable-python-warnings#:~:text=e.%20python%202.7)-,export%20PYTHONWARNINGS%3D%22ignore%22,-Test%20like%20this.
And for ModuleNotFoundError: No module named 'six.moves'
issue, I tried python3.12 -m pip install six
but it doesn't work, and I fixed by cp /usr/lib/python3/dist-packages/six.py /home/liudonghua/peda/lib/six.py
finally.
it's not work my pc
it's not work my pc
from the picture, i didn't see such error like ModuleNotFoundError: No module named 'six.moves'
, and it's working for you.
oh,yes,it's working for me。Thanks
There's a SyntaxWarning since Python 3.12 using peda.py at GDB startup. This was introduced here when the DeprecationWarning was upgraded to SyntaxWarning.
It should be fixed by using raw string literals (r"...").