@@ -11727,13 +11727,26 @@ the target supports, these commands let you
1172711727set those triggers directly. (It's also possible to do so by writing the
1172811728appropriate CSRs.)
1172911729
11730- @deffn {Command} {riscv etrigger set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] exception_codes
11730+ @option{trigger_action} selects one of the configurable RISC-V trigger actions:
11731+
11732+ @itemize @minus
11733+ @item @option{exception}: Raise a breakpoint exception
11734+ @item @option{halt}: Enter Debug Mode
11735+ @item @option{trace_on}: Trace on
11736+ @item @option{trace_off}: Trace off
11737+ @item @option{trace_notify}: Trace notify
11738+ @item @option{external0}: Send a signal to TM external trigger output 0
11739+ @item @option{external1}: Send a signal to TM external trigger output 1
11740+ @end itemize
11741+
11742+ @deffn {Command} {riscv etrigger set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] exception_codes [@option{trigger_action}]
1173111743Set an exception trigger (type 5) on the current target, which halts the target when it
1173211744fires. @option{m}, @option{s}, @option{u}, @option{vs}, and @option{vu} control
1173311745which execution modes the trigger fires in. @var{exception_codes} is a bit
1173411746field, where each bit corresponds to an exception code in mcause (defined in the
1173511747RISC-V Privileged Spec). The etrigger will fire on the exceptions whose bits are
11736- set in @var{exception_codes}.
11748+ set in @var{exception_codes}. @option{trigger_action} control the desired behavior
11749+ on the target when the trigger fires. Defaults to @option{halt}, which halts the target.
1173711750
1173811751For details on this trigger type, see the RISC-V Debug Specification.
1173911752@end deffn
@@ -11742,7 +11755,11 @@ For details on this trigger type, see the RISC-V Debug Specification.
1174211755Clear the type 5 trigger that was set using @command{riscv etrigger set}.
1174311756@end deffn
1174411757
11745- @deffn {Command} {riscv icount set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] [@option{pending}] count
11758+ @deffn {Command} {riscv etrigger list}
11759+ List the type 5 trigger that was set using @command{riscv etrigger set}.
11760+ @end deffn
11761+
11762+ @deffn {Command} {riscv icount set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] [@option{pending}] count [@option{trigger_action}]
1174611763Set an instruction count
1174711764trigger (type 3) on the current target, which halts the target when it fires.
1174811765@option{m}, @option{s}, @option{u}, @option{vs}, and @option{vu} control which
@@ -11751,6 +11768,8 @@ pending bit is set, which is unlikely to be useful unless you're debugging the
1175111768hardware implementation of this trigger.
1175211769@var{count} sets the number of instructions to execute before the trigger is
1175311770taken.
11771+ @option{trigger_action} control the desired behavior on the target when the
11772+ trigger fires. Defaults to @option{halt}, which halts the target.
1175411773
1175511774For details on this trigger type, see the RISC-V Debug Specification.
1175611775@end deffn
@@ -11759,21 +11778,56 @@ For details on this trigger type, see the RISC-V Debug Specification.
1175911778Clear the type 3 trigger that was set using @command{riscv icount set}.
1176011779@end deffn
1176111780
11762- @deffn {Command} {riscv itrigger set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] [@option{nmi}] mie_bits
11781+ @deffn {Command} {riscv icount list}
11782+ List the type 3 trigger that was set using @command{riscv icount set}.
11783+ @end deffn
11784+
11785+ @deffn {Command} {riscv itrigger set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] [@option{nmi}] mie_bits [@option{trigger_action}]
1176311786Set an interrupt trigger (type 4) on the current target, which halts the target when it
1176411787fires. @option{m}, @option{s}, @option{u}, @option{vs}, and @option{vu} control
1176511788which execution modes the trigger fires in. If [@option{nmi}] is passed then
1176611789the trigger will fire on non-maskable interrupts in those modes. @var{mie_bits}
1176711790controls which interrupts the trigger fires on, using the same bit assignments
1176811791as in the mie CSR (defined in the RISC-V Privileged Spec).
11792+ @option{trigger_action} control the desired behavior on the target when the
11793+ trigger fires. Defaults to @option{halt}, which halts the target.
11794+
11795+ For details on this trigger type, see the RISC-V Debug Specification.
11796+ @end deffn
11797+
11798+ @deffn {Command} {riscv itrigger clear}
11799+ Clear the type 4 trigger that was set using @command{riscv itrigger set}.
11800+ @end deffn
11801+
11802+ @deffn {Command} {riscv itrigger list}
11803+ List the type 4 trigger that was set using @command{riscv itrigger set}.
11804+ @end deffn
11805+
11806+ @deffn {Command} {riscv mcontrol set} [@option{m}] [@option{s}] [@option{u}] [@option{vs}] [@option{vu}] address [@option{trigger_action}]
11807+ Set a match trigger (type 2 or 6) on the current target, which sets the desired behavior on
11808+ the target when it fires. @option{m}, @option{s}, @option{u}, @option{vs}, and @option{vu}
11809+ control which execution modes the trigger fires in. @option{execute}, @option{store},
11810+ and @option{load} control the trigger how to fire.
11811+ @option{trigger_action} control the desired behavior on the target when the
11812+ trigger fires. Defaults to @option{halt}, which halts the target.
1176911813
1177011814For details on this trigger type, see the RISC-V Debug Specification.
1177111815@end deffn
1177211816
11817+ @deffn {Command} {riscv mcontrol clear} [trigger_id]
11818+ Clear the type 2 or 6 trigger that was set using @command{riscv mcontrol set}.
11819+ @option{trigger_id} specifies the trigger id of a match trigger to clear.
11820+ @end deffn
11821+
11822+ @deffn {Command} {riscv mcontrol list}
11823+ List the type 2 or 6 trigger that was set using @command{riscv mcontrol set}.
11824+ @end deffn
11825+
1177311826@deffn {Command} {riscv reserve_trigger} [index @option{on|off}]
1177411827Manages the set of reserved triggers. Reserving a trigger results in OpenOCD
11775- not using it internally (e.g. skipping it when setting a watchpoint or a
11776- hardware breakpoint), so that the user or the application has unfettered
11828+ not using it internally (e.g. skipping it when setting a watchpoint, a
11829+ hardware breakpoint, an exception trigger, an instruction trigger or a
11830+ match trigger), so that the user or the application has unfettered
1177711831control over the trigger. By default there are no reserved triggers.
1177811832
1177911833@enumerate
@@ -11785,10 +11839,6 @@ control over the trigger. By default there are no reserved triggers.
1178511839
1178611840@end deffn
1178711841
11788- @deffn {Command} {riscv itrigger clear}
11789- Clear the type 4 trigger that was set using @command{riscv itrigger set}.
11790- @end deffn
11791-
1179211842@subsection RISC-V Program Buffer Commands
1179311843
1179411844Program Buffer is an optional feature of RISC-V targets - it is a mechanism that debuggers
0 commit comments