Added comment about how to disassemble JIT output.

pull/13171/head
Joshua Haberman 14 years ago
parent daf36f0747
commit 92b4c38fa5
  1. 2
      upb/pb/decoder_x86.dasc
  2. 1
      upb/upb.h

@ -682,6 +682,8 @@ void upb_decoder_makejit(upb_decoder *d) {
mprotect(d->jit_code, d->jit_size, PROT_EXEC | PROT_READ); mprotect(d->jit_code, d->jit_size, PROT_EXEC | PROT_READ);
// View with: objdump -M intel -D -b binary -mi386 -Mx86-64 /tmp/machine-code
// Or: ndisasm -b 64 /tmp/machine-code
FILE *f = fopen("/tmp/machine-code", "wb"); FILE *f = fopen("/tmp/machine-code", "wb");
fwrite(d->jit_code, d->jit_size, 1, f); fwrite(d->jit_code, d->jit_size, 1, f);
fclose(f); fclose(f);

@ -14,6 +14,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> // only for size_t. #include <stdio.h> // only for size_t.
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include "descriptor_const.h" #include "descriptor_const.h"
#include "atomic.h" #include "atomic.h"

Loading…
Cancel
Save