StepBreakpoints are set on CALL instructions, when they are hit we disassemble the current instruction, figure out the destination address and set a breakpoint after the prologue of the called function. In order to disassemble the current instruction we disassemble the area of memory starting from PC and going to PC+15 (because 15 bytes is the maximum length of one instruction on AMD64). This means that we won't just disassemble one instruction but also a few instructions following it ending with one truncated instruction. This usually works fine but sometimes the disassembler will panic with an array out of bounds error when trying to disassemble a truncated instruction. To avoid this problem this commit changes the funciton disassemble to take one extra parameter, singleInstr, when singleInstr is set disassemble will quit after disassembling a single instruction. |
||
|---|---|---|
| .. | ||
| config | ||
| dwarf | ||
| goversion | ||
| proc | ||
| terminal | ||
| version | ||