aboutsummaryrefslogtreecommitdiff
path: root/debug/gdbserver.py
AgeCommit message (Collapse)AuthorFilesLines
11 days[debug] Reserve triggers propperly in HwbpManualEvgeniy Naydanov1-21/+59
https://github.com/riscv-collab/riscv-openocd/pull/1111 introduces a change in OpenOCD behavior: a manual trigger should be manually removed to step/resume from it. This was not concidered in previous stop-gap solutions (76ff703d9161945354e334afa45c5dfe7680da60 and 8cc4918e904ca009cd85350fadf6f44e91eca13c) This commit: 1. Determines if `reserve trigger` is supported by the target. This can be removed once https://github.com/riscv-collab/riscv-openocd/pull/1111 is merged. 2. Marks `HwbpManual` test as not applicable in case `reserve trigger` is not supported. 3. Accounts for the change in OpenOCD's behavior when stepping from a manual BP. 4. Cleans up some minor mistakes in `HwbpManual`
12 days[debug] Fix trigger reservation in HwbpManualEvgeniy Naydanov1-1/+1
Syntax of the command was changed: (on/off) became compulsory.
12 daysMerge pull request #575 from en-sc/en-sc/reserve-triggerEvgeniy Naydanov1-0/+2
[debug] Reserve the trigger in `HwbpManual`
2024-08-27Fix EtriggerTest assuming that NULL causes a trap (#579)Luke Wren1-2/+4
There is already a mechanism for the test target to supply a known-bad address, so use that address if it is provided.
2024-08-07[debug] Reserve the trigger in `HwbpManual`Evgeniy Naydanov1-0/+2
After https://github.com/riscv-collab/riscv-openocd/pull/1111 is merged, the registers a user wishes to have direct control of should be reserved. This is the case in `HwbpManual`. The test still works with older OpenOCD versions, since no exception is generated when a command (`riscv reserve_trigger` in this case) is not found.
2024-06-06Move PRNG seed generation/logging from gdbserver.py:main() into ↵Tommy Murphy1-11/+0
testlib.py:run_all_tests()
2024-06-06Suppress 'PRNG seed ...' log messages when --list-tests is specified; see ↵Tommy Murphy1-2/+4
https://github.com/riscv-software-src/riscv-tests/pull/531#issuecomment-2151081139
2024-05-23debug: fix HwbpManual testEvgeniy Naydanov1-3/+19
HwbpManual test was broken: * Value read back from `tselect` was compared with `tdata1` value. https://github.com/riscv-software-src/riscv-tests/blob/408e461da11e0b298c4b69e587729532787212f5/debug/gdbserver.py#L701-L703 This resulted in the test being reported as not supported, after all the triggers were checked. * `tdata1.type` field was not set to `mcontrol`. * `tselect` value used to be changed by `handle_reset` and not restored. https://github.com/riscv-software-src/riscv-tests/blob/408e461da11e0b298c4b69e587729532787212f5/debug/programs/entry.S#L79-L84 * Manual breakpoint used to be left behind. Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-05-15debug: fix sporadic failures of memory sampling testsParshintsev Anatoly1-0/+1
Memory sampling tests fail sporadically for spike targets. A typical failure looks as follows (ROI from test log): ``` ---------------------------------[ Message ]---------------------------------- 139670831 not less than 124104544 --------------------------------[ Traceback ]--------------------------------- ... SECTION IS SKIPPED FOR READABILITY ... raise TestFailed(f"{a!r} not less than {b!r}", comment) testlib.TestFailed ``` Few observations: - 139670831 is 0x0853352f in hex, while 124104544 is 0x0765af60 - Now, the assert which is failing corresponds to the following expression: ``` assertLess(value, previous_value + tolerance) ``` - tolerance is `0x500000`. (124104544 - 0x500000) is 0x0715af60 If we look at the sampling output for such failing test, we'll see: ``` ... 0x1212340c5c: 0x0715af60 timestamp after: 878087500 timestamp before: 878088133 0x1212340c5c: 0x0853352f ... ``` The log above demonstrates the reason for the failure. Since memory sampling occures every poll (which by default happens approximately every 100ms) a value of the counter may exceed the threshold if the time between subsequent polls is increased (for whatever reason). In my opinion the failing assert can be safely removed, since the checks it perform are quite brittle and cannot be generalized. The assert violation is affected by CPU performance and sporadic delays between polls. For now, instead of assert removal we just avoid checks in-between memory sample bursts. This way we still can be certain that memory samples are frequent enough and hopefully this will avoid sporadic failures.
2024-05-13Merge pull request #491 from en-sc/en-sc/warning-repeat-readAnatoly Parshintsev1-4/+0
Remove old warning check in RepeatReadTest
2024-04-02Merge pull request #534 from lz-bro/fix_triggerDmodeAnatoly Parshintsev1-1/+1
Check the mcontrol triggers, no other triggers.
2024-03-02Merge pull request #533 from lz-bro/fix_icountAnatoly Parshintsev1-0/+1
Clear breakpoints so that gdb will not single step
2024-03-01Merge pull request #531 from aap-sc/aap-sc/improvementsEvgeniy Naydanov1-0/+9
improvements to debug tests infrastructure to help with triaging process
2024-02-04Check the mcontrol triggers, no other triggers.liangzhen1-1/+1
Signed-off-by: liangzhen <zhen.liang@spacemit.com> Change-Id: Iac914aef8080411e6acd9039c4bdfa728533103c
2024-02-02Clear breakpoints so that gdb will not single stepliangzhen1-0/+1
Signed-off-by: liangzhen <zhen.liang@spacemit.com> Change-Id: I7a4a24972cfa2ddc307a5f06fe3fd5380794719f
2024-02-01[debug tests] print selected seed for PRNGParshintsev Anatoly1-0/+9
Previously the seed was not printed and this created problems with reproduction of the issues. It's still not an ideal - meaning interactions between spike/gdb/openocd are inherently non-determistic (since time is involved), but at least we should get the same sources for the same seed now.
2024-01-23Disable mmu after test translateliangzhen1-0/+4
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
2023-10-24Support instruction count limit in IcountTestliangzhen1-2/+6
This is taking into account that the hardware limits count to 1. Signed-off-by: liangzhen <zhen.liang@spacemit.com>
2023-10-17Merge pull request #513 from lz-bro/nonexist_csrTim Newsome1-4/+5
Make the non-existent csr configurable
2023-10-17Merge pull request #514 from lz-bro/timer_configurableTim Newsome1-3/+3
Make CLINT address configurable
2023-10-17Make the non-existent csr configurableliangzhen1-4/+5
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
2023-10-16Make CLINT address configurableliangzhen1-3/+3
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
2023-10-13debug: Add UnavailableHaltedTestTim Newsome1-0/+61
Test behavior when a hart becomes unavailable while halted.
2023-10-11Merge pull request #503 from lz-bro/dis_timerTim Newsome1-0/+6
Disable timer interrupt to fix some bugs
2023-10-10Disable timer interrupt to fix some bugsliangzhen1-0/+6
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
2023-09-29debug: Add Openocd.set_available()Tim Newsome1-7/+6
This helper uses dmi_write commands to mark harts available/unavailable.
2023-07-24debug: Re-enable unavailable tests.Tim Newsome1-9/+6
2023-07-19debug: Better comment the privilege tests.Tim Newsome1-3/+4
Just doing this to make a change in the debug files, which should now cause the pylint workflow to execute.
2023-07-18debug: Disable unavailable tests.Tim Newsome1-6/+9
They have issues when run in a github workflow.
2023-07-17Merge pull request #489 from riscv-software-src/power_danceTim Newsome1-13/+59
debug: Test OpenOCD behavior when harts become unavailable, using new spike mechanism
2023-07-17debug: Create UnavailableCycleTestTim Newsome1-0/+27
Use new spike mechanism to test OpenOCD behavior when a hart becomes unavailable, and then available again.
2023-07-17debug: CeaseRunTest -> UnavailableRunTestTim Newsome1-3/+18
Use new spike mechanism to test OpenOCD behavior when the current hart becomes unavailable while running. Create ThreadTerminated exception.
2023-07-17debug: CeaseMultiTest -> UnavailableMultiTestTim Newsome1-6/+13
Use the new spike mechanism to test OpenOCD behavior when a hart becomes unavailable while running. Create CommandException.
2023-07-17parkOtherHarts() already defaults to ceaseTim Newsome1-1/+1
2023-07-17Move "monitor targets" calls into a central place.Tim Newsome1-3/+0
2023-07-14Remove old warning check in RepeatReadTestEvgeniy Naydanov1-4/+0
2023-07-13debug: flushregs -> maintenance flush register-cacheTim Newsome1-4/+4
flushregs is deprecated.
2023-07-10Merge pull request #486 from en-sc/en-sc/warning-repeat-readTim Newsome1-2/+15
change warning check in RepeatReadTest
2023-07-07change warning check in RepeatReadTestEvgeniy Naydanov1-2/+15
2023-06-29debug: pylint fix.Tim Newsome1-2/+2
2023-06-15debug: optimize the FreeRtosTest case.Chao Du1-4/+16
To make sure the rtos module of OpenOCD works well. Signed-off-by: Chao Du <duchao@eswincomputing.com>
2023-05-25debug: New pylint => new warnings => new cleanupsTim Newsome1-13/+16
- Replace general "Exception" with "GdbServerError" in gdbserver.py for when no samples are collected - Replace general "Exception" with "TargetsException" in targets.py for XLEN mismatch - Introduce "TestLibError" exception in testlib.py and replace general exceptions in various locations - Update pylint.rc to remove overgeneral-exceptions warning
2023-03-01Fix intermittent IcountTest failure on multi hart.Tim Newsome1-1/+1
Don't build with -DMULTICORE because this is not a test that really does multicore. It's one where we just want to park the other harts.
2023-02-16Add test for icount triggers.Tim Newsome1-0/+27
2023-02-02Fix EtriggerTest on multi-hart targets.Tim Newsome1-0/+1
Need to set the etrigger on the hart we're running the test against.
2023-01-06debug: Add Itrigger test.Tim Newsome1-0/+26
2022-12-29debug: Add etrigger test.Tim Newsome1-0/+19
2022-12-14debug: Add CeaseRunTestTim Newsome1-0/+23
Test that we work correctly when the hart we're debugging ceases to respond while it's running.
2022-12-14debug: Add CeaseStepiTest.Tim Newsome1-0/+23
Test that we work correctly when the hart we're debugging ceases to respond during stepi. Add wait parameter to Gdb.stepi(), in case stepi isn't expected to complete. Parse "could not read registers" error from gdb
2022-12-14debug: Create CeaseMultiTest. (#436)Tim Newsome1-1/+46
Confirm basic debug still works when other harts have been parked using a `cease` instruction. Check that the unavailable harts are inaccessible from gdb. Add Gdb.expect() Parse "unknown thread" error from gdb.