Implement displaced stepping.
[deliverable/binutils-gdb.git] / gdb / doc / gdb.texinfo
index 9355d47adcc6b891d54e081fce1bf939332d56b1..7abac3c4b8855a1fa26eedbe8f386c4ae2f7e3e0 100644 (file)
@@ -3072,11 +3072,12 @@ your program.  There is nothing silly or meaningless about this.  When
 the breakpoints are conditional, this is even useful
 (@pxref{Conditions, ,Break Conditions}).
 
+@cindex multiple locations, breakpoints
+@cindex breakpoints, multiple locations
 It is possible that a breakpoint corresponds to several locations
 in your program.  Examples of this situation are:
 
 @itemize @bullet
-
 @item
 For a C@t{++} constructor, the @value{NGCC} compiler generates several
 instances of the function body, used in different cases.
@@ -3088,11 +3089,14 @@ correspond to any number of instantiations.
 @item
 For an inlined function, a given source line can correspond to
 several places where that function is inlined.
-
 @end itemize
 
 In all those cases, @value{GDBN} will insert a breakpoint at all
-the relevant locations.
+the relevant locations@footnote{
+As of this writing, multiple-location breakpoints work only if there's
+line number information for all the locations.  This means that they
+will generally not work in system libraries, unless you have debug
+info with line numbers for them.}.
 
 A breakpoint with multiple locations is displayed in the breakpoint
 table using several rows---one header row, followed by one row for
@@ -3205,6 +3209,30 @@ type.  If the target provides a memory map, @value{GDBN} will warn when
 trying to set software breakpoint at a read-only address.
 @end table
 
+@value{GDBN} normally implements breakpoints by replacing the program code
+at the breakpoint address with a special instruction, which, when
+executed, given control to the debugger.  By default, the program
+code is so modified only when the program is resumed.  As soon as
+the program stops, @value{GDBN} restores the original instructions.  This
+behaviour guards against leaving breakpoints inserted in the
+target should gdb abrubptly disconnect.  However, with slow remote
+targets, inserting and removing breakpoint can reduce the performance.
+This behavior can be controlled with the following commands::
+
+@kindex set breakpoint always-inserted
+@kindex show breakpoint always-inserted
+@table @code
+@item set breakpoint always-inserted off
+This is the default behaviour.  All breakpoints, including newly added
+by the user, are inserted in the target only when the target is
+resumed.  All breakpoints are removed from the target when it stops.
+
+@item set breakpoint always-inserted on
+Causes all breakpoints to be inserted in the target at all times.  If
+the user adds a new breakpoint, or changes an existing breakpoint, the
+breakpoints in the target are updated immediately.  A breakpoint is
+removed from the target only when breakpoint itself is removed.
+@end table
 
 @cindex negative breakpoint numbers
 @cindex internal @value{GDBN} breakpoints
@@ -9899,6 +9927,12 @@ of the second one.
 @item :
 The range operator.  Normally used in the form of array(low:high) to
 represent a section of array.
+
+@item %
+The access component operator.  Normally used to access elements in derived
+types.  Also suitable for unions.  As unions aren't part of regular Fortran,
+this can only happen when accessing a register that uses a gdbarch-defined
+union type.
 @end table
 
 @node Fortran Defaults
@@ -14860,6 +14894,26 @@ This command forces @value{GDBN} to use the specified ABI.
 @item show arm abi
 Show the currently used ABI.
 
+@item set arm fallback-mode (arm|thumb|auto)
+@value{GDBN} uses the symbol table, when available, to determine
+whether instructions are ARM or Thumb.  This command controls
+@value{GDBN}'s default behavior when the symbol table is not
+available.  The default is @samp{auto}, which causes @value{GDBN} to
+use the current execution mode (from the @code{T} bit in the @code{CPSR}
+register).
+
+@item show arm fallback-mode
+Show the current fallback instruction mode.
+
+@item set arm force-mode (arm|thumb|auto)
+This command overrides use of the symbol table to determine whether
+instructions are ARM or Thumb.  The default is @samp{auto}, which
+causes @value{GDBN} to use the symbol table and then the setting
+of @samp{set arm fallback-mode}.
+
+@item show arm force-mode
+Show the current forced instruction mode.
+
 @item set debug arm
 Toggle whether to display ARM-specific debugging messages from the ARM
 target support subsystem.
@@ -15645,6 +15699,24 @@ commands:
 @item regs
 @kindex regs@r{, Super-H}
 Show the values of all Super-H registers.
+
+@item set sh calling-convention @var{convention}
+@kindex set sh calling-convention
+Set the calling-convention used when calling functions from @value{GDBN}.
+Allowed values are @samp{gcc}, which is the default setting, and @samp{renesas}.
+With the @samp{gcc} setting, functions are called using the @value{NGCC} calling
+convention.  If the DWARF-2 information of the called function specifies
+that the function follows the Renesas calling convention, the function
+is called using the Renesas calling convention.  If the calling convention
+is set to @samp{renesas}, the Renesas calling convention is always used,
+regardless of the DWARF-2 information.  This can be used to override the
+default of @samp{gcc} if debug information is missing, or the compiler
+does not emit the DWARF-2 calling convention entry for a function.
+
+@item show sh calling-convention
+@kindex show sh calling-convention
+Show the current calling convention setting.
+
 @end table
 
 
@@ -16411,6 +16483,13 @@ Display debugging messages about inner workings of the AIX thread
 module.
 @item show debug aix-thread
 Show the current state of AIX thread debugging info display.
