[racket-dev] Easy disassembly of JIT-compiled procedures

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Thu May 22 19:23:20 EDT 2014

On Wed, May 21, 2014 at 4:09 PM, Sam Tobin-Hochstadt
<samth at cs.indiana.edu> wrote:
> Racketeers,
> Thanks to some improvements from Matthew, my `disassemble` package is
> now much easier to use.

I've just pushed a new version of this, which uses an in-Racket
disassembler based on Göran Weinholt's Industria library [1].

This means (a) you don't need NASM installed and (b) it will work
properly on 64-bit OS X, despite the problems with NASM on that

Testing of the new code (which is on by default) on platforms other
than x86-64 Linux would be greatly appreciated.

Here's a sample of the revised output:

    > (disassemble f)
       0: 488943f8                       (mov (mem64+ rbx #x-8) rax)
       4: 4883c3f8                       (add rbx #xfffffffffffffff8)
       8: b803000000                     (mov eax #x3)
       d: 4c8b75c8                       (mov r14 (mem64+ rbp #x-38))
      11: 4883c428                       (add rsp #x28)
      15: 415d                           (pop r13)
      17: 415c                           (pop r12)
      19: 5b                             (pop rbx)
      1a: 5d                             (pop rbp)
      1b: c3                             (ret)


[1] https://github.com/weinholt/industria

Posted on the dev mailing list.