mirror of
https://github.com/golang/go
synced 2024-11-19 10:04:56 -07:00
c5ed10f3be
This adds a mechanism for debuggers to safely inject calls to Go functions on amd64. Debuggers must participate in a protocol with the runtime, and need to know how to lay out a call frame, but the runtime support takes care of the details of handling live pointers in registers, stack growth, and detecting the trickier conditions when it is unsafe to inject a user function call. Fixes #21678. Updates derekparker/delve#119. Change-Id: I56d8ca67700f1f77e19d89e7fc92ab337b228834 Reviewed-on: https://go-review.googlesource.com/109699 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
45 lines
764 B
Go
45 lines
764 B
Go
package runtime
|
|
|
|
const (
|
|
// These values are referred to in the source code
|
|
// but really don't matter. Even so, use the standard numbers.
|
|
_SIGQUIT = 3
|
|
_SIGTRAP = 5
|
|
_SIGSEGV = 11
|
|
_SIGPROF = 27
|
|
)
|
|
|
|
type timespec struct {
|
|
tv_sec int64
|
|
tv_nsec int32
|
|
}
|
|
|
|
type excregs386 struct {
|
|
eax uint32
|
|
ecx uint32
|
|
edx uint32
|
|
ebx uint32
|
|
esp uint32
|
|
ebp uint32
|
|
esi uint32
|
|
edi uint32
|
|
eip uint32
|
|
eflags uint32
|
|
}
|
|
|
|
type exccontext struct {
|
|
size uint32
|
|
portable_context_offset uint32
|
|
portable_context_size uint32
|
|
arch uint32
|
|
regs_size uint32
|
|
reserved [11]uint32
|
|
regs excregs386
|
|
}
|
|
|
|
type excportablecontext struct {
|
|
pc uint32
|
|
sp uint32
|
|
fp uint32
|
|
}
|