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

Export p-code and intermediate steps in "Debug Function Decompilation" #7315

Open
H-A-M-G-E-R opened this issue Dec 23, 2024 · 2 comments
Open

Comments

@H-A-M-G-E-R
Copy link

from
image
exports an XML containging debug info
but doesn't export p-code and intermediate steps

@msm-code
Copy link

You can load that file into decomp_dbg and get both p-code and intermediate steps.

image

@LukeSerne
Copy link
Contributor

I built DecompVis to solve exactly this problem - I wanted to understand what transformation each rule made, and why the rule I was writing at the time did not get applied. The output of print raw can be difficult to understand, and seeing what a specific rule does exactly is also quite difficult using just decomp_dbg.

DecompVis uses decomp_dbg and the trace address and trace break 0 commands to set "breakpoints" after almost every rule application (see the get_decompile_data function). Additionally, print raw is used at each "breakpoint" to get the current state of the p-code, since the running diffs can be incomplete (see #4963).

Unfortunately, the raw pcode printed by print raw can be ambiguous. For example, print raw's output makes no distinction between INT_LESS (unsigned integer less-than) and INT_SLESS (signed integer less-than). I created an issue (#4951) and PR (#5063) for this, but there doesn't seem to be any progress in getting this fixed.

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

3 participants