Skip to content

[debug] check triggers exist in icount/itrigger/etrigger test #617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,11 @@ def test(self):
assertEqual(before, after)

class EtriggerTest(DebugTest):
# TODO: There should be a check that a exception trigger is really not
# supported if it is marked as unsupported.
def early_applicable(self):
return self.target.support_etrigger

def setup(self):
DebugTest.setup(self)
self.gdb.b("main:start")
Expand Down Expand Up @@ -2208,6 +2213,11 @@ def test(self):
class IcountTest(DebugTest):
compile_args = ("programs/infinite_loop.S", )

# TODO: There should be a check that an instruction count trigger is
# really not supported if it is marked as unsupported.
def early_applicable(self):
return self.target.support_icount

def setup(self):
DebugTest.setup(self)
self.gdb.b("main")
Expand Down Expand Up @@ -2239,8 +2249,10 @@ def test(self):
class ItriggerTest(GdbSingleHartTest):
compile_args = ("programs/interrupt.c",)

# TODO: There should be a check that a interrupt trigger is really not
# supported if it is marked as unsupported.
def early_applicable(self):
return self.target.supports_clint_mtime
return self.target.supports_clint_mtime and self.target.support_itrigger

def setup(self):
self.gdb.load()
Expand Down
9 changes: 9 additions & 0 deletions debug/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ class Target:
# Support set_pmp_deny to create invalid addresses.
support_set_pmp_deny = False

# Supports Instruction count trigger
support_icount = True

# Supports interrupt trigger
support_itrigger = True

# Supports exception trigger
support_etrigger = True

# Internal variables:
directory = None
temporary_files = []
Expand Down
Loading