DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.67k stars 566 forks source link

i#6662: view tool spacing fix #7061

Closed edeiana closed 1 month ago

edeiana commented 1 month ago

In REGDEPS public traces the encodings of instructions printed with the view tool (which uses our disassembler) are divided in 4 byte words, 2 words on the first line and an additional 2 on the second line (if necessary). Instructions that only have 1 word encodings (e.g., a branch) have their categories printed right after the encodings of their first word and don't align with the categories of 2 or more word instructions.

For single word instructions we now add spacing equivalent to a second word. So, we now have:

102268       78352:     1271326 ifetch       3 byte(s) @ 0x00005605ec276c4a 00040110 00000206 math [8byte]       %rv0
102269       78353:     1271326 ifetch       2 byte(s) @ 0x00005605ec276c4d 00002200          branch  (taken)

Instead of:

102268       78352:     1271326 ifetch       3 byte(s) @ 0x00005605ec276c4a 00040110 00000206 math [8byte]       %rv0
102269       78353:     1271326 ifetch       2 byte(s) @ 0x00005605ec276c4d 00002200 branch  (taken)

Expands run_regdeps_test() in clients/drcachesim/tests/view_test.cpp adding a 1 word encodings entry (a branch). Fixes suite/tests/api/ir_regdeps.c expected disasm output with this new spacing requirement.

Issue #6662