delve/pkg/proc
Alessandro Arzilli f3b149bda7 proc: support debugging plugins (#1414)
This change splits the BinaryInfo object into a slice of Image objects
containing information about the base executable and each loaded shared
library (note: go plugins are shared libraries).

Delve backens are supposed to call BinaryInfo.AddImage whenever they
detect that a new shared library has been loaded.

Member fields of BinaryInfo that are used to speed up access to dwarf
(Functions, packageVars, consts, etc...) remain part of BinaryInfo and
are updated to reference the correct image object. This simplifies this
change.

This approach has a few shortcomings:

1. Multiple shared libraries can define functions or globals with the
   same name and we have no way to disambiguate between them.

2. We don't have a way to handle library unloading.

Both of those affect C shared libraries much more than they affect go
plugins. Go plugins can't be unloaded at all and a lot of name
collisions are prevented by import paths.

There's only one problem that is concerning: if two plugins both import
the same package they will end up with multiple definition for the same
function.
For example if two plugins use fmt.Printf the final in-memory image
(and therefore our BinaryInfo object) will end up with two copies of
fmt.Printf at different memory addresses. If a user types
  break fmt.Printf
a breakpoint should be created at *both* locations.
Allowing this is a relatively complex change that should be done in a
different PR than this.

For this reason I consider this approach an acceptable and sustainable
stopgap.

Updates #865
2019-05-08 14:06:38 -07:00
..
core Miscellaneous logging improvements (#1525) 2019-03-27 14:58:36 -07:00
gdbserial Miscellaneous logging improvements (#1525) 2019-03-27 14:58:36 -07:00
linutil proc,proc/native,proc/gdbserial: initial plugin support (#1413) 2019-03-20 10:32:51 -07:00
native proc/native: fix target program crash caused by call injection (linux) (#1538) 2019-04-25 09:45:37 -07:00
test proc,proc/native,proc/gdbserial: initial plugin support (#1413) 2019-03-20 10:32:51 -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 proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -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: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
eval.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
fncall.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
interface.go pkg/proc: Refactor process post initialization 2018-11-15 18:16:16 +01:00
mem.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01: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 proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -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: support debugging plugins (#1414) 2019-05-08 14:06:38 -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 proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
threads.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
types.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -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: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00