Move the documentation for the "poll" command up with
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 10 Jun 2009 04:06:25 +0000 (04:06 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 10 Jun 2009 04:06:25 +0000 (04:06 +0000)
other server configuration.  Explain what it's about;
reference the related "$target_name curstate" method.

Update "poll" output to report whether background polling
is enabled or not.

Also fix a small typo; PC's have "complementary" tools.
Some have also "complimentary" ones; but not all.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2178 b42882b7-edfa-0310-969c-e2dbd0fdcd60

doc/openocd.texi
src/target/target.c

index 5557cbc82ea7c4a496ccda6b950f65c92daceb5e..dac38c0a9e1e53e96ba19029ea34608a20cab4c7 100644 (file)
@@ -1302,6 +1302,67 @@ The default behaviour is @option{disable};
 use @option{enable} see these errors reported.
 @end deffn
 
 use @option{enable} see these errors reported.
 @end deffn
 
+@anchor{Event Polling}
+@section Event Polling
+
+Hardware debuggers are parts of asynchronous systems,
+where significant events can happen at any time.
+The OpenOCD server needs to detect some of these events,
+so it can report them to through TCL command line
+or to GDB.
+
+Examples of such events include:
+
+@itemize
+@item One of the targets can stop running ... maybe it triggers
+a code breakpoint or data watchpoint, or halts itself.
+@item Messages may be sent over ``debug message'' channels ... many
+targets support such messages sent over JTAG,
+for receipt by the person debugging or tools.
+@item Loss of power ... some adapters can detect these events.
+@item Resets not issued through JTAG ... such reset sources
+can include button presses or other system hardware, sometimes
+including the target itself (perhaps through a watchdog).
+@item Debug instrumentation sometimes supports event triggering
+such as ``trace buffer full'' (so it can quickly be emptied)
+or other signals (to correlate with code behavior).
+@end itemize
+
+None of those events are signaled through standard JTAG signals.
+However, most conventions for JTAG connectors include voltage
+level and system reset (SRST) signal detection.
+Some connectors also include instrumentation signals, which
+can imply events when those signals are inputs.
+
+In general, OpenOCD needs to periodically check for those events,
+either by looking at the status of signals on the JTAG connector
+or by sending synchronous ``tell me your status'' JTAG requests
+to the various active targets.
+There is a command to manage and monitor that polling,
+which is normally done in the background.
+
+@deffn Command poll [@option{on}|@option{off}]
+Poll the current target for its current state.
+(Also, @pxref{target curstate}.)
+If that target is in debug mode, architecture
+specific information about the current state is printed.
+An optional parameter
+allows background polling to be enabled and disabled.
+
+You could use this from the TCL command shell, or
+from GDB using @command{monitor poll} command.
+@example
+> poll
+background polling: on
+target state: halted
+target halted in ARM state due to debug-request, \
+               current mode: Supervisor
+cpsr: 0x800000d3 pc: 0x11081bfc
+MMU: disabled, D-Cache: disabled, I-Cache: enabled
+>
+@end example
+@end deffn
+
 @node Interface - Dongle Configuration
 @chapter Interface - Dongle Configuration
 JTAG Adapters/Interfaces/Dongles are normally configured
 @node Interface - Dongle Configuration
 @chapter Interface - Dongle Configuration
 JTAG Adapters/Interfaces/Dongles are normally configured
@@ -2492,12 +2553,14 @@ for @{ set x 0 @} @{ $x < [target count] @} @{ incr x @} @{
 @end example
 @end deffn
 
 @end example
 @end deffn
 
+@anchor{target curstate}
 @deffn Command {$target_name curstate}
 Displays the current target state:
 @code{debug-running},
 @code{halted},
 @code{reset},
 @code{running}, or @code{unknown}.
 @deffn Command {$target_name curstate}
 Displays the current target state:
 @code{debug-running},
 @code{halted},
 @code{reset},
 @code{running}, or @code{unknown}.
+(Also, @pxref{Event Polling}.)
 @end deffn
 
 @deffn Command {$target_name eventlist}
 @end deffn
 
 @deffn Command {$target_name eventlist}
@@ -3769,23 +3832,6 @@ Debug and trace infrastructure:
 @end example
 @end deffn
 
 @end example
 @end deffn
 
-@deffn Command poll [@option{on}|@option{off}]
-Poll the current target for its current state.
-If that target is in debug mode, architecture
-specific information about the current state is printed. An optional parameter
-allows continuous polling to be enabled and disabled.
-
-@example
-> poll
-target state: halted
-target halted in ARM state due to debug-request, \
-               current mode: Supervisor
-cpsr: 0x800000d3 pc: 0x11081bfc
-MMU: disabled, D-Cache: disabled, I-Cache: enabled
->
-@end example
-@end deffn
-
 @deffn Command halt [ms]
 @deffnx Command wait_halt [ms]
 The @command{halt} command first sends a halt request to the target,
 @deffn Command halt [ms]
 @deffnx Command wait_halt [ms]
 The @command{halt} command first sends a halt request to the target,
@@ -3843,7 +3889,7 @@ state.
 These commands are available when
 OpenOCD is built with @option{--enable-ioutil}.
 They are mainly useful on embedded targets;
 These commands are available when
 OpenOCD is built with @option{--enable-ioutil}.
 They are mainly useful on embedded targets;
-PC type hosts have complimentary tools.
+PC type hosts have complementary tools.
 
 @emph{Note:} there are several more such commands.
 
 
 @emph{Note:} there are several more such commands.
 
index 8bc8e4c0bdc9d0e767ed2a6f412adf8a23c57e57..1ac666e51e5cf1f7f473d4bfb87ae02bcba0cee1 100644 (file)
@@ -1770,9 +1770,11 @@ static int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
        if (argc == 0)
        {
 
        if (argc == 0)
        {
-               if((retval = target_poll(target)) != ERROR_OK)
+               command_print(cmd_ctx, "background polling: %s",
+                               target_continous_poll ?  "on" : "off");
+               if ((retval = target_poll(target)) != ERROR_OK)
                        return retval;
                        return retval;
-               if((retval = target_arch_state(target)) != ERROR_OK)
+               if ((retval = target_arch_state(target)) != ERROR_OK)
                        return retval;
 
        }
                        return retval;
 
        }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)