Skip to content

Fix(EditInstructionDialog): Silence console errors from text preview#3500

Open
Keryer wants to merge 1 commit intorizinorg:devfrom
Keryer:dev
Open

Fix(EditInstructionDialog): Silence console errors from text preview#3500
Keryer wants to merge 1 commit intorizinorg:devfrom
Keryer:dev

Conversation

@Keryer
Copy link

@Keryer Keryer commented May 28, 2025

Your checklist for this pull request

Detailed description

This change resolves Issue #2551, where errors from Rizin were printed to the console when typing invalid instructions in the "Edit Instruction" dialog.

Problem:
When a user entered non-assemblable code, Core()->assemble() would fail. This failure not only caused Rizin to print error messages to the console but could also lead to unhandled exceptions, potentially crashing Cutter.

Fix:
This modification wraps the Core()->assemble(input) call within a try-catch block. By catching the std::exception that Core()->assemble() might throw:

  • We successfully prevent the associated error messages, which resulted from these exceptions, from being printed to the console.
  • We handle the failure case by setting data to an empty QByteArray.

Test plan (required)
The following is an example of an unexpected console error:
gif20250528161517

After modification, the console no longer reports an error during the modification of instructions:
gif20250528161302

Closing issues
closes #2551

Prevents assembly errors during live instruction editing (text mode)
from printing to the console. UI now correctly shows "Unknown Instruction"
without extraneous console log noise.
@notxvilka notxvilka requested a review from karliss May 28, 2025 19:00
Copy link
Member

@karliss karliss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please retest your changes. I have no idea how you managed to produce the second GIF, but the changes you made should have no effect and in my testing they didn't.

@Keryer
Copy link
Author

Keryer commented May 29, 2025

Please retest your changes. I have no idea how you managed to produce the second GIF, but the changes you made should have no effect and in my testing they didn't.

Could you please tell me about your test environment? I will refer to it for further testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit instruction dialog prints erros to the console when typing

2 participants