diff options
author | Alessandro Arzilli <alessandro.arzilli@gmail.com> | 2019-02-05 08:49:49 +0100 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2019-04-29 04:05:29 +0000 |
commit | d016330241c526f09b5ec70cdf17bfd0c257006b (patch) | |
tree | 210a9ae9b1f99a2006869f8424687dbb533ebffa /src/runtime/asm_amd64.s | |
parent | 50ad09418eb22cb9f6294ca86b0bfd77af7d2128 (diff) | |
download | go-d016330241c526f09b5ec70cdf17bfd0c257006b.tar.gz go-d016330241c526f09b5ec70cdf17bfd0c257006b.zip |
runtime: whitelist debugCall32..debugCall65536 in debugCallCheck
Whitelists functions debugCall32 through debugCall65536 in
runtime.debugCallCheck so that any instruction inside those functions
is considered a safe point.
This is useful for implementing nested function calls.
For example when evaluating:
f(g(x))
The debugger should:
1. initiate the call to 'f' until the entry point of 'f',
2. complete the call to 'g(x)'
3. copy the return value of 'g(x)' in the arguments of 'f'
4. complete the call to 'f'
Similarly for:
f().amethod()
The debugger should initiate the call to '.amethod()', then initiate
and complete the call to f(), copy the return value to the arguments
of '.amethod()' and finish its call.
However in this example, unlike the other example, it may be
impossible to determine the entry point of '.amethod()' until after
'f()' is evaluated, which means that the call to 'f()' needs to be
initiated while stopped inside a debugCall... function.
Change-Id: I575c23542709cedb1a171d63576f7e11069c7674
Reviewed-on: https://go-review.googlesource.com/c/go/+/161137
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/runtime/asm_amd64.s')
-rw-r--r-- | src/runtime/asm_amd64.s | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s index e5b987858d..1cca0c794b 100644 --- a/src/runtime/asm_amd64.s +++ b/src/runtime/asm_amd64.s @@ -1612,6 +1612,8 @@ restore: RET +// runtime.debugCallCheck assumes that functions defined with the +// DEBUG_CALL_FN macro are safe points to inject calls. #define DEBUG_CALL_FN(NAME,MAXSIZE) \ TEXT NAME(SB),WRAPPER,$MAXSIZE-0; \ NO_LOCAL_POINTERS; \ |