-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
libafl_qemu: Structured error types for reading/writing registers #2210
Closed
langston-barrett
wants to merge
2
commits into
AFLplusplus:main
from
langston-barrett:lb/qemu-errors
Closed
libafl_qemu: Structured error types for reading/writing registers #2210
langston-barrett
wants to merge
2
commits into
AFLplusplus:main
from
langston-barrett:lb/qemu-errors
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for the PR, this looks good to me. |
Clippy is not happy error[E0277]: the trait bound `qemu::WriteRegError<i32, u64>: pyo3::IntoPy<pyo3::Py<pyo3::PyAny>>` is not satisfied
--> libafl_qemu/src/qemu/mod.rs:1210:13
|
1210 | self.qemu.write_reg(reg, val).map_err(PyValueError::new_err)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `pyo3::IntoPy<pyo3::Py<pyo3::PyAny>>` is not implemented for `qemu::WriteRegError<i32, u64>`, which is required by `qemu::WriteRegError<i32, u64>: pyo3::PyErrArguments`
... |
bcd5b76
to
0156a1c
Compare
CI claims other archs still have some issues, i.e.: error[E0308]: mismatched types
--> libafl_qemu/src/arch/mips.rs:95:9
|
91 | fn read_return_address<T>(&self) -> Result<T, String>
| ----------------- expected `Result<T, std::string::String>` because of return type
...
95 | self.read_reg(Regs::Ra)
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<T, String>`, found `Result<_, ReadRegError<Regs>>`
|
= note: expected enum `Result<T, std::string::String>`
found enum `Result<_, qemu::ReadRegError<arch::mips::Regs>>`
help: use the `?` operator to extract the `Result<_, qemu::ReadRegError<arch::mips::Regs>>` value, propagating a `Result::Err` value to the caller
|
95 | self.read_reg(Regs::Ra)?
| +
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> libafl_qemu/src/arch/mips.rs:102:34
|
102 | self.write_reg(Regs::Ra, val)
| --------- ^^^ the trait `std::marker::Copy` is not implemented for `T`
| |
| required by a bound introduced by this call |
Any news? |
Still unhappy |
Will reopen when I have more time to fix it up! |
@rmalmain want to finish this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Makes the errors more programatically inspectable, and instances of
std::error::Error
. Removes the temptation toimpl From<String>
for errors that wrap these. Can be trivially converted to strings, which is demonstrated in this PR. Does introduce newCopy
bounds, but I think this should be fine?