-
-
Notifications
You must be signed in to change notification settings - Fork 12
refactor(crate): refactor robustone-core #41
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
Merged
Plucky923
merged 9 commits into
hust-open-atom-club:main
from
Polardist:refactor-robustone-core
Dec 1, 2025
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4f840dd
test: update instruction format in R-type and I-type tests for clarity
Polardist e6b4479
refactor: integrate thiserror for error handling in DisasmError
Polardist 3004d21
refactor: enhance architecture utilities with enum representation and…
Polardist a30d5c2
refactor: unify instruction detail handling with AllInstructionDetail…
Polardist de487b6
refactor: correct case sensitivity in architecture conversion tests
Polardist 3ec5500
refactor: remove deprecated ArchitectureUtils struct and update usage…
Polardist 65b1646
Merge branch 'main' into refactor-robustone-core
Polardist 3d77240
refactor: change return type of registers_read and registers_written …
Polardist ef7187d
refactor(tests): update instruction binary representations for clarity
Polardist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,14 @@ | ||
| use thiserror::Error; | ||
|
|
||
| /// Errors produced by the architecture-agnostic disassembly layer. | ||
| #[derive(Debug)] | ||
| #[derive(Error, Debug)] | ||
| pub enum DisasmError { | ||
| #[error("ERROR: Unsupported architecture: {0}")] | ||
| UnsupportedArchitecture(String), | ||
| #[error("ERROR: Decoding failed: {0}")] | ||
| DecodingError(String), | ||
| #[error("ERROR: invalid assembly code: {0}")] | ||
| InvalidHexCode(String), | ||
| #[error("ERROR: invalid address argument: {0}")] | ||
| InvalidAddress(String), | ||
| } | ||
|
|
||
| impl std::fmt::Display for DisasmError { | ||
| fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
| match self { | ||
| DisasmError::UnsupportedArchitecture(arch) => { | ||
| write!(f, "ERROR: Unsupported architecture: {arch}") | ||
| } | ||
| DisasmError::DecodingError(msg) => { | ||
| write!(f, "ERROR: Decoding failed: {msg}") | ||
| } | ||
| DisasmError::InvalidHexCode(msg) => { | ||
| write!(f, "ERROR: invalid assembly code: {msg}") | ||
| } | ||
| DisasmError::InvalidAddress(msg) => { | ||
| write!(f, "ERROR: invalid address argument: {msg}") | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl std::error::Error for DisasmError {} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
After the refactoring,
ArchitectureUtilsseems to be a redundant abstraction. Consider removing it and only provide some auxiliary functions.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.
Provide
fn normalize_nameandfn is_address_alignedat module level; thisArchitectureUtilsstructure can be removed.Uh oh!
There was an error while loading. Please reload this page.
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.
Do we have to keep
normalize_namefunction, rather thanstr/String.to_arch()? Current API provide Architecture from both &str and String.