delve/pkg/proc
Alessandro Arzilli c9c455cc38 cmd/dlv: actually disable C compiler optimizations when building (#1647)
* proc: fix stacktraces when a SIGSEGV happens during a cgo call

When a SIGSEGV happens in a cgo call (for example as a result of
dereferencing a NULL pointer) the stack layout will look like this:

(system stack) runtime.fatalthrow
(system stack) runtime.throw
(system stack) runtime.sigpanic
(system stack) offending C function
... other C functions...
(system stack) runtime.asmcgocall
(goroutine stack) call inside cgo

The code in switchStack would switch directly from the
runtime.fatalthrow frame to the first frame in the goroutine stack,
hiding important information.

Disable this switch for runtime.fatalthrow and reintroduce the check
for runtime.mstart that existed before this version of the code was
implemented in commit 7bec20.

This problem was reported in comment:
https://github.com/go-delve/delve/issues/935#issuecomment-512182533

* cmd/dlv: actually disable C compiler optimizations when building
2019-08-01 16:31:50 -07:00
..
core Miscellaneous logging improvements (#1525) 2019-03-27 14:58:36 -07:00
fbsdutil *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
gdbserial *: Add .cirrus.yml for FreeBSD testing (#1639) 2019-07-30 08:38:25 -07:00
linutil proc/linutil: Fix register bitmasks 2019-06-16 09:35:14 +02:00
native proc/native/linux: call postExit when process is killed by SIGINT (#1622) 2019-07-17 15:52:28 -07:00
test travis-ci: fix dwz test problems (#1648) 2019-07-31 13:09:00 -07:00
winutil proc/gdbserial: do not return floating point regs when not requested (#1497) 2019-02-26 08:53:45 -08:00
arch.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
bininfo.go *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
breakpoints.go proc/*: allow stepping into functions without debug_info symbols 2018-11-20 12:57:25 -08:00
disasm_amd64.go proc/*: allow stepping into functions without debug_info symbols 2018-11-20 12:57:25 -08:00
disasm.go *: Misc refactors, and doc additions 2018-09-19 20:59:35 +02:00
doc.go Move top-level packages into pkg 2017-02-08 12:17:19 -08:00
dwarf_expr_test.go proc: ignore DW_TAG_inlined_subroutine entries without abstract origin (#1637) 2019-07-26 11:24:35 -07:00
eval.go proc: increase maximum string length when loading string for binary ops (#1620) 2019-07-16 13:11:35 -07:00
fncall.go proc: flag variables that have a 'fake' address (#1619) 2019-07-16 13:12:16 -07:00
interface.go proc: allow simultaneous call injection to multiple goroutines (#1591) 2019-06-30 10:44:30 -07:00
mem.go More Function Calls, parts 2 (#1504) 2019-05-30 08:08:37 -07:00
moduledata.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
proc_general_test.go proc: change memCache to delay reading 2018-04-23 10:13:21 -07:00
proc_linux_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
proc_test.go cmd/dlv: actually disable C compiler optimizations when building (#1647) 2019-08-01 16:31:50 -07:00
proc_unix_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
proc.go proc: allow simultaneous call injection to multiple goroutines (#1591) 2019-06-30 10:44:30 -07:00
registers_amd64.go proc/gdbserial: do not return floating point regs when not requested (#1497) 2019-02-26 08:53:45 -08:00
registers.go proc/gdbserial: do not return floating point regs when not requested (#1497) 2019-02-26 08:53:45 -08:00
scope_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
stack.go cmd/dlv: actually disable C compiler optimizations when building (#1647) 2019-08-01 16:31:50 -07:00
threads.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
types.go proc: ignore DW_TAG_inlined_subroutine entries without abstract origin (#1637) 2019-07-26 11:24:35 -07:00
variable_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
variables.go proc: flag variables that have a 'fake' address (#1619) 2019-07-16 13:12:16 -07:00