Use single byte to store INT3

This commit is contained in:
Derek Parker
2014-05-28 15:58:12 -05:00
parent c3bac38ba1
commit f66a2023a8
2 changed files with 3 additions and 3 deletions

View File

@ -96,9 +96,9 @@ func (dbp *DebuggedProcess) Registers() (*syscall.PtraceRegs, error) {
// Sets a breakpoint in the running process.
func (dbp *DebuggedProcess) Break(addr uintptr) (*BreakPoint, error) {
var (
int3 = []byte{'0', 'x', 'C', 'C'}
int3 = []byte{0xCC}
f, l, fn = dbp.GoSymTable.PCToLine(uint64(addr))
orginalData = make([]byte, 4)
orginalData = make([]byte, 1)
)
_, err := syscall.PtracePeekData(dbp.Pid, addr, orginalData)

View File

@ -140,7 +140,7 @@ func TestBreakPoint(t *testing.T) {
}
pc := regs.PC()
if pc != sleepyaddr {
if pc != sleepyaddr+1 {
t.Fatalf("Break not respected:\nPC:%d\nFN:%d\n", pc, sleepyaddr)
}