diff options
author | Peter Horn <peter.horn@bluewin.ch> | 2011-07-04 11:25:26 +0100 |
---|---|---|
committer | Spencer Oliver <ntfreak@users.sourceforge.net> | 2011-07-04 11:31:52 +0100 |
commit | d4cd6f032015552f00bf4b5a90f25f5f958e9d9e (patch) | |
tree | 7d60728bcf75fbc84867ebceb5fc0784145fff09 /doc | |
parent | 89fa8ce2d8c58707f3dfda397138f8ee336e1a47 (diff) | |
download | riscv-openocd-d4cd6f032015552f00bf4b5a90f25f5f958e9d9e.zip riscv-openocd-d4cd6f032015552f00bf4b5a90f25f5f958e9d9e.tar.gz riscv-openocd-d4cd6f032015552f00bf4b5a90f25f5f958e9d9e.tar.bz2 |
cortex_m3: add auto maskisr
This patch extends the cortex_m3 maskisr command by a new option 'auto'.
The 'auto' option handles interrupts during stepping in a way they are
processed but don't disturb the program flow during debugging.
Before one had to choose to either enable or disable interrupts. The former
steps into interrupt handlers when they trigger. This disturbs the flow during
debugging, making it hard to follow some piece of code when interrupts occur
often.
When interrupts are disabled, the flow isn't disturbed but code relying on
interrupt handlers to be processed will stop working. For example a delay
function counting the number of timer interrupts will never complete, RTOS
task switching will not occur and output I/O queues of interrupt driven
I/O will stall or overflow.
Using the 'maskisr' command also typically requires gdb hooks to be supplied
by the user to switch interrupts off during the step and to enable them again
afterward.
The new 'auto' option of the 'maskisr' command solves the above problems. When
set, the step command allows pending interrupt handlers to be executed before
the step, then the step is taken with interrupts disabled and finally interrupts
are enabled again. This way interrupt processing stays in the background without
disturbing the flow of debugging. No gdb hooks are required. The 'auto'
option is the default, since it's believed that handling interrupts in this
way is suitable for most users.
The principle used for interrupt handling could probably be used for other
targets too.
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/openocd.texi | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi index 892661f..fd92d51 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6720,8 +6720,21 @@ If @var{value} is defined, first assigns that. @subsection Cortex-M3 specific commands @cindex Cortex-M3 -@deffn Command {cortex_m3 maskisr} (@option{on}|@option{off}) +@deffn Command {cortex_m3 maskisr} (@option{auto}|@option{on}|@option{off}) Control masking (disabling) interrupts during target step/resume. + +The @option{auto} option handles interrupts during stepping a way they get +served but don't disturb the program flow. The step command first allows +pending interrupt handlers to execute, then disables interrupts and steps over +the next instruction where the core was halted. After the step interrupts +are enabled again. If the interrupt handlers don't complete within 500ms, +the step command leaves with the core running. + +Note that a free breakpoint is required for the @option{auto} option. If no +breakpoint is available at the time of the step, then the step is taken +with interrupts enabled, i.e. the same way the @option{off} option does. + +Default is @option{auto}. @end deffn @deffn Command {cortex_m3 vector_catch} [@option{all}|@option{none}|list] |