From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4092 invoked by alias); 4 Feb 2003 17:30:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4077 invoked from network); 4 Feb 2003 17:30:45 -0000 Received: from unknown (HELO localhost.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 4 Feb 2003 17:30:45 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0235A3CB4 for ; Tue, 4 Feb 2003 12:30:43 -0500 (EST) Message-ID: <3E3FF8C3.6070405@redhat.com> Date: Tue, 04 Feb 2003 17:30:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa/doc] Document interpreters Content-Type: multipart/mixed; boundary="------------040906090403060506090403" X-SW-Source: 2003-02/txt/msg00120.txt.bz2 This is a multi-part message in MIME format. --------------040906090403060506090403 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 227 Hello, This documents the various interpreters that GDB supports. (eli, you've seen approved an earlier version. I did tweak it a tiny bit though - removed reference to mi0 and updated descriptions of mi1/mi2.) ok? Andrew --------------040906090403060506090403 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 4059 2003-02-04 Andrew Cagney From 2003-02-04 Keith Seitz : * gdb.texinfo (Interpreters): New chapter. Refer the command-line option "-i"/"--interpreter" to this chapter. Include index entries. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.145 diff -u -r1.145 gdb.texinfo --- gdb.texinfo 1 Feb 2003 20:51:06 -0000 1.145 +++ gdb.texinfo 4 Feb 2003 17:28:43 -0000 @@ -146,6 +146,7 @@ * Controlling GDB:: Controlling @value{GDBN} * Sequences:: Canned sequences of commands * TUI:: @value{GDBN} Text User Interface +* Interpreters:: Command Interpreters * Emacs:: Using @value{GDBN} under @sc{gnu} Emacs * Annotations:: @value{GDBN}'s annotation interface. * GDB/MI:: @value{GDBN}'s Machine Interface. @@ -1123,7 +1124,8 @@ @cindex @code{--interpreter} Use the interpreter @var{interp} for interface with the controlling program or device. This option is meant to be set by programs which -communicate with @value{GDBN} using it as a back end. +communicate with @value{GDBN} using it as a back end. @xref{Interpreters, , +Command Interpreters}. @samp{--interpreter=mi} (or @samp{--interpreter=mi2}) causes @value{GDBN} to use the current @dfn{@sc{gdb/mi} interface} @@ -13219,6 +13221,68 @@ string are the simple ones that consist of backslash followed by a letter. @end table + +@node Interpreters +@chapter Command Interpreters +@cindex command interpreters + +@value{GDBN} supports multiple command interpreters, and some command +infrastructure to allow users or user interface writers to switch +between interpreters or run commands in other interpreters. + +@value{GDBN} currently supports two command interpreters, the console +interpreter (sometimes called the command-line interpreter or @sc{cli}) +and the machine interface interpreter (or @sc{gdb/mi}). This manual +describes both of these interfaces in great detail. + +By default, @value{GDBN} will start with the console interpreter. +However, the user may choose to start @value{GDBN} with another +interpreter by specifying the @option{-i} or @option{--interpreter} +startup options. Defined interpreters include: + +@table @code +@item console +@cindex console interpreter +The traditional console or command-line interpreter. This is the most often +used interpreter with @value{GDBN}. With no interpreter specified at runtime, +@value{GDBN} will use this interpreter. + +@item mi +@cindex mi interpreter +The newest @sc{gdb/mi} interface (currently @code{mi2}). Used primarily +by programs wishing to use @value{GDBN} as a backend for a debugger GUI +or an IDE. For more information, see @ref{GDB/MI, ,The @sc{gdb/mi} +Interface}. + +@item mi2 +@cindex mi2 interpreter +The current @sc{gdb/mi} interface. + +@item mi1 +@cindex mi1 interpreter +The @sc{gdb/mi} interface included in @value{GDBN} 5.1, 5.2, and 5.3. + +@end table + +@cindex invoke another interpreter +The interpreter being used by @value{GDBN} may not be dynamically switched at +runtime. Although possible, this could lead to a very precarious situation. +Consider an IDE using @sc{gdb/mi}. If a user enters the command +"interpreter-set console" in a console view, @value{GDBN} would switch +to using the console interpreter, rendering the IDE inoperable! + +@kindex interpreter-exec +Although you may only choose a single interpreter at startup, you may execute +commands in any interpreter from the current interpreter using the appropriate +command. If you are running the console interpreter, simply use the +@code{interpreter-exec} command: + +@smallexample +interpreter-exec mi "-data-list-register-names" +@end smallexample + +@sc{gdb/mi} has a similar command, although it is only available in versions of +@value{GDBN} which support @sc{gdb/mi} version 2 (or greater). @node TUI @chapter @value{GDBN} Text User Interface --------------040906090403060506090403--