BinaryAnalysisPlatform / qemu

Official QEMU mirror
Other
9 stars 12 forks source link

Add tracing support for x86 #21

Closed DMaroo closed 1 year ago

DMaroo commented 1 year ago

This PR adds tracing support for x86. This will be useful while testing rizinorg/rizin#2747 with rz-tracetest.

In it's current state, the generated trace can be successfully read by libtrace, and seems to be okay from manual inspection. except it has wrong values for the rawbytes field. This results in invalid decompilation on Rizin's side, and therefore inability to use rz-tracetest. I believe the that the incorrect rawbytes value might be because of incorrect usage of gen_trace_endframe.

Unrelated changes:

DMaroo commented 1 year ago

The x86 tracing is now working. The generated traces seem to be correct and I am able to run https://github.com/rizinorg/rz-tracetest on them. But I would advise not to merge this until I am done testing the IL, because there may be bugs. Once the trace testing is complete, we can be confident to merge it.

XVilka commented 1 year ago

@DMaroo have been there any updates since? How close is the testing?

DMaroo commented 1 year ago

I didn't get much time to work on this in the past few months. I am yet to verify the tracing for segment registers. I think I will be fairly confident about the tracing within 3 weeks. The PR can be merged then. Any other changes can then be incrementally merged, if needed.

XVilka commented 1 year ago

@DMaroo have you had any chance to look at this?

DMaroo commented 1 year ago

I think this the tracing instrumentation is majorly done for x86 and we can merge this now. We can address missing cases later on a case-by-case basis.