Hotspot7 hsdis PrintAssembly 英特尔语法

发布于 2025-01-07 07:52:12 字数 113 浏览 0 评论 0原文

每次我在 Hotspot 中使用 -XX:+PrintAssembly 并且必须阅读可怕的 AT&T 语法时,这都会让我很烦恼。

有没有办法告诉它使用英特尔语法?

It annoys me every time I use -XX:+PrintAssembly with Hotspot and have to read the horrible AT&T syntax.

Is there a way to tell it to use the Intel syntax?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

触ぅ动初心 2025-01-14 07:52:12

您所需要做的就是将一些选项解析到 dis-asm.h 和 binutils 代码中

对于 intel Asm(我也更喜欢),只需添加以下

-XX:PrintAssemblyOptions=intel

如果您需要组合选项像这样使用逗号

-XX:PrintAssemblyOptions=intel,hsdis-help

任何不被识别为 hsdis 选项的内容都将被提供给反汇编程序,这些选项是相同的您看到的列表来自

objdump --help

... <SNIP A lot of --help text %<> ...
The following i386/x86-64 specific disassembler options are supported for use
with the -M switch (multiple options should be separated by commas):
  x86-64      Disassemble in 64bit mode
  i386        Disassemble in 32bit mode
  i8086       Disassemble in 16bit mode
  att         Display instruction in AT&T syntax
  intel       Display instruction in Intel syntax
  att-mnemonic
              Display instruction in AT&T mnemonic
  intel-mnemonic
              Display instruction in Intel mnemonic
  addr64      Assume 64bit address size
  addr32      Assume 32bit address size
  addr16      Assume 16bit address size
  data32      Assume 32bit data size
  data16      Assume 16bit data size
  suffix      Always display instruction suffix in AT&T syntax
Report bugs to <http://www.sourceware.org/bugzilla/>.

All you need is to parse some options onto the dis-asm.h and binutils code

For intel Asm (which I also prefer) just add the following

-XX:PrintAssemblyOptions=intel

If you need to combine options do it with commas like so

-XX:PrintAssemblyOptions=intel,hsdis-help

Anything not recognised as a hsdis option will be fed to the disassembler, these options are the same ones you see listed from

objdump --help

... <SNIP A lot of --help text %<> ...
The following i386/x86-64 specific disassembler options are supported for use
with the -M switch (multiple options should be separated by commas):
  x86-64      Disassemble in 64bit mode
  i386        Disassemble in 32bit mode
  i8086       Disassemble in 16bit mode
  att         Display instruction in AT&T syntax
  intel       Display instruction in Intel syntax
  att-mnemonic
              Display instruction in AT&T mnemonic
  intel-mnemonic
              Display instruction in Intel mnemonic
  addr64      Assume 64bit address size
  addr32      Assume 32bit address size
  addr16      Assume 16bit address size
  data32      Assume 32bit data size
  data16      Assume 16bit data size
  suffix      Always display instruction suffix in AT&T syntax
Report bugs to <http://www.sourceware.org/bugzilla/>.
人生百味 2025-01-14 07:52:12

我认为没有任何现有的方法可以做到这一点。但这是我发现的——
这里是源代码hsdis。您可以通过将 -masm=intel 传递给 GCC 来更改 Makefile。如果有效,从现在开始,+PrintAssembly 应该开始输出 Intel 语法汇编。

这是获取源代码、构建和最终的分步过程获取hsdis-arch.so,它是进行反汇编工作的!

我自己还没有尝试过这个。我希望你能做到这一点:)

如果没有任何效果,这应该会让你对 AT&T 语法 :)

I don't think there's any existent way to do this. But this is what I've found-
Here is the source of hsdis. You can change the Makefile by passing -masm=intel to GCC. And if it works, from now onwards, +PrintAssembly should start outputting Intel syntax assembly.

Here is the step by step procedure to get the source, build and finally get the hsdis-arch.so which is the one which does the disassembly work!

I haven't tried this out myself. I wish you get this to work :)

If nothing works, this should make you comfortable with AT&T Syntax :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文