522 lines
23 KiB
HTML
522 lines
23 KiB
HTML
<HTML>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<!-- Created on October, 26 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>GDB Internals: Native Debugging</TITLE>
|
|
|
|
<META NAME="description" CONTENT="GDB Internals: Native Debugging">
|
|
<META NAME="keywords" CONTENT="GDB Internals: Native Debugging">
|
|
<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="SEC95"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_10.html#SEC94"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC96"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_2.html#SEC2"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint.html#SEC_Top"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H1> 11. Native Debugging </H1>
|
|
<!--docid::SEC95::-->
|
|
<P>
|
|
|
|
Several files control GDB's configuration for native support:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX469"></A>
|
|
<DT><TT>`gdb/config/<VAR>arch</VAR>/<VAR>xyz</VAR>.mh'</TT>
|
|
<DD>Specifies Makefile fragments needed by a <EM>native</EM> configuration on
|
|
machine <VAR>xyz</VAR>. In particular, this lists the required
|
|
native-dependent object files, by defining <SAMP>`NATDEPFILES=<small>...</small>'</SAMP>.
|
|
Also specifies the header file which describes native support on
|
|
<VAR>xyz</VAR>, by defining <SAMP>`NAT_FILE= nm-<VAR>xyz</VAR>.h'</SAMP>. You can also
|
|
define <SAMP>`NAT_CFLAGS'</SAMP>, <SAMP>`NAT_ADD_FILES'</SAMP>, <SAMP>`NAT_CLIBS'</SAMP>,
|
|
<SAMP>`NAT_CDEPS'</SAMP>, etc.; see <TT>`Makefile.in'</TT>.
|
|
<P>
|
|
|
|
<EM>Maintainer's note: The <TT>`.mh'</TT> suffix is because this file
|
|
originally contained <TT>`Makefile'</TT> fragments for hosting GDB
|
|
on machine <VAR>xyz</VAR>. While the file is no longer used for this
|
|
purpose, the <TT>`.mh'</TT> suffix remains. Perhaps someone will
|
|
eventually rename these fragments so that they have a <TT>`.mn'</TT>
|
|
suffix.</EM>
|
|
</P><P>
|
|
|
|
<DT><TT>`gdb/config/<VAR>arch</VAR>/nm-<VAR>xyz</VAR>.h'</TT>
|
|
<DD>(<TT>`nm.h'</TT> is a link to this file, created by <CODE>configure</CODE>). Contains C
|
|
macro definitions describing the native system environment, such as
|
|
child process control and core file support.
|
|
<P>
|
|
|
|
<DT><TT>`gdb/<VAR>xyz</VAR>-nat.c'</TT>
|
|
<DD>Contains any miscellaneous C code required for this native support of
|
|
this machine. On some machines it doesn't exist at all.
|
|
</DL>
|
|
<P>
|
|
|
|
There are some "generic" versions of routines that can be used by
|
|
various systems. These can be customized in various ways by macros
|
|
defined in your <TT>`nm-<VAR>xyz</VAR>.h'</TT> file. If these routines work for
|
|
the <VAR>xyz</VAR> host, you can just include the generic file's name (with
|
|
<SAMP>`.o'</SAMP>, not <SAMP>`.c'</SAMP>) in <CODE>NATDEPFILES</CODE>.
|
|
</P><P>
|
|
|
|
Otherwise, if your machine needs custom support routines, you will need
|
|
to write routines that perform the same functions as the generic file.
|
|
Put them into <TT>`<VAR>xyz</VAR>-nat.c'</TT>, and put <TT>`<VAR>xyz</VAR>-nat.o'</TT>
|
|
into <CODE>NATDEPFILES</CODE>.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><TT>`inftarg.c'</TT>
|
|
<DD>This contains the <EM>target_ops vector</EM> that supports Unix child
|
|
processes on systems which use ptrace and wait to control the child.
|
|
<P>
|
|
|
|
<DT><TT>`procfs.c'</TT>
|
|
<DD>This contains the <EM>target_ops vector</EM> that supports Unix child
|
|
processes on systems which use /proc to control the child.
|
|
<P>
|
|
|
|
<DT><TT>`fork-child.c'</TT>
|
|
<DD>This does the low-level grunge that uses Unix system calls to do a "fork
|
|
and exec" to start up a child process.
|
|
<P>
|
|
|
|
<DT><TT>`infptrace.c'</TT>
|
|
<DD>This is the low level interface to inferior processes for systems using
|
|
the Unix <CODE>ptrace</CODE> call in a vanilla way.
|
|
</DL>
|
|
<P>
|
|
|
|
<HR SIZE="6">
|
|
<A NAME="SEC96"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC97"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 11.1 Native core file Support </H2>
|
|
<!--docid::SEC96::-->
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX470"></A>
|
|
<DT><TT>`core-aout.c::fetch_core_registers()'</TT>
|
|
<DD>Support for reading registers out of a core file. This routine calls
|
|
<CODE>register_addr()</CODE>, see below. Now that BFD is used to read core
|
|
files, virtually all machines should use <CODE>core-aout.c</CODE>, and should
|
|
just provide <CODE>fetch_core_registers</CODE> in <CODE><VAR>xyz</VAR>-nat.c</CODE> (or
|
|
<CODE>REGISTER_U_ADDR</CODE> in <CODE>nm-<VAR>xyz</VAR>.h</CODE>).
|
|
<P>
|
|
|
|
<DT><TT>`core-aout.c::register_addr()'</TT>
|
|
<DD>If your <CODE>nm-<VAR>xyz</VAR>.h</CODE> file defines the macro
|
|
<CODE>REGISTER_U_ADDR(addr, blockend, regno)</CODE>, it should be defined to
|
|
set <CODE>addr</CODE> to the offset within the <SAMP>`user'</SAMP> struct of GDB
|
|
register number <CODE>regno</CODE>. <CODE>blockend</CODE> is the offset within the
|
|
"upage" of <CODE>u.u_ar0</CODE>. If <CODE>REGISTER_U_ADDR</CODE> is defined,
|
|
<TT>`core-aout.c'</TT> will define the <CODE>register_addr()</CODE> function and
|
|
use the macro in it. If you do not define <CODE>REGISTER_U_ADDR</CODE>, but
|
|
you are using the standard <CODE>fetch_core_registers()</CODE>, you will need
|
|
to define your own version of <CODE>register_addr()</CODE>, put it into your
|
|
<CODE><VAR>xyz</VAR>-nat.c</CODE> file, and be sure <CODE><VAR>xyz</VAR>-nat.o</CODE> is in
|
|
the <CODE>NATDEPFILES</CODE> list. If you have your own
|
|
<CODE>fetch_core_registers()</CODE>, you may not need a separate
|
|
<CODE>register_addr()</CODE>. Many custom <CODE>fetch_core_registers()</CODE>
|
|
implementations simply locate the registers themselves.</DL>
|
|
<P>
|
|
|
|
When making GDB run native on a new operating system, to make it
|
|
possible to debug core files, you will need to either write specific
|
|
code for parsing your OS's core files, or customize
|
|
<TT>`bfd/trad-core.c'</TT>. First, use whatever <CODE>#include</CODE> files your
|
|
machine uses to define the struct of registers that is accessible
|
|
(possibly in the u-area) in a core file (rather than
|
|
<TT>`machine/reg.h'</TT>), and an include file that defines whatever header
|
|
exists on a core file (e.g. the u-area or a <CODE>struct core</CODE>). Then
|
|
modify <CODE>trad_unix_core_file_p</CODE> to use these values to set up the
|
|
section information for the data segment, stack segment, any other
|
|
segments in the core file (perhaps shared library contents or control
|
|
information), "registers" segment, and if there are two discontiguous
|
|
sets of registers (e.g. integer and float), the "reg2" segment. This
|
|
section information basically delimits areas in the core file in a
|
|
standard way, which the section-reading routines in BFD know how to seek
|
|
around in.
|
|
</P><P>
|
|
|
|
Then back in GDB, you need a matching routine called
|
|
<CODE>fetch_core_registers</CODE>. If you can use the generic one, it's in
|
|
<TT>`core-aout.c'</TT>; if not, it's in your <TT>`<VAR>xyz</VAR>-nat.c'</TT> file.
|
|
It will be passed a char pointer to the entire "registers" segment,
|
|
its length, and a zero; or a char pointer to the entire "regs2"
|
|
segment, its length, and a 2. The routine should suck out the supplied
|
|
register values and install them into GDB's "registers" array.
|
|
</P><P>
|
|
|
|
If your system uses <TT>`/proc'</TT> to control processes, and uses ELF
|
|
format core files, then you may be able to use the same routines for
|
|
reading the registers out of processes and out of core files.
|
|
</P><P>
|
|
|
|
<HR SIZE="6">
|
|
<A NAME="SEC97"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC96"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC98"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC98"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 11.2 ptrace </H2>
|
|
<!--docid::SEC97::-->
|
|
<P>
|
|
|
|
<HR SIZE="6">
|
|
<A NAME="SEC98"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC97"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC99"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC99"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 11.3 /proc </H2>
|
|
<!--docid::SEC98::-->
|
|
<P>
|
|
|
|
<HR SIZE="6">
|
|
<A NAME="SEC99"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC98"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC100"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC100"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 11.4 win32 </H2>
|
|
<!--docid::SEC99::-->
|
|
<P>
|
|
|
|
<HR SIZE="6">
|
|
<A NAME="SEC100"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC99"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC101"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC101"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 11.5 shared libraries </H2>
|
|
<!--docid::SEC100::-->
|
|
<P>
|
|
|
|
<HR SIZE="6">
|
|
<A NAME="SEC101"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC100"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 11.6 Native Conditionals </H2>
|
|
<!--docid::SEC101::-->
|
|
<P>
|
|
|
|
When GDB is configured and compiled, various macros are
|
|
defined or left undefined, to control compilation when the host and
|
|
target systems are the same. These macros should be defined (or left
|
|
undefined) in <TT>`nm-<VAR>system</VAR>.h'</TT>.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>ATTACH_DETACH</CODE>
|
|
<DD><A NAME="IDX471"></A>
|
|
If defined, then GDB will include support for the <CODE>attach</CODE> and
|
|
<CODE>detach</CODE> commands.
|
|
<P>
|
|
|
|
<DT><CODE>CHILD_PREPARE_TO_STORE</CODE>
|
|
<DD><A NAME="IDX472"></A>
|
|
If the machine stores all registers at once in the child process, then
|
|
define this to ensure that all values are correct. This usually entails
|
|
a read from the child.
|
|
<P>
|
|
|
|
[Note that this is incorrectly defined in <TT>`xm-<VAR>system</VAR>.h'</TT> files
|
|
currently.]
|
|
</P><P>
|
|
|
|
<DT><CODE>FETCH_INFERIOR_REGISTERS</CODE>
|
|
<DD><A NAME="IDX473"></A>
|
|
Define this if the native-dependent code will provide its own routines
|
|
<CODE>fetch_inferior_registers</CODE> and <CODE>store_inferior_registers</CODE> in
|
|
<TT>`<VAR>host</VAR>-nat.c'</TT>. If this symbol is <EM>not</EM> defined, and
|
|
<TT>`infptrace.c'</TT> is included in this configuration, the default
|
|
routines in <TT>`infptrace.c'</TT> are used for these functions.
|
|
<P>
|
|
|
|
<DT><CODE>FILES_INFO_HOOK</CODE>
|
|
<DD><A NAME="IDX474"></A>
|
|
(Only defined for Convex.)
|
|
<P>
|
|
|
|
<DT><CODE>FP0_REGNUM</CODE>
|
|
<DD><A NAME="IDX475"></A>
|
|
This macro is normally defined to be the number of the first floating
|
|
point register, if the machine has such registers. As such, it would
|
|
appear only in target-specific code. However, <TT>`/proc'</TT> support uses this
|
|
to decide whether floats are in use on this target.
|
|
<P>
|
|
|
|
<DT><CODE>GET_LONGJMP_TARGET</CODE>
|
|
<DD><A NAME="IDX476"></A>
|
|
For most machines, this is a target-dependent parameter. On the
|
|
DECstation and the Iris, this is a native-dependent parameter, since
|
|
<TT>`setjmp.h'</TT> is needed to define it.
|
|
<P>
|
|
|
|
This macro determines the target PC address that <CODE>longjmp</CODE> will jump to,
|
|
assuming that we have just stopped at a longjmp breakpoint. It takes a
|
|
<CODE>CORE_ADDR *</CODE> as argument, and stores the target PC value through this
|
|
pointer. It examines the current state of the machine as needed.
|
|
</P><P>
|
|
|
|
<DT><CODE>I386_USE_GENERIC_WATCHPOINTS</CODE>
|
|
<DD>An x86-based machine can define this to use the generic x86 watchpoint
|
|
support; see <A HREF="gdbint_3.html#SEC6">I386_USE_GENERIC_WATCHPOINTS</A>.
|
|
<P>
|
|
|
|
<DT><CODE>KERNEL_U_ADDR</CODE>
|
|
<DD><A NAME="IDX477"></A>
|
|
Define this to the address of the <CODE>u</CODE> structure (the "user
|
|
struct", also known as the "u-page") in kernel virtual memory. GDB
|
|
needs to know this so that it can subtract this address from absolute
|
|
addresses in the upage, that are obtained via ptrace or from core files.
|
|
On systems that don't need this value, set it to zero.
|
|
<P>
|
|
|
|
<DT><CODE>KERNEL_U_ADDR_BSD</CODE>
|
|
<DD><A NAME="IDX478"></A>
|
|
Define this to cause GDB to determine the address of <CODE>u</CODE> at
|
|
runtime, by using Berkeley-style <CODE>nlist</CODE> on the kernel's image in
|
|
the root directory.
|
|
<P>
|
|
|
|
<DT><CODE>KERNEL_U_ADDR_HPUX</CODE>
|
|
<DD><A NAME="IDX479"></A>
|
|
Define this to cause GDB to determine the address of <CODE>u</CODE> at
|
|
runtime, by using HP-style <CODE>nlist</CODE> on the kernel's image in the
|
|
root directory.
|
|
<P>
|
|
|
|
<DT><CODE>ONE_PROCESS_WRITETEXT</CODE>
|
|
<DD><A NAME="IDX480"></A>
|
|
Define this to be able to, when a breakpoint insertion fails, warn the
|
|
user that another process may be running with the same executable.
|
|
<P>
|
|
|
|
<DT><CODE>PREPARE_TO_PROCEED (<VAR>select_it</VAR>)</CODE>
|
|
<DD><A NAME="IDX481"></A>
|
|
This (ugly) macro allows a native configuration to customize the way the
|
|
<CODE>proceed</CODE> function in <TT>`infrun.c'</TT> deals with switching between
|
|
threads.
|
|
<P>
|
|
|
|
In a multi-threaded task we may select another thread and then continue
|
|
or step. But if the old thread was stopped at a breakpoint, it will
|
|
immediately cause another breakpoint stop without any execution (i.e. it
|
|
will report a breakpoint hit incorrectly). So GDB must step over it
|
|
first.
|
|
</P><P>
|
|
|
|
If defined, <CODE>PREPARE_TO_PROCEED</CODE> should check the current thread
|
|
against the thread that reported the most recent event. If a step-over
|
|
is required, it returns TRUE. If <VAR>select_it</VAR> is non-zero, it should
|
|
reselect the old thread.
|
|
</P><P>
|
|
|
|
<DT><CODE>PROC_NAME_FMT</CODE>
|
|
<DD><A NAME="IDX482"></A>
|
|
Defines the format for the name of a <TT>`/proc'</TT> device. Should be
|
|
defined in <TT>`nm.h'</TT> <EM>only</EM> in order to override the default
|
|
definition in <TT>`procfs.c'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>PTRACE_FP_BUG</CODE>
|
|
<DD><A NAME="IDX483"></A>
|
|
See <TT>`mach386-xdep.c'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>PTRACE_ARG3_TYPE</CODE>
|
|
<DD><A NAME="IDX484"></A>
|
|
The type of the third argument to the <CODE>ptrace</CODE> system call, if it
|
|
exists and is different from <CODE>int</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>REGISTER_U_ADDR</CODE>
|
|
<DD><A NAME="IDX485"></A>
|
|
Defines the offset of the registers in the "u area".
|
|
<P>
|
|
|
|
<DT><CODE>SHELL_COMMAND_CONCAT</CODE>
|
|
<DD><A NAME="IDX486"></A>
|
|
If defined, is a string to prefix on the shell command used to start the
|
|
inferior.
|
|
<P>
|
|
|
|
<DT><CODE>SHELL_FILE</CODE>
|
|
<DD><A NAME="IDX487"></A>
|
|
If defined, this is the name of the shell to use to run the inferior.
|
|
Defaults to <CODE>"/bin/sh"</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>SOLIB_ADD (<VAR>filename</VAR>, <VAR>from_tty</VAR>, <VAR>targ</VAR>, <VAR>readsyms</VAR>)</CODE>
|
|
<DD><A NAME="IDX488"></A>
|
|
Define this to expand into an expression that will cause the symbols in
|
|
<VAR>filename</VAR> to be added to GDB's symbol table. If
|
|
<VAR>readsyms</VAR> is zero symbols are not read but any necessary low level
|
|
processing for <VAR>filename</VAR> is still done.
|
|
<P>
|
|
|
|
<DT><CODE>SOLIB_CREATE_INFERIOR_HOOK</CODE>
|
|
<DD><A NAME="IDX489"></A>
|
|
Define this to expand into any shared-library-relocation code that you
|
|
want to be run just after the child process has been forked.
|
|
<P>
|
|
|
|
<DT><CODE>START_INFERIOR_TRAPS_EXPECTED</CODE>
|
|
<DD><A NAME="IDX490"></A>
|
|
When starting an inferior, GDB normally expects to trap
|
|
twice; once when
|
|
the shell execs, and once when the program itself execs. If the actual
|
|
number of traps is something other than 2, then define this macro to
|
|
expand into the number expected.
|
|
<P>
|
|
|
|
<DT><CODE>SVR4_SHARED_LIBS</CODE>
|
|
<DD><A NAME="IDX491"></A>
|
|
Define this to indicate that SVR4-style shared libraries are in use.
|
|
<P>
|
|
|
|
<DT><CODE>USE_PROC_FS</CODE>
|
|
<DD><A NAME="IDX492"></A>
|
|
This determines whether small routines in <TT>`*-tdep.c'</TT>, which
|
|
translate register values between GDB's internal
|
|
representation and the <TT>`/proc'</TT> representation, are compiled.
|
|
<P>
|
|
|
|
<DT><CODE>U_REGS_OFFSET</CODE>
|
|
<DD><A NAME="IDX493"></A>
|
|
This is the offset of the registers in the upage. It need only be
|
|
defined if the generic ptrace register access routines in
|
|
<TT>`infptrace.c'</TT> are being used (that is, <TT>`infptrace.c'</TT> is
|
|
configured in, and <CODE>FETCH_INFERIOR_REGISTERS</CODE> is not defined). If
|
|
the default value from <TT>`infptrace.c'</TT> is good enough, leave it
|
|
undefined.
|
|
<P>
|
|
|
|
The default value means that u.u_ar0 <EM>points to</EM> the location of
|
|
the registers. I'm guessing that <CODE>#define U_REGS_OFFSET 0</CODE> means
|
|
that <CODE>u.u_ar0</CODE> <EM>is</EM> the location of the registers.
|
|
</P><P>
|
|
|
|
<DT><CODE>CLEAR_SOLIB</CODE>
|
|
<DD><A NAME="IDX494"></A>
|
|
See <TT>`objfiles.c'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>DEBUG_PTRACE</CODE>
|
|
<DD><A NAME="IDX495"></A>
|
|
Define this to debug <CODE>ptrace</CODE> calls.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Support Libraries"></A>
|
|
</P><P>
|
|
|
|
<HR SIZE="6">
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_11.html#SEC95"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_12.html#SEC102"> >> </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="gdbint.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_19.html#SEC186">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdbint_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>October, 26 2002</I>
|
|
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
|
|
"><I>texi2html</I></A>
|
|
|
|
</BODY>
|
|
</HTML>
|