Previous: gdb.types, Up: Python modules gdb.prompt

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.
Substitute an ESC character.
Substitute the selected frame; an argument names a frame parameter.
Substitute a newline.
Substitute a parameter's value; the argument names the parameter.
Substitute a carriage return.
Substitute the selected thread; an argument names a thread parameter.
Substitute the version of GDB.
Substitute 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"