Skip to content

SyntaxWarning: invalid escape sequence

Description:

At GDB startup, the peda.py initialization creates a bunch of SyntaxWarning. Introduced since Python 3.12. I sent a MR to the upstream project but since it hasn't had any commits merged since 4 years, I'm not sure it will be updated.

Logs

/usr/share/peda/peda.py:151: SyntaxWarning: invalid escape sequence '[' p = re.compile("(.)[(.)]") # DWORD PTR [esi+eax1]

/usr/share/peda/peda.py:373: SyntaxWarning: invalid escape sequence '\s' p = re.compile(".exec file:\s`(.)'")

/usr/share/peda/peda.py:550: SyntaxWarning: invalid escape sequence '\d' p = re.compile("^(\d*)\s*(.breakpoint)\s(keep|del)\s*(y|n)\s*(0x[^ ])\s(.*)")

[...]

Additional info:

Steps to reproduce:

  1. Run GDB with peda installed: gdb
  2. Observe the warnings
Edited by Yoan Agostini
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information