GNU Binutils with patches for OS216
Revisión | 1c2afe7ecf0262e792b06fdbda87b2777deb9101 (tree) |
---|---|
Tiempo | 2019-09-07 08:02:12 |
Autor | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
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.
@@ -29,6 +29,21 @@ | ||
29 | 29 | |
30 | 30 | * The RX port now supports XML target descriptions. |
31 | 31 | |
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 | + | |
32 | 47 | * Python API |
33 | 48 | |
34 | 49 | ** The gdb.Value type has a new method 'format_string' which returns a |
@@ -130,6 +145,9 @@ show print frame-info | ||
130 | 145 | 'frame', 'stepi'. The python frame filtering also respect this setting. |
131 | 146 | The 'backtrace' '-frame-info' option can override this global setting. |
132 | 147 | |
148 | +info connections | |
149 | + Lists the target connections currently in use. | |
150 | + | |
133 | 151 | * Changed commands |
134 | 152 | |
135 | 153 | help |
@@ -174,6 +192,17 @@ show print raw-frame-arguments | ||
174 | 192 | old commands are now deprecated and may be removed in a future |
175 | 193 | release. |
176 | 194 | |
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 | + | |
177 | 206 | maint test-options require-delimiter |
178 | 207 | maint test-options unknown-is-error |
179 | 208 | maint test-options unknown-is-operand |
@@ -2237,8 +2237,7 @@ kill a child process. | ||
2237 | 2237 | * Input/Output:: Your program's input and output |
2238 | 2238 | * Attach:: Debugging an already-running process |
2239 | 2239 | * 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 | |
2242 | 2241 | * Threads:: Debugging programs with multiple threads |
2243 | 2242 | * Forks:: Debugging forks |
2244 | 2243 | * 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 | ||
2493 | 2492 | @itemx set auto-connect-native-target off |
2494 | 2493 | @itemx show auto-connect-native-target |
2495 | 2494 | |
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. | |
2502 | 2502 | |
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 | |
2504 | 2504 | connected to a target already, the @code{run} command automaticaly |
2505 | 2505 | connects to the native target, if one is available. |
2506 | 2506 | |
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: | |
2509 | 2509 | |
2510 | 2510 | @smallexample |
2511 | 2511 | (@value{GDBP}) run |
2512 | 2512 | Don't know how to run. Try "help target". |
2513 | 2513 | @end smallexample |
2514 | 2514 | |
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. | |
2517 | 2517 | |
2518 | 2518 | In any case, you can explicitly connect to the native target with the |
2519 | 2519 | @code{target native} command. For example, |
@@ -2943,15 +2943,17 @@ next type @code{run}, @value{GDBN} notices that the file has changed, and | ||
2943 | 2943 | reads the symbol table again (while trying to preserve your current |
2944 | 2944 | breakpoint settings). |
2945 | 2945 | |
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 | |
2948 | 2948 | |
2949 | 2949 | @value{GDBN} lets you run and debug multiple programs in a single |
2950 | 2950 | session. In addition, @value{GDBN} on some systems may let you run |
2951 | 2951 | 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. | |
2955 | 2957 | |
2956 | 2958 | @cindex inferior |
2957 | 2959 | @value{GDBN} represents the state of each program execution with an |
@@ -2986,6 +2988,11 @@ the inferior number assigned by @value{GDBN} | ||
2986 | 2988 | the target system's inferior identifier |
2987 | 2989 | |
2988 | 2990 | @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 | |
2989 | 2996 | the name of the executable the inferior is running. |
2990 | 2997 | |
2991 | 2998 | @end enumerate |
@@ -3000,11 +3007,57 @@ For example, | ||
3000 | 3007 | |
3001 | 3008 | @smallexample |
3002 | 3009 | (@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 | |
3006 | 3055 | @end smallexample |
3007 | 3056 | |
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 | + | |
3008 | 3061 | To switch focus between inferiors, use the @code{inferior} command: |
3009 | 3062 | |
3010 | 3063 | @table @code |
@@ -3031,13 +3084,22 @@ remove inferiors from the debugging session use the | ||
3031 | 3084 | |
3032 | 3085 | @table @code |
3033 | 3086 | @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 ] | |
3035 | 3088 | Adds @var{n} inferiors to be run using @var{executable} as the |
3036 | 3089 | executable; @var{n} defaults to 1. If no executable is specified, |
3037 | 3090 | the inferiors begins empty, with no program. You can still assign or |
3038 | 3091 | change the program assigned to the inferior at any time by using the |
3039 | 3092 | @code{file} command with the executable name as its argument. |
3040 | 3093 | |
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 | + | |
3041 | 3103 | @kindex clone-inferior |
3042 | 3104 | @item clone-inferior [ -copies @var{n} ] [ @var{infno} ] |
3043 | 3105 | 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. | ||
3047 | 3109 | |
3048 | 3110 | @smallexample |
3049 | 3111 | (@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 | |
3052 | 3114 | (@value{GDBP}) clone-inferior |
3053 | 3115 | Added inferior 2. |
3054 | 3116 | 1 inferiors added. |
3055 | 3117 | (@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 | |
3059 | 3121 | @end smallexample |
3060 | 3122 | |
3061 | 3123 | 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} | ||
3708 | 3770 | will retain control of all forked processes (including nested forks). |
3709 | 3771 | You can list the forked processes under the control of @value{GDBN} by |
3710 | 3772 | 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}). | |
3713 | 3775 | |
3714 | 3776 | To quit debugging one of the forked processes, you can either detach |
3715 | 3777 | from it by using the @w{@code{detach inferiors}} command (allowing it |
3716 | 3778 | 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}. | |
3719 | 3781 | |
3720 | 3782 | If you ask to debug a child process and a @code{vfork} is followed by an |
3721 | 3783 | @code{exec}, @value{GDBN} executes the new target up to the first |
@@ -11769,8 +11831,8 @@ gdbserver that supports the @code{qGetTIBAddr} request. | ||
11769 | 11831 | This variable contains the address of the thread information block. |
11770 | 11832 | |
11771 | 11833 | @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}. | |
11774 | 11836 | |
11775 | 11837 | @item $_thread |
11776 | 11838 | The thread number of the current thread. @xref{thread numbers}. |
@@ -12877,7 +12939,7 @@ character. | ||
12877 | 12939 | |
12878 | 12940 | @value{GDBN} caches data exchanged between the debugger and a target. |
12879 | 12941 | 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. | |
12881 | 12943 | Such caching generally improves performance in remote debugging |
12882 | 12944 | (@pxref{Remote Debugging}), because it reduces the overhead of the |
12883 | 12945 | 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}. | ||
28219 | 28281 | In general, the content of a thread group may be only retrieved only |
28220 | 28282 | after attaching to that thread group. |
28221 | 28283 | |
28222 | -Thread groups are related to inferiors (@pxref{Inferiors and | |
28284 | +Thread groups are related to inferiors (@pxref{Inferiors Connections and | |
28223 | 28285 | Programs}). Each inferior corresponds to a thread group of a special |
28224 | 28286 | type @samp{process}, and some additional operations are permitted on |
28225 | 28287 | such thread groups. |
@@ -35119,7 +35181,7 @@ popup menu, but is needless clutter on the command line, and | ||
35119 | 35181 | -add-inferior |
35120 | 35182 | @end smallexample |
35121 | 35183 | |
35122 | -Creates a new inferior (@pxref{Inferiors and Programs}). The created | |
35184 | +Creates a new inferior (@pxref{Inferiors Connections and Programs}). The created | |
35123 | 35185 | inferior is not associated with any executable. Such association may |
35124 | 35186 | be established with the @samp{-file-exec-and-symbols} command |
35125 | 35187 | (@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 | ||
45398 | 45460 | @command{gdbserver} can also debug multiple inferiors at once, |
45399 | 45461 | described in |
45400 | 45462 | @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'}. | |
45403 | 45465 | @end ifset |
45404 | 45466 | @ifclear man |
45405 | -@ref{Inferiors and Programs}. | |
45467 | +@ref{Inferiors Connections and Programs}. | |
45406 | 45468 | @end ifclear |
45407 | 45469 | In such case use the @code{extended-remote} @value{GDBN} command variant: |
45408 | 45470 |
@@ -2155,7 +2155,7 @@ A program space, or @dfn{progspace}, represents a symbolic view | ||
2155 | 2155 | of an address space. |
2156 | 2156 | It consists of all of the objfiles of the program. |
2157 | 2157 | @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 | |
2159 | 2159 | about program spaces. |
2160 | 2160 | |
2161 | 2161 | 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. | ||
2178 | 2178 | @deffn {Scheme Procedure} current-progspace |
2179 | 2179 | This function returns the program space of the currently selected inferior. |
2180 | 2180 | There is always a current progspace, this never returns @code{#f}. |
2181 | -@xref{Inferiors and Programs}. | |
2181 | +@xref{Inferiors Connections and Programs}. | |
2182 | 2182 | @end deffn |
2183 | 2183 | |
2184 | 2184 | @deffn {Scheme Procedure} progspaces |
@@ -2928,7 +2928,7 @@ itself. | ||
2928 | 2928 | |
2929 | 2929 | @findex gdb.Inferior |
2930 | 2930 | 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 | |
2932 | 2932 | information about and manipulate inferiors controlled by @value{GDBN} |
2933 | 2933 | via objects of the @code{gdb.Inferior} class. |
2934 | 2934 |
@@ -4158,7 +4158,7 @@ A program space, or @dfn{progspace}, represents a symbolic view | ||
4158 | 4158 | of an address space. |
4159 | 4159 | It consists of all of the objfiles of the program. |
4160 | 4160 | @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 | |
4162 | 4162 | about program spaces. |
4163 | 4163 | |
4164 | 4164 | The following progspace-related functions are available in the |
@@ -4167,7 +4167,7 @@ The following progspace-related functions are available in the | ||
4167 | 4167 | @findex gdb.current_progspace |
4168 | 4168 | @defun gdb.current_progspace () |
4169 | 4169 | 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 | |
4171 | 4171 | @code{gdb.selected_inferior().progspace} (@pxref{Inferiors In Python}) and is |
4172 | 4172 | included for historical compatibility. |
4173 | 4173 | @end defun |