Branch: Tag:

2016-07-30

2016-07-30 09:37:17 by Arne Goedeke <el@laramies.com>

Compiler: print disassembly with pragma disassemble

With PIKE_DEBUG and #pragma disassemble, the disassembled machine code will
be printed along-side the pike bytecode instructions. This is very useful when
debugging/optimizing the generated code.

492:    for(e=0;e<length;e++)    {   #ifdef PIKE_DEBUG + # ifdef DISASSEMBLE_CODE +  size_t opcode_start = PIKE_PC; + # endif +     if (c != (((p_instr *)instrbuf.s.str)+e)) {    Pike_fatal("Instruction loop deviates. "    "0x%04"PRINTPTRDIFFT"x != 0x%04"PRINTPTRDIFFT"x\n",
688:    }    }    + #if defined(PIKE_DEBUG) && defined(DISASSEMBLE_CODE) +  if((lex->pragmas & ID_DISASSEMBLE) && PIKE_PC > opcode_start) +  { +  DISASSEMBLE_CODE(Pike_compiler->new_program->program + opcode_start, +  (PIKE_PC - opcode_start)*sizeof(PIKE_OPCODE_T)); +  } + #endif +    #ifdef PIKE_DEBUG    if (instrs[c->opcode - F_OFFSET].flags & I_HASPOINTER) {    if ((e+1 >= length) || (c[1].opcode != F_POINTER)) {