@@ -11727,13 +11727,26 @@ the target supports, these commands let you
11727
11727
set those triggers directly. (It's also possible to do so by writing the
11728
11728
appropriate CSRs.)
11729
11729
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}]
11731
11743
Set an exception trigger (type 5) on the current target, which halts the target when it
11732
11744
fires. @option{m}, @option{s}, @option{u}, @option{vs}, and @option{vu} control
11733
11745
which execution modes the trigger fires in. @var{exception_codes} is a bit
11734
11746
field, where each bit corresponds to an exception code in mcause (defined in the
11735
11747
RISC-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.
11737
11750
11738
11751
For details on this trigger type, see the RISC-V Debug Specification.
11739
11752
@end deffn
@@ -11742,7 +11755,11 @@ For details on this trigger type, see the RISC-V Debug Specification.
11742
11755
Clear the type 5 trigger that was set using @command{riscv etrigger set}.
11743
11756
@end deffn
11744
11757
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}]
11746
11763
Set an instruction count
11747
11764
trigger (type 3) on the current target, which halts the target when it fires.
11748
11765
@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
11751
11768
hardware implementation of this trigger.
11752
11769
@var{count} sets the number of instructions to execute before the trigger is
11753
11770
taken.
11771
+ @option{trigger_action} control the desired behavior on the target when the
11772
+ trigger fires. Defaults to @option{halt}, which halts the target.
11754
11773
11755
11774
For details on this trigger type, see the RISC-V Debug Specification.
11756
11775
@end deffn
@@ -11759,21 +11778,56 @@ For details on this trigger type, see the RISC-V Debug Specification.
11759
11778
Clear the type 3 trigger that was set using @command{riscv icount set}.
11760
11779
@end deffn
11761
11780
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}]
11763
11786
Set an interrupt trigger (type 4) on the current target, which halts the target when it
11764
11787
fires. @option{m}, @option{s}, @option{u}, @option{vs}, and @option{vu} control
11765
11788
which execution modes the trigger fires in. If [@option{nmi}] is passed then
11766
11789
the trigger will fire on non-maskable interrupts in those modes. @var{mie_bits}
11767
11790
controls which interrupts the trigger fires on, using the same bit assignments
11768
11791
as 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.
11769
11813
11770
11814
For details on this trigger type, see the RISC-V Debug Specification.
11771
11815
@end deffn
11772
11816
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
+
11773
11826
@deffn {Command} {riscv reserve_trigger} [index @option{on|off}]
11774
11827
Manages 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
11777
11831
control over the trigger. By default there are no reserved triggers.
11778
11832
11779
11833
@enumerate
@@ -11785,10 +11839,6 @@ control over the trigger. By default there are no reserved triggers.
11785
11839
11786
11840
@end deffn
11787
11841
11788
- @deffn {Command} {riscv itrigger clear}
11789
- Clear the type 4 trigger that was set using @command{riscv itrigger set}.
11790
- @end deffn
11791
-
11792
11842
@subsection RISC-V Program Buffer Commands
11793
11843
11794
11844
Program Buffer is an optional feature of RISC-V targets - it is a mechanism that debuggers
0 commit comments