• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisión1c2afe7ecf0262e792b06fdbda87b2777deb9101 (tree)
Tiempo2019-09-07 08:02:12
AutorPedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Multi-target: NEWS and user manual

This commit documents the new multi-target features in both NEWS and
user manual.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* NEWS: Mention multi-target debugging, "info connections", and
"add-inferior -no-connection".

gdb/doc/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* gdb.texinfo (Starting): Say "current inferior not connected"
instead of "GDB not connected".
(Inferiors and Programs): Rename node to ...
(Inferiors Connections and Programs): ... this. Update all
references. Talk about multiple target connections. Update "info
inferiors" info to mention the connections column. Describe "info
connections". Document "add-inferior -no-connection".
* guile.texi, python.texi: Update cross references.

Cambiar Resumen

Diferencia incremental

--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -29,6 +29,21 @@
2929
3030 * The RX port now supports XML target descriptions.
3131
32+* Multi-target debugging support
33+
34+ GDB now supports debugging multiple target connections
35+ simultaneously. For example, you can now have each inferior
36+ connected to different remote servers running in different machines,
37+ or have one inferior debugging a local native process, an inferior
38+ debugging a core dump, etc.
39+
40+ This support is experimental and comes with some limitations -- you
41+ can only resume multiple targets simultaneously if all targets
42+ support non-stop mode, and all remote stubs or servers must support
43+ the same set of remote protocol features exactly. See also "info
44+ connections" and "add-inferior -no-connection" below, and "maint set
45+ target-non-stop" in the user manual.
46+
3247 * Python API
3348
3449 ** The gdb.Value type has a new method 'format_string' which returns a
@@ -130,6 +145,9 @@ show print frame-info
130145 'frame', 'stepi'. The python frame filtering also respect this setting.
131146 The 'backtrace' '-frame-info' option can override this global setting.
132147
148+info connections
149+ Lists the target connections currently in use.
150+
133151 * Changed commands
134152
135153 help
@@ -174,6 +192,17 @@ show print raw-frame-arguments
174192 old commands are now deprecated and may be removed in a future
175193 release.
176194
195+add-inferior [-no-connection]
196+ The add-inferior command now supports a "-no-connection" flag that
197+ makes the new inferior start with no target connection associated.
198+ By default, the new inferior inherits the target connection of the
199+ current inferior. See also "info connections".
200+
201+info inferior
202+ This command's output now includes a new "Connection" column
203+ indicating which target connection an inferior is bound to. See
204+ "info connections" above.
205+
177206 maint test-options require-delimiter
178207 maint test-options unknown-is-error
179208 maint test-options unknown-is-operand
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -2237,8 +2237,7 @@ kill a child process.
22372237 * Input/Output:: Your program's input and output
22382238 * Attach:: Debugging an already-running process
22392239 * Kill Process:: Killing the child process
2240-
2241-* Inferiors and Programs:: Debugging multiple inferiors and programs
2240+* Inferiors Connections and Programs:: Debugging multiple inferiors connections and programs
22422241 * Threads:: Debugging programs with multiple threads
22432242 * Forks:: Debugging forks
22442243 * Checkpoint/Restart:: Setting a @emph{bookmark} to return to later
@@ -2493,27 +2492,28 @@ $@file{.zshenv} for the Z shell, or the file specified in the
24932492 @itemx set auto-connect-native-target off
24942493 @itemx show auto-connect-native-target
24952494
2496-By default, if not connected to any target yet (e.g., with
2497-@code{target remote}), the @code{run} command starts your program as a
2498-native process under @value{GDBN}, on your local machine. If you're
2499-sure you don't want to debug programs on your local machine, you can
2500-tell @value{GDBN} to not connect to the native target automatically
2501-with the @code{set auto-connect-native-target off} command.
2495+By default, if the current inferior is not connected to any target yet
2496+(e.g., with @code{target remote}), the @code{run} command starts your
2497+program as a native process under @value{GDBN}, on your local machine.
2498+If you're sure you don't want to debug programs on your local machine,
2499+you can tell @value{GDBN} to not connect to the native target
2500+automatically with the @code{set auto-connect-native-target off}
2501+command.
25022502
2503-If @code{on}, which is the default, and if @value{GDBN} is not
2503+If @code{on}, which is the default, and if the current inferior is not
25042504 connected to a target already, the @code{run} command automaticaly
25052505 connects to the native target, if one is available.
25062506
2507-If @code{off}, and if @value{GDBN} is not connected to a target
2508-already, the @code{run} command fails with an error:
2507+If @code{off}, and if the current inferior is not connected to a
2508+target already, the @code{run} command fails with an error:
25092509
25102510 @smallexample
25112511 (@value{GDBP}) run
25122512 Don't know how to run. Try "help target".
25132513 @end smallexample
25142514
2515-If @value{GDBN} is already connected to a target, @value{GDBN} always
2516-uses it with the @code{run} command.
2515+If the current inferior is already connected to a target, @value{GDBN}
2516+always uses it with the @code{run} command.
25172517
25182518 In any case, you can explicitly connect to the native target with the
25192519 @code{target native} command. For example,
@@ -2943,15 +2943,17 @@ next type @code{run}, @value{GDBN} notices that the file has changed, and
29432943 reads the symbol table again (while trying to preserve your current
29442944 breakpoint settings).
29452945
2946-@node Inferiors and Programs
2947-@section Debugging Multiple Inferiors and Programs
2946+@node Inferiors Connections and Programs
2947+@section Debugging Multiple Inferiors Connections and Programs
29482948
29492949 @value{GDBN} lets you run and debug multiple programs in a single
29502950 session. In addition, @value{GDBN} on some systems may let you run
29512951 several programs simultaneously (otherwise you have to exit from one
2952-before starting another). In the most general case, you can have
2953-multiple threads of execution in each of multiple processes, launched
2954-from multiple executables.
2952+before starting another). On some systems @value{GDBN} may even let
2953+you debug several programs simultaneously on different remote systems.
2954+In the most general case, you can have multiple threads of execution
2955+in each of multiple processes, launched from multiple executables,
2956+running on different machines.
29552957
29562958 @cindex inferior
29572959 @value{GDBN} represents the state of each program execution with an
@@ -2986,6 +2988,11 @@ the inferior number assigned by @value{GDBN}
29862988 the target system's inferior identifier
29872989
29882990 @item
2991+the target connection the inferior is bound to. This includes the
2992+unique connection number assigned by @value{GDBN}, and the name of the
2993+protocol used by the connection.
2994+
2995+@item
29892996 the name of the executable the inferior is running.
29902997
29912998 @end enumerate
@@ -3000,11 +3007,57 @@ For example,
30003007
30013008 @smallexample
30023009 (@value{GDBP}) info inferiors
3003- Num Description Executable
3004- 2 process 2307 hello
3005-* 1 process 3401 goodbye
3010+ Num Description Connection Executable
3011+* 1 process 3401 1 (native) goodbye
3012+ 2 process 2307 2 (extended-remote host:10000) hello
3013+@end smallexample
3014+
3015+To find out what open target connections exist at any moment, use
3016+@w{@code{info connections}}:
3017+
3018+@table @code
3019+@kindex info connections [ @var{id}@dots{} ]
3020+@item info connections
3021+Print a list of all open target connections currently being managed by
3022+@value{GDBN}. By default all connections are printed, but the
3023+argument @var{id}@dots{} -- a space separated list of connections
3024+numbers -- can be used to limit the display to just the requested
3025+connections.
3026+
3027+@value{GDBN} displays for each connection (in this order):
3028+
3029+@enumerate
3030+@item
3031+the connection number assigned by @value{GDBN}
3032+
3033+@item
3034+the connection name, derived from the protocol used by the connection.
3035+
3036+@item
3037+a textual description of the protocol used by the connection.
3038+
3039+@end enumerate
3040+
3041+@noindent
3042+An asterisk @samp{*} preceding the @value{GDBN} connection number
3043+indicates the connection of the current inferior.
3044+
3045+For example,
3046+@end table
3047+@c end table here to get a little more width for example
3048+
3049+@smallexample
3050+(@value{GDBP}) info connections
3051+ Num Name Description
3052+* 1 extended-remote host:10000 Extended remote serial target in gdb-specific protocol
3053+ 2 native Native process
3054+ 3 core Local core dump file
30063055 @end smallexample
30073056
3057+There's no explicit way to switch focus between connections. Instead,
3058+you switch focus between inferiors, which implicitly switches the
3059+focus to the selected inferior's connection.
3060+
30083061 To switch focus between inferiors, use the @code{inferior} command:
30093062
30103063 @table @code
@@ -3031,13 +3084,22 @@ remove inferiors from the debugging session use the
30313084
30323085 @table @code
30333086 @kindex add-inferior
3034-@item add-inferior [ -copies @var{n} ] [ -exec @var{executable} ]
3087+@item add-inferior [ -copies @var{n} ] [ -exec @var{executable} ] [-no-connection ]
30353088 Adds @var{n} inferiors to be run using @var{executable} as the
30363089 executable; @var{n} defaults to 1. If no executable is specified,
30373090 the inferiors begins empty, with no program. You can still assign or
30383091 change the program assigned to the inferior at any time by using the
30393092 @code{file} command with the executable name as its argument.
30403093
3094+By default, the new inferior begins connected to the same target
3095+connection as the current inferior. For example, if the current
3096+inferior was connected to @code{gdbserver} with @code{target remote},
3097+then the new inferior will be connected to the same @code{gdbserver}
3098+instance. The @samp{-no-connection} option starts the new inferior
3099+with no connection yet. You can then for example use the @code{target
3100+remote} command to connect to some other @code{gdbserver} instance,
3101+use @code{run} to spawn a local program, etc.
3102+
30413103 @kindex clone-inferior
30423104 @item clone-inferior [ -copies @var{n} ] [ @var{infno} ]
30433105 Adds @var{n} inferiors ready to execute the same program as inferior
@@ -3047,15 +3109,15 @@ want to run another instance of the inferior you are debugging.
30473109
30483110 @smallexample
30493111 (@value{GDBP}) info inferiors
3050- Num Description Executable
3051-* 1 process 29964 helloworld
3112+ Num Description Connection Executable
3113+* 1 process 29964 1 (native) helloworld
30523114 (@value{GDBP}) clone-inferior
30533115 Added inferior 2.
30543116 1 inferiors added.
30553117 (@value{GDBP}) info inferiors
3056- Num Description Executable
3057- 2 <null> helloworld
3058-* 1 process 29964 helloworld
3118+ Num Description Connection Executable
3119+* 1 process 29964 1 (native) helloworld
3120+ 2 <null> 1 (native) helloworld
30593121 @end smallexample
30603122
30613123 You can now simply switch focus to inferior 2 and run it.
@@ -3708,14 +3770,14 @@ If you choose to set @samp{detach-on-fork} mode off, then @value{GDBN}
37083770 will retain control of all forked processes (including nested forks).
37093771 You can list the forked processes under the control of @value{GDBN} by
37103772 using the @w{@code{info inferiors}} command, and switch from one fork
3711-to another by using the @code{inferior} command (@pxref{Inferiors and
3712-Programs, ,Debugging Multiple Inferiors and Programs}).
3773+to another by using the @code{inferior} command (@pxref{Inferiors Connections and
3774+Programs, ,Debugging Multiple Inferiors Connections and Programs}).
37133775
37143776 To quit debugging one of the forked processes, you can either detach
37153777 from it by using the @w{@code{detach inferiors}} command (allowing it
37163778 to run independently), or kill it using the @w{@code{kill inferiors}}
3717-command. @xref{Inferiors and Programs, ,Debugging Multiple Inferiors
3718-and Programs}.
3779+command. @xref{Inferiors Connections and Programs, ,Debugging
3780+Multiple Inferiors Connections and Programs}.
37193781
37203782 If you ask to debug a child process and a @code{vfork} is followed by an
37213783 @code{exec}, @value{GDBN} executes the new target up to the first
@@ -11769,8 +11831,8 @@ gdbserver that supports the @code{qGetTIBAddr} request.
1176911831 This variable contains the address of the thread information block.
1177011832
1177111833 @item $_inferior
11772-The number of the current inferior. @xref{Inferiors and
11773-Programs, ,Debugging Multiple Inferiors and Programs}.
11834+The number of the current inferior. @xref{Inferiors Connections and
11835+Programs, ,Debugging Multiple Inferiors Connections and Programs}.
1177411836
1177511837 @item $_thread
1177611838 The thread number of the current thread. @xref{thread numbers}.
@@ -12877,7 +12939,7 @@ character.
1287712939
1287812940 @value{GDBN} caches data exchanged between the debugger and a target.
1287912941 Each cache is associated with the address space of the inferior.
12880-@xref{Inferiors and Programs}, about inferior and address space.
12942+@xref{Inferiors Connections and Programs}, about inferior and address space.
1288112943 Such caching generally improves performance in remote debugging
1288212944 (@pxref{Remote Debugging}), because it reduces the overhead of the
1288312945 remote protocol by bundling memory reads and writes into large chunks.
@@ -28219,7 +28281,7 @@ groups can be obtained using @samp{-list-thread-groups --available}.
2821928281 In general, the content of a thread group may be only retrieved only
2822028282 after attaching to that thread group.
2822128283
28222-Thread groups are related to inferiors (@pxref{Inferiors and
28284+Thread groups are related to inferiors (@pxref{Inferiors Connections and
2822328285 Programs}). Each inferior corresponds to a thread group of a special
2822428286 type @samp{process}, and some additional operations are permitted on
2822528287 such thread groups.
@@ -35119,7 +35181,7 @@ popup menu, but is needless clutter on the command line, and
3511935181 -add-inferior
3512035182 @end smallexample
3512135183
35122-Creates a new inferior (@pxref{Inferiors and Programs}). The created
35184+Creates a new inferior (@pxref{Inferiors Connections and Programs}). The created
3512335185 inferior is not associated with any executable. Such association may
3512435186 be established with the @samp{-file-exec-and-symbols} command
3512535187 (@pxref{GDB/MI File Commands}). The command response has a single
@@ -45398,11 +45460,11 @@ command, otherwise you may get an error that looks something like
4539845460 @command{gdbserver} can also debug multiple inferiors at once,
4539945461 described in
4540045462 @ifset man
45401-the @value{GDBN} manual in node @code{Inferiors and Programs}
45402--- shell command @code{info -f gdb -n 'Inferiors and Programs'}.
45463+the @value{GDBN} manual in node @code{Inferiors Connections and Programs}
45464+-- shell command @code{info -f gdb -n 'Inferiors Connections and Programs'}.
4540345465 @end ifset
4540445466 @ifclear man
45405-@ref{Inferiors and Programs}.
45467+@ref{Inferiors Connections and Programs}.
4540645468 @end ifclear
4540745469 In such case use the @code{extended-remote} @value{GDBN} command variant:
4540845470
--- a/gdb/doc/guile.texi
+++ b/gdb/doc/guile.texi
@@ -2155,7 +2155,7 @@ A program space, or @dfn{progspace}, represents a symbolic view
21552155 of an address space.
21562156 It consists of all of the objfiles of the program.
21572157 @xref{Objfiles In Guile}.
2158-@xref{Inferiors and Programs, program spaces}, for more details
2158+@xref{Inferiors Connections and Programs, program spaces}, for more details
21592159 about program spaces.
21602160
21612161 Each progspace is represented by an instance of the @code{<gdb:progspace>}
@@ -2178,7 +2178,7 @@ if the program it refers to is not loaded in @value{GDBN} any longer.
21782178 @deffn {Scheme Procedure} current-progspace
21792179 This function returns the program space of the currently selected inferior.
21802180 There is always a current progspace, this never returns @code{#f}.
2181-@xref{Inferiors and Programs}.
2181+@xref{Inferiors Connections and Programs}.
21822182 @end deffn
21832183
21842184 @deffn {Scheme Procedure} progspaces
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -2928,7 +2928,7 @@ itself.
29282928
29292929 @findex gdb.Inferior
29302930 Programs which are being run under @value{GDBN} are called inferiors
2931-(@pxref{Inferiors and Programs}). Python scripts can access
2931+(@pxref{Inferiors Connections and Programs}). Python scripts can access
29322932 information about and manipulate inferiors controlled by @value{GDBN}
29332933 via objects of the @code{gdb.Inferior} class.
29342934
@@ -4158,7 +4158,7 @@ A program space, or @dfn{progspace}, represents a symbolic view
41584158 of an address space.
41594159 It consists of all of the objfiles of the program.
41604160 @xref{Objfiles In Python}.
4161-@xref{Inferiors and Programs, program spaces}, for more details
4161+@xref{Inferiors Connections and Programs, program spaces}, for more details
41624162 about program spaces.
41634163
41644164 The following progspace-related functions are available in the
@@ -4167,7 +4167,7 @@ The following progspace-related functions are available in the
41674167 @findex gdb.current_progspace
41684168 @defun gdb.current_progspace ()
41694169 This function returns the program space of the currently selected inferior.
4170-@xref{Inferiors and Programs}. This is identical to
4170+@xref{Inferiors Connections and Programs}. This is identical to
41714171 @code{gdb.selected_inferior().progspace} (@pxref{Inferiors In Python}) and is
41724172 included for historical compatibility.
41734173 @end defun