480 lines
20 KiB
HTML
480 lines
20 KiB
HTML
<HTML>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<!-- Created on November, 11 2002 by texi2html 1.64 -->
|
|
<!--
|
|
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
|
|
Karl Berry <karl@freefriends.org>
|
|
Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
and many others.
|
|
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
|
|
|
|
-->
|
|
<HEAD>
|
|
<TITLE>Debugging with GDB: Targets</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Debugging with GDB: Targets">
|
|
<META NAME="keywords" CONTENT="Debugging with GDB: Targets">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
<META NAME="Generator" CONTENT="texi2html 1.64">
|
|
|
|
</HEAD>
|
|
|
|
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
|
|
|
|
<A NAME="SEC130"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_16.html#SEC129"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC131"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_3.html#SEC6"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H1> 16. Specifying a Debugging Target </H1>
|
|
<!--docid::SEC130::-->
|
|
<P>
|
|
|
|
<A NAME="IDX593"></A>
|
|
<A NAME="IDX594"></A>
|
|
</P><P>
|
|
|
|
A <EM>target</EM> is the execution environment occupied by your program.
|
|
</P><P>
|
|
|
|
Often, GDB runs in the same host environment as your program;
|
|
in that case, the debugging target is specified as a side effect when
|
|
you use the <CODE>file</CODE> or <CODE>core</CODE> commands. When you need more
|
|
flexibility--for example, running GDB on a physically separate
|
|
host, or controlling a standalone system over a serial port or a
|
|
realtime system over a TCP/IP connection--you can use the <CODE>target</CODE>
|
|
command to specify one of the target types configured for GDB
|
|
(see section <A HREF="gdb_17.html#SEC132">Commands for managing targets</A>).
|
|
</P><P>
|
|
|
|
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_17.html#SEC131">16.1 Active targets</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_17.html#SEC132">16.2 Commands for managing targets</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_17.html#SEC133">16.3 Choosing target byte order</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_17.html#SEC134">16.4 Remote debugging</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_17.html#SEC135">16.5 Kernel Object Display</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
</TABLE>
|
|
|
|
<br>
|
|
</BLOCKQUOTE>
|
|
<P>
|
|
|
|
<A NAME="Active Targets"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC131"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC132"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 16.1 Active targets </H2>
|
|
<!--docid::SEC131::-->
|
|
<P>
|
|
|
|
<A NAME="IDX595"></A>
|
|
<A NAME="IDX596"></A>
|
|
<A NAME="IDX597"></A>
|
|
</P><P>
|
|
|
|
There are three classes of targets: processes, core files, and
|
|
executable files. GDB can work concurrently on up to three
|
|
active targets, one in each class. This allows you to (for example)
|
|
start a process and inspect its activity without abandoning your work on
|
|
a core file.
|
|
</P><P>
|
|
|
|
For example, if you execute <SAMP>`gdb a.out'</SAMP>, then the executable file
|
|
<CODE>a.out</CODE> is the only active target. If you designate a core file as
|
|
well--presumably from a prior run that crashed and coredumped--then
|
|
GDB has two active targets and uses them in tandem, looking
|
|
first in the corefile target, then in the executable file, to satisfy
|
|
requests for memory addresses. (Typically, these two classes of target
|
|
are complementary, since core files contain only a program's
|
|
read-write memory--variables and so on--plus machine status, while
|
|
executable files contain only the program text and initialized data.)
|
|
</P><P>
|
|
|
|
When you type <CODE>run</CODE>, your executable file becomes an active process
|
|
target as well. When a process target is active, all GDB
|
|
commands requesting memory addresses refer to that target; addresses in
|
|
an active core file or executable file target are obscured while the
|
|
process target is active.
|
|
</P><P>
|
|
|
|
Use the <CODE>core-file</CODE> and <CODE>exec-file</CODE> commands to select a new
|
|
core file or executable target (see section <A HREF="gdb_16.html#SEC128">Commands to specify files</A>). To specify as a target a process that is already running, use
|
|
the <CODE>attach</CODE> command (see section <A HREF="gdb_5.html#SEC23">Debugging an already-running process</A>).
|
|
</P><P>
|
|
|
|
<A NAME="Target Commands"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC132"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC131"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC133"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC133"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 16.2 Commands for managing targets </H2>
|
|
<!--docid::SEC132::-->
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>target <VAR>type</VAR> <VAR>parameters</VAR></CODE>
|
|
<DD>Connects the GDB host environment to a target machine or
|
|
process. A target is typically a protocol for talking to debugging
|
|
facilities. You use the argument <VAR>type</VAR> to specify the type or
|
|
protocol of the target machine.
|
|
<P>
|
|
|
|
Further <VAR>parameters</VAR> are interpreted by the target protocol, but
|
|
typically include things like device names or host names to connect
|
|
with, process numbers, and baud rates.
|
|
</P><P>
|
|
|
|
The <CODE>target</CODE> command does not repeat if you press <KBD>RET</KBD> again
|
|
after executing the command.
|
|
</P><P>
|
|
|
|
<A NAME="IDX598"></A>
|
|
<DT><CODE>help target</CODE>
|
|
<DD>Displays the names of all targets available. To display targets
|
|
currently selected, use either <CODE>info target</CODE> or <CODE>info files</CODE>
|
|
(see section <A HREF="gdb_16.html#SEC128">Commands to specify files</A>).
|
|
<P>
|
|
|
|
<DT><CODE>help target <VAR>name</VAR></CODE>
|
|
<DD>Describe a particular target, including any parameters necessary to
|
|
select it.
|
|
<P>
|
|
|
|
<A NAME="IDX599"></A>
|
|
<DT><CODE>set gnutarget <VAR>args</VAR></CODE>
|
|
<DD>GDB uses its own library BFD to read your files. GDB
|
|
knows whether it is reading an <EM>executable</EM>,
|
|
a <EM>core</EM>, or a <EM>.o</EM> file; however, you can specify the file format
|
|
with the <CODE>set gnutarget</CODE> command. Unlike most <CODE>target</CODE> commands,
|
|
with <CODE>gnutarget</CODE> the <CODE>target</CODE> refers to a program, not a machine.
|
|
<P>
|
|
|
|
<BLOCKQUOTE>
|
|
<EM>Warning:</EM> To specify a file format with <CODE>set gnutarget</CODE>,
|
|
you must know the actual BFD name.
|
|
</BLOCKQUOTE>
|
|
<P>
|
|
|
|
See section <A HREF="gdb_16.html#SEC128">Commands to specify files</A>.
|
|
</P><P>
|
|
|
|
<A NAME="IDX600"></A>
|
|
<DT><CODE>show gnutarget</CODE>
|
|
<DD>Use the <CODE>show gnutarget</CODE> command to display what file format
|
|
<CODE>gnutarget</CODE> is set to read. If you have not set <CODE>gnutarget</CODE>,
|
|
GDB will determine the file format for each file automatically,
|
|
and <CODE>show gnutarget</CODE> displays <SAMP>`The current BDF target is "auto"'</SAMP>.
|
|
</DL>
|
|
<P>
|
|
|
|
Here are some common targets (available, or not, depending on the GDB
|
|
configuration):
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX601"></A>
|
|
<DT><CODE>target exec <VAR>program</VAR></CODE>
|
|
<DD>An executable file. <SAMP>`target exec <VAR>program</VAR>'</SAMP> is the same as
|
|
<SAMP>`exec-file <VAR>program</VAR>'</SAMP>.
|
|
<P>
|
|
|
|
<A NAME="IDX602"></A>
|
|
<DT><CODE>target core <VAR>filename</VAR></CODE>
|
|
<DD>A core dump file. <SAMP>`target core <VAR>filename</VAR>'</SAMP> is the same as
|
|
<SAMP>`core-file <VAR>filename</VAR>'</SAMP>.
|
|
<P>
|
|
|
|
<A NAME="IDX603"></A>
|
|
<DT><CODE>target remote <VAR>dev</VAR></CODE>
|
|
<DD>Remote serial target in GDB-specific protocol. The argument <VAR>dev</VAR>
|
|
specifies what serial device to use for the connection (e.g.
|
|
<TT>`/dev/ttya'</TT>). See section <A HREF="gdb_17.html#SEC134">Remote debugging</A>. <CODE>target remote</CODE>
|
|
supports the <CODE>load</CODE> command. This is only useful if you have
|
|
some other way of getting the stub to the target system, and you can put
|
|
it somewhere in memory where it won't get clobbered by the download.
|
|
<P>
|
|
|
|
<A NAME="IDX604"></A>
|
|
<DT><CODE>target sim</CODE>
|
|
<DD>Builtin CPU simulator. GDB includes simulators for most architectures.
|
|
In general,
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> target sim
|
|
load
|
|
run
|
|
</FONT></pre></td></tr></table>works; however, you cannot assume that a specific memory map, device
|
|
drivers, or even basic I/O is available, although some simulators do
|
|
provide these. For info about any processor-specific simulator details,
|
|
see the appropriate section in <A HREF="gdb_19.html#SEC154">Embedded Processors</A>.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
Some configurations may include these targets as well:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
|
|
<A NAME="IDX605"></A>
|
|
<DT><CODE>target nrom <VAR>dev</VAR></CODE>
|
|
<DD>NetROM ROM emulator. This target only supports downloading.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
Different targets are available on different configurations of GDB;
|
|
your configuration may have more or fewer targets.
|
|
</P><P>
|
|
|
|
Many remote targets require you to download the executable's code
|
|
once you've successfully established a connection.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
|
|
<A NAME="IDX606"></A>
|
|
<DT><CODE>load <VAR>filename</VAR></CODE>
|
|
<DD>Depending on what remote debugging facilities are configured into
|
|
GDB, the <CODE>load</CODE> command may be available. Where it exists, it
|
|
is meant to make <VAR>filename</VAR> (an executable) available for debugging
|
|
on the remote system--by downloading, or dynamic linking, for example.
|
|
<CODE>load</CODE> also records the <VAR>filename</VAR> symbol table in GDB, like
|
|
the <CODE>add-symbol-file</CODE> command.
|
|
<P>
|
|
|
|
If your GDB does not have a <CODE>load</CODE> command, attempting to
|
|
execute it gets the error message "<CODE>You can't do that when your
|
|
target is <small>...</small></CODE>"
|
|
</P><P>
|
|
|
|
The file is loaded at whatever address is specified in the executable.
|
|
For some object file formats, you can specify the load address when you
|
|
link the program; for other formats, like a.out, the object file format
|
|
specifies a fixed address.
|
|
</P><P>
|
|
|
|
<CODE>load</CODE> does not repeat if you press <KBD>RET</KBD> again after using it.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Byte Order"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC133"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC132"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC134"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC134"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 16.3 Choosing target byte order </H2>
|
|
<!--docid::SEC133::-->
|
|
<P>
|
|
|
|
<A NAME="IDX607"></A>
|
|
<A NAME="IDX608"></A>
|
|
</P><P>
|
|
|
|
Some types of processors, such as the MIPS, PowerPC, and Hitachi SH,
|
|
offer the ability to run either big-endian or little-endian byte
|
|
orders. Usually the executable or symbol will include a bit to
|
|
designate the endian-ness, and you will not need to worry about
|
|
which to use. However, you may still find it useful to adjust
|
|
GDB's idea of processor endian-ness manually.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX609"></A>
|
|
<DT><CODE>set endian big</CODE>
|
|
<DD>Instruct GDB to assume the target is big-endian.
|
|
<P>
|
|
|
|
<A NAME="IDX610"></A>
|
|
<DT><CODE>set endian little</CODE>
|
|
<DD>Instruct GDB to assume the target is little-endian.
|
|
<P>
|
|
|
|
<A NAME="IDX611"></A>
|
|
<DT><CODE>set endian auto</CODE>
|
|
<DD>Instruct GDB to use the byte order associated with the
|
|
executable.
|
|
<P>
|
|
|
|
<DT><CODE>show endian</CODE>
|
|
<DD>Display GDB's current idea of the target byte order.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
Note that these commands merely adjust interpretation of symbolic
|
|
data on the host, and that they have absolutely no effect on the
|
|
target system.
|
|
</P><P>
|
|
|
|
<A NAME="Remote"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC134"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC133"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC135"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC135"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 16.4 Remote debugging </H2>
|
|
<!--docid::SEC134::-->
|
|
<P>
|
|
|
|
If you are trying to debug a program running on a machine that cannot run
|
|
GDB in the usual way, it is often useful to use remote debugging.
|
|
For example, you might use remote debugging on an operating system kernel,
|
|
or on a small system which does not have a general purpose operating system
|
|
powerful enough to run a full-featured debugger.
|
|
</P><P>
|
|
|
|
Some configurations of GDB have special serial or TCP/IP interfaces
|
|
to make this work with particular debugging targets. In addition,
|
|
GDB comes with a generic serial protocol (specific to GDB,
|
|
but not specific to any particular target system) which you can use if you
|
|
write the remote stubs--the code that runs on the remote system to
|
|
communicate with GDB.
|
|
</P><P>
|
|
|
|
Other remote targets may be available in your
|
|
configuration of GDB; use <CODE>help target</CODE> to list them.
|
|
</P><P>
|
|
|
|
<A NAME="KOD"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC135"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC134"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 16.5 Kernel Object Display </H2>
|
|
<!--docid::SEC135::-->
|
|
<P>
|
|
|
|
<A NAME="IDX612"></A>
|
|
<A NAME="IDX613"></A>
|
|
<A NAME="IDX614"></A>
|
|
</P><P>
|
|
|
|
Some targets support kernel object display. Using this facility,
|
|
GDB communicates specially with the underlying operating system
|
|
and can display information about operating system-level objects such as
|
|
mutexes and other synchronization objects. Exactly which objects can be
|
|
displayed is determined on a per-OS basis.
|
|
</P><P>
|
|
|
|
Use the <CODE>set os</CODE> command to set the operating system. This tells
|
|
GDB which kernel object display module to initialize:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>(gdb) set os cisco
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
If <CODE>set os</CODE> succeeds, GDB will display some information
|
|
about the operating system, and will create a new <CODE>info</CODE> command
|
|
which can be used to query the target. The <CODE>info</CODE> command is named
|
|
after the operating system:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>(gdb) info cisco
|
|
List of Cisco Kernel Objects
|
|
Object Description
|
|
any Any and all objects
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Further subcommands can be used to query about particular objects known
|
|
by the kernel.
|
|
</P><P>
|
|
|
|
There is currently no way to determine whether a given operating system
|
|
is supported other than to try it.
|
|
</P><P>
|
|
|
|
<A NAME="Remote Debugging"></A>
|
|
<HR SIZE="6">
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_17.html#SEC130"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_18.html#SEC136"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<BR>
|
|
<FONT SIZE="-1">
|
|
|
|
<address>
|
|
|
|
<p>Please send FSF & GNU inquiries & questions to <a
|
|
href="mailto:gnu@gnu.org">gnu@gnu.org</a>. There are also <a
|
|
href="http://www.gnu.org/home.html#ContactInfo">other ways to
|
|
contact</a> the FSF.</p>
|
|
|
|
<p>These pages are maintained by <a
|
|
href="http://www.gnu.org/software/gdb/">the GDB developers</a>.</p>
|
|
|
|
<p>Copyright Free Software Foundation, Inc., 59 Temple Place - Suite
|
|
330, Boston, MA 02111, USA.</p>
|
|
|
|
<p>Verbatim copying and distribution of this entire article is
|
|
permitted in any medium, provided this notice is preserved.</p>
|
|
|
|
</address>
|
|
|
|
This document was generated
|
|
by <I>GDB Administrator</I> on <I>November, 11 2002</I>
|
|
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
|
|
"><I>texi2html</I></A>
|
|
|
|
</BODY>
|
|
</HTML>
|