Previous: gdb.types, Up: Python modules [Contents][Index]
This module provides a method for prompt value-substitution.
substitute_prompt (string)Return string with escape sequences substituted by values. Some escape sequences take arguments. You can specify arguments inside “{}” immediately following the escape sequence.
The escape sequences you can pass to this function are:
\\Substitute a backslash.
\eSubstitute an ESC character.
\fSubstitute the selected frame; an argument names a frame parameter.
\nSubstitute a newline.
\pSubstitute a parameter’s value; the argument names the parameter.
\rSubstitute a carriage return.
\tSubstitute the selected thread; an argument names a thread parameter.
\vSubstitute the version of GDB.
\wSubstitute the current working directory.
\[Begin a sequence of non-printing characters. These sequences are typically used with the ESC character, and are not counted in the string length. Example: “\[\e[0;34m\](gdb)\[\e[0m\]” will return a blue-colored “(gdb)” prompt where the length is five.
\]End a sequence of non-printing characters.
For example:
substitute_prompt (``frame: \f,
print arguments: \p{print frame-arguments}'')
will return the string:
"frame: main, print arguments: scalars"