Fix x64 disassembly when running retranslate-all
commit6ff70cbce6db2a0364c30a1910edb6e2ab4a5647
authorRick Lavoie <rlavoie@fb.com>
Tue, 2 Nov 2021 08:49:54 +0000 (2 01:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Nov 2021 08:51:24 +0000 (2 01:51 -0700)
tree47bbcd97ac42d2d346619bf05436d41c49c26248
parent015d87a80c537cf006ca3146f9e43ca822087676
Fix x64 disassembly when running retranslate-all

Summary:
Run doing retranslate-all, we generate the code into temporary
buffers, then relocate it all afterwards. However, when we print the
x64 disassembly, we do so as the unit is generated. As a result, the
addresses all refer to the temporary buffers. This is mainly harmless
(unless you're trying to use the dump in conjunction with a core
dump). However it breaks symbol printing. When disassembling, pass
along an extra "adjustment" parameter, which can be used to restore
the IP to the correct value to allow for correct symbol printing.

Reviewed By: oulgen, paulbiss

Differential Revision: D32080137

fbshipit-source-id: 159e76f7c92ce7e2265d0bf6163cfce7515fd356
hphp/runtime/vm/jit/print.cpp
hphp/runtime/vm/jit/print.h
hphp/runtime/vm/jit/unique-stubs.cpp
hphp/util/disasm.cpp
hphp/util/disasm.h
hphp/util/test/asm.cpp