-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb] add RISCV target specific info in API tests #99039
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
[lldb] add RISCV target specific info in API tests #99039
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-lldb Author: None (dlav-sc) ChangesAdd information about RISCV first register in python API testsuite, that is used to check register readability in tests. Fixed tests on RISCV target: TestBreakpointByFileColonLine.BreakpointByLineAndColumnTestCase TestAddressBreakpoints.AddressBreakpointTestCase Full diff: https://github.com/llvm/llvm-project/pull/99039.diff 1 Files Affected:
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index 818fdf0e6b5c5..d9493ed448907 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -34,6 +34,8 @@ def check_first_register_readable(test_case):
test_case.expect("register read r0", substrs=["r0 = 0x"])
elif arch in ["powerpc64le"]:
test_case.expect("register read r0", substrs=["r0 = 0x"])
+ elif arch in ["rv64gc"]:
+ test_case.expect("register read zero", substrs=["zero = 0x"])
else:
# TODO: Add check for other architectures
test_case.fail(
|
888a3aa
to
996ad26
Compare
@@ -34,6 +34,8 @@ def check_first_register_readable(test_case): | |||
test_case.expect("register read r0", substrs=["r0 = 0x"]) | |||
elif arch in ["powerpc64le"]: | |||
test_case.expect("register read r0", substrs=["r0 = 0x"]) | |||
elif arch in ["rv64gc"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious here what test_case.getArchitecture()
returns, is it exactly this string?
I just remember that riscv can be configured all sorts of ways and I don't know if that ends up in this string.
This is fine for this patch though, folks will find this code easily enough if it's a problem for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess zero = 0x
would be fine for any rv(32|64)
target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. rv64gc
is just my configuration (now getArchitecture()
returns what I pass to --arch
option running dotest.py
).
Maybe I can make more generic solution by adding a regexp or just simple if arch.startswith("rv"): arch = "riscv"
in getArchitecture()
. I think it would be enough for now, because rv32
and rv64
have the same register set and as you have noticed zero = 0x
would be fine for any target, so there is no reasons to distinguish a bitness or configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I was asking more for understanding than anything else. Good to know it would be easy to extend.
I would leave this as is on the grounds that you only know for sure that rv64 works here, and anyone working on anything else will have the ability to validate the test themselves. So leave it to future them (maybe future you) to update the name here.
Just update the PR title and commit message to be clear that you're doing this for rv64 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a way to test rv32 as well that's great but up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have finally decided to add simple regexp, so it's going to work with any riscv target, not only rv64gc
.
Add information about RISCV first register in python API testsuite, that is used to check register readability in tests. Fixed tests on RISCV target: TestBreakpointByFileColonLine.BreakpointByLineAndColumnTestCase TestAddressBreakpoints.AddressBreakpointTestCase TestBreakpointAutoContinue.BreakpointAutoContinue TestInterruptBacktrace.TestInterruptingBacktrace TestBadAddressBreakpoints.BadAddressBreakpointTestCase TestScriptedResolver.TestScriptedResolver TestStopHookScripted.TestStopHooks TestBreakpointConditions.BreakpointConditionsTestCase TestLocalVariables.LocalVariablesTestCase TestFindLineEntry.FindLineEntry TestScriptedResolver.TestScriptedResolver TestInlineSourceFiles.InlineSourceFilesTestCase TestModuleAndSection.ModuleAndSectionAPIsTestCase TestFrameVar.TestFrameVar TestInferiorAssert.AssertingInferiorTestCase TestInferiorCrashing.CrashingInferiorTestCase TestInferiorCrashingStep.CrashingInferiorStepTestCase TestRegistersIterator.RegistersIteratorTestCase TestCoroutineHandle.TestCoroutineHandle TestWithLimitDebugInfo.TestWithLimitDebugInfo TestLLDBIterator.LLDBIteratorTestCase TestMemoryWrite.MemoryWriteTestCase TestNestedTemplate.NestedTemplateTestCase TestParrayVrsCharArrayChild.TestParrayVrsCharArrayChild TestRecursiveInferior.CrashingRecursiveInferiorTestCase TestRecursiveInferiorStep.CrashingRecursiveInferiorStepTestCase TestRunLocker.TestRunLocker TestSampleTest.RenameThisSampleTestTestCase TestUniqueTypes3.UniqueTypesTestCase3 TestPrintStackTraces.ThreadsStackTracesTestCase TestUnicodeSymbols.TestUnicodeSymbols TestUnusedInlinedParameters.TestUnusedInlinedParameters TestValueVarUpdate.ValueVarUpdateTestCase TestPtrRef2Typedef.PtrRef2TypedefTestCase TestDataFormatterStdIterator.StdIteratorDataFormatterTestCase TestDataFormatterStdString.StdStringDataFormatterTestCase TestDataFormatterStdVBool.StdVBoolDataFormatterTestCase
996ad26
to
e0e8ce7
Compare
@dlav-sc Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
Add information about RISCV first register in python API testsuite, that is used to check register readability in tests. Fixed tests on RISCV target: TestBreakpointByFileColonLine.BreakpointByLineAndColumnTestCase TestAddressBreakpoints.AddressBreakpointTestCase TestBreakpointAutoContinue.BreakpointAutoContinue TestInterruptBacktrace.TestInterruptingBacktrace TestBadAddressBreakpoints.BadAddressBreakpointTestCase TestScriptedResolver.TestScriptedResolver TestStopHookScripted.TestStopHooks TestBreakpointConditions.BreakpointConditionsTestCase TestLocalVariables.LocalVariablesTestCase TestFindLineEntry.FindLineEntry TestScriptedResolver.TestScriptedResolver TestInlineSourceFiles.InlineSourceFilesTestCase TestModuleAndSection.ModuleAndSectionAPIsTestCase TestFrameVar.TestFrameVar TestInferiorAssert.AssertingInferiorTestCase TestInferiorCrashing.CrashingInferiorTestCase TestInferiorCrashingStep.CrashingInferiorStepTestCase TestRegistersIterator.RegistersIteratorTestCase TestCoroutineHandle.TestCoroutineHandle TestWithLimitDebugInfo.TestWithLimitDebugInfo TestLLDBIterator.LLDBIteratorTestCase TestMemoryWrite.MemoryWriteTestCase TestNestedTemplate.NestedTemplateTestCase TestParrayVrsCharArrayChild.TestParrayVrsCharArrayChild TestRecursiveInferior.CrashingRecursiveInferiorTestCase TestRecursiveInferiorStep.CrashingRecursiveInferiorStepTestCase TestRunLocker.TestRunLocker TestSampleTest.RenameThisSampleTestTestCase TestUniqueTypes3.UniqueTypesTestCase3 TestPrintStackTraces.ThreadsStackTracesTestCase TestUnicodeSymbols.TestUnicodeSymbols TestUnusedInlinedParameters.TestUnusedInlinedParameters TestValueVarUpdate.ValueVarUpdateTestCase TestPtrRef2Typedef.PtrRef2TypedefTestCase TestDataFormatterStdIterator.StdIteratorDataFormatterTestCase TestDataFormatterStdString.StdStringDataFormatterTestCase TestDataFormatterStdVBool.StdVBoolDataFormatterTestCase
Add information about RISCV first register in python API testsuite, that is used to check register readability in tests.
Fixed tests on RISCV target:
TestBreakpointByFileColonLine.BreakpointByLineAndColumnTestCase TestAddressBreakpoints.AddressBreakpointTestCase
TestBreakpointAutoContinue.BreakpointAutoContinue
TestInterruptBacktrace.TestInterruptingBacktrace
TestBadAddressBreakpoints.BadAddressBreakpointTestCase TestScriptedResolver.TestScriptedResolver
TestStopHookScripted.TestStopHooks
TestBreakpointConditions.BreakpointConditionsTestCase TestLocalVariables.LocalVariablesTestCase
TestFindLineEntry.FindLineEntry
TestScriptedResolver.TestScriptedResolver
TestInlineSourceFiles.InlineSourceFilesTestCase
TestModuleAndSection.ModuleAndSectionAPIsTestCase
TestFrameVar.TestFrameVar
TestInferiorAssert.AssertingInferiorTestCase
TestInferiorCrashing.CrashingInferiorTestCase
TestInferiorCrashingStep.CrashingInferiorStepTestCase TestRegistersIterator.RegistersIteratorTestCase
TestCoroutineHandle.TestCoroutineHandle
TestWithLimitDebugInfo.TestWithLimitDebugInfo
TestLLDBIterator.LLDBIteratorTestCase
TestMemoryWrite.MemoryWriteTestCase
TestNestedTemplate.NestedTemplateTestCase
TestParrayVrsCharArrayChild.TestParrayVrsCharArrayChild TestRecursiveInferior.CrashingRecursiveInferiorTestCase TestRecursiveInferiorStep.CrashingRecursiveInferiorStepTestCase TestRunLocker.TestRunLocker
TestSampleTest.RenameThisSampleTestTestCase
TestUniqueTypes3.UniqueTypesTestCase3
TestPrintStackTraces.ThreadsStackTracesTestCase
TestUnicodeSymbols.TestUnicodeSymbols
TestUnusedInlinedParameters.TestUnusedInlinedParameters TestValueVarUpdate.ValueVarUpdateTestCase
TestPtrRef2Typedef.PtrRef2TypedefTestCase
TestDataFormatterStdIterator.StdIteratorDataFormatterTestCase TestDataFormatterStdString.StdStringDataFormatterTestCase TestDataFormatterStdVBool.StdVBoolDataFormatterTestCase