Skip to content
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

Instruction tracing can use wrong encoding mode #255

Open
arichardson opened this issue Jun 18, 2024 · 0 comments
Open

Instruction tracing can use wrong encoding mode #255

arichardson opened this issue Jun 18, 2024 · 0 comments
Assignees

Comments

@arichardson
Copy link
Member

The problem we see here is that arm_disas_set_info is called after all of the instruction side-effects have taken place, so we disassemble using the mode of the subsequent instruction rather than the current state.

The only real workaround I can think of is eagerly expanding the disassembly and then storing that string in the trace buffer rather than storing the instruction opcode+size.

@qwattash what do you think about this approach?

arichardson added a commit that referenced this issue Jun 18, 2024
While this means we have to allocate a temporary buffer for the textual
trace format, I don't see another workaround for the fact that we print
the instruction disassembly after the instruction has executed and
therefore has modified state (such as env->thumb) that affects the
disassembly of instructions.

Fixes: #255
arichardson added a commit that referenced this issue Jun 18, 2024
While this means we have to allocate a temporary buffer for the textual
trace format, I don't see another workaround for the fact that we print
the instruction disassembly after the instruction has executed and
therefore has modified state (such as env->thumb) that affects the
disassembly of instructions.

Fixes: #255
arichardson added a commit that referenced this issue Jul 24, 2024
While this means we have to allocate a temporary buffer for the textual
trace format, I don't see another workaround for the fact that we print
the instruction disassembly after the instruction has executed and
therefore has modified state (such as env->thumb) that affects the
disassembly of instructions.

Fixes: #255
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

No branches or pull requests

2 participants