+@item set debug displaced
+@cindex displaced stepping debugging info
+Turns on or off display of @value{GDBN} debugging info for the
+displaced stepping support.  The default is off.
+@item show debug displaced
+Displays the current state of displaying @value{GDBN} debugging info
+related to displaced stepping.
 @item set debug event
 @cindex event debugging info
 Turns on or off display of @value{GDBN} event debugging info.  The
@@ -17862,10 +17941,13 @@ Notes:
 All output sequences end in a single line containing a period.
 
 @item
-The @code{@var{token}} is from the corresponding request.  If an execution
-command is interrupted by the @samp{-exec-interrupt} command, the
-@var{token} associated with the @samp{*stopped} message is the one of the
-original execution command, not the one of the interrupt command.
+The @code{@var{token}} is from the corresponding request.  Note that
+for all async output, while the token is allowed by the grammar and
+may be output by future versions of @value{GDBN} for select async
+output messages, it is generally omitted.  Frontends should treat
+all async output as reporting general changes in the state of the
+target and there should be no need to associate async output to any
+prior command.
 
 @item
 @cindex status output in @sc{gdb/mi}
@@ -18145,7 +18227,7 @@ reason that execution stopped.
 -> -exec-run
 <- ^running
 <- (gdb)
-<- *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",
+<- *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="0",
    frame=@{addr="0x08048564",func="main",
    args=[@{name="argc",value="1"@},@{name="argv",value="0xbfc4d4d4"@}],
    file="myprog.c",fullname="/home/nickrob/myprog.c",line="68"@}
@@ -18247,7 +18329,8 @@ The corresponding @value{GDBN} command is @samp{ignore}.
 @smallexample
 (gdb)
 -break-insert main
-^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",
+^done,bkpt=@{number="1",type="breakpoint",disp="keep",
+enabled="y",addr="0x000100d0",func="main",file="hello.c",
 fullname="/home/foo/hello.c",line="5",times="0"@}
 (gdb)
 -break-after 1 3
@@ -19107,8 +19190,9 @@ The corresponding @value{GDBN} corresponding is @samp{continue}.
 ^running
 (gdb)
 @@Hello world
-*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
-file="hello.c",fullname="/home/foo/bar/hello.c",line="13"@}
+*stopped,reason="breakpoint-hit",disp="keep",bkptno="2",frame=@{
+func="foo",args=[],file="hello.c",fullname="/home/foo/bar/hello.c",
+line="13"@}
 (gdb)
 @end smallexample
 
@@ -19287,7 +19371,7 @@ file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
 000-exec-run
 000^running
 (gdb)
-000*stopped,reason="breakpoint-hit",bkptno="1",
+000*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",
 frame=@{func="callee4",args=[],
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
 fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
@@ -19333,7 +19417,7 @@ The corresponding @value{GDBN} command is @samp{run}.
 -exec-run
 ^running
 (gdb)
-*stopped,reason="breakpoint-hit",bkptno="1",
+*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",
 frame=@{func="main",args=[],file="recursive2.c",
 fullname="/home/foo/bar/recursive2.c",line="4"@}
 (gdb)
@@ -20565,8 +20649,9 @@ On a PPC MBX board:
 ^running
 
 (gdb)
-*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
-args=[],file="try.c",fullname="/home/foo/bar/try.c",line="5"@}
+*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame=@{
+func="main",args=[],file="try.c",fullname="/home/foo/bar/try.c",
+line="5"@}
 (gdb)
 -data-list-changed-registers
 ^done,changed-registers=["0","1","2","4","5","6","7","8","9",
@@ -22016,7 +22101,7 @@ time=@{wallclock="0.05185",user="0.00800",system="0.00000"@}
 -exec-run
 ^running
 (gdb)
-*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",
+*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="0",
 frame=@{addr="0x080484ed",func="main",args=[@{name="argc",value="1"@},
 @{name="argv",value="0xbfb60364"@}],file="myprog.c",
 fullname="/home/nickrob/myprog.c",line="73"@}
@@ -22729,6 +22814,18 @@ Remote shared library lists (@pxref{Library List Format})
 MS-Windows shared libraries (@pxref{Shared Libraries})
 @end itemize
 
+@item zlib
+@cindex compressed debug sections 
+@value{GDBN} will use the @samp{zlib} library, if available, to read
+compressed debug sections.  Some linkers, such as GNU gold, are capable
+of producing binaries with compressed debug sections.  If @value{GDBN}
+is compiled with @samp{zlib}, it will be able to read the debug
+information in such binaries.
+
+The @samp{zlib} library is likely included with your operating system
+distribution; if it is not, you can get the latest version from
+@url{http://zlib.net}.
+
 @end table
 
 @node Running Configure
@@ -23069,6 +23166,19 @@ Shared library events.
 
 @end table
 
+@kindex maint set can-use-displaced-stepping
+@kindex maint show can-use-displaced-stepping
+@cindex displaced stepping support
+@cindex out-of-line single-stepping
+@item maint set can-use-displaced-stepping
+@itemx maint show can-use-displaced-stepping
+Control whether or not @value{GDBN} will do @dfn{displaced stepping}
+if the target supports it.  The default is on.  Displaced stepping is
+a way to single-step over breakpoints without removing them from the
+inferior, by executing an out-of-line copy of the instruction that was
+originally at the breakpoint location.  It is also known as
+out-of-line single-stepping.
+
 @kindex maint check-symtabs
 @item maint check-symtabs
 Check the consistency of psymtabs and symtabs.
This page took 0.037492 seconds and 4 git commands to generate.