toolchain/share/doc/gdb/gdb_002eprompt.html

102 lines
4.6 KiB
HTML

<html lang="en">
<head>
<title>gdb.prompt - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Python-modules.html#Python-modules" title="Python modules">
<link rel="prev" href="gdb_002etypes.html#gdb_002etypes" title="gdb.types">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="gdb.prompt"></a>
<a name="gdb_002eprompt"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="gdb_002etypes.html#gdb_002etypes">gdb.types</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Python-modules.html#Python-modules">Python modules</a>
<hr>
</div>
<h5 class="subsubsection">23.2.4.3 gdb.prompt</h5>
<p><a name="index-gdb_002eprompt-2446"></a>
This module provides a method for prompt value-substitution.
<dl>
<dt><code>substitute_prompt (</code><var>string</var><code>)</code><dd>Return <var>string</var> with escape sequences substituted by values. Some
escape sequences take arguments. You can specify arguments inside
&ldquo;{}&rdquo; immediately following the escape sequence.
<p>The escape sequences you can pass to this function are:
<dl>
<dt><code>\\</code><dd>Substitute a backslash.
<br><dt><code>\e</code><dd>Substitute an ESC character.
<br><dt><code>\f</code><dd>Substitute the selected frame; an argument names a frame parameter.
<br><dt><code>\n</code><dd>Substitute a newline.
<br><dt><code>\p</code><dd>Substitute a parameter's value; the argument names the parameter.
<br><dt><code>\r</code><dd>Substitute a carriage return.
<br><dt><code>\t</code><dd>Substitute the selected thread; an argument names a thread parameter.
<br><dt><code>\v</code><dd>Substitute the version of GDB.
<br><dt><code>\w</code><dd>Substitute the current working directory.
<br><dt><code>\[</code><dd>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: &ldquo;\[\e[0;34m\](gdb)\[\e[0m\]&rdquo; will return a
blue-colored &ldquo;(gdb)&rdquo; prompt where the length is five.
<br><dt><code>\]</code><dd>End a sequence of non-printing characters.
</dl>
<p>For example:
<pre class="smallexample"> substitute_prompt (``frame: \f,
print arguments: \p{print frame-arguments}'')
</pre>
<p><br>will return the string:<br>
<pre class="smallexample"> "frame: main, print arguments: scalars"
</pre>
</dl>
<!-- Guile docs live in a separate file. -->
<!-- Copyright (C) 2008-2019 Free Software Foundation, Inc. -->
<!-- Permission is granted to copy, distribute and/or modify this document -->
<!-- under the terms of the GNU Free Documentation License, Version 1.3 or -->
<!-- any later version published by the Free Software Foundation; with the -->
<!-- Invariant Sections being ``Free Software'' and ``Free Software Needs -->
<!-- Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' -->
<!-- and with the Back-Cover Texts as in (a) below. -->
<!-- (a) The FSF's Back-Cover Text is: ``You are free to copy and modify -->
<!-- this GNU Manual. Buying copies from GNU Press supports the FSF in -->
<!-- developing GNU and promoting software freedom.'' -->
</body></html>