diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-03-03 17:40:19 +0100 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-03-03 17:40:19 +0100 |
commit | c8bf49ef8a92e2337b69c14b9b88396efe498600 (patch) | |
tree | 79832126e4ea62c62aa4e23003864d706fa2e903 /src/pkg/runtime/sys_x86.c | |
parent | 64d2a7c8945ba05af859901f5e248f1befdd8621 (diff) | |
download | golang-c8bf49ef8a92e2337b69c14b9b88396efe498600.tar.gz |
Imported Upstream version 1.2.1upstream/1.2.1
Diffstat (limited to 'src/pkg/runtime/sys_x86.c')
-rw-r--r-- | src/pkg/runtime/sys_x86.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pkg/runtime/sys_x86.c b/src/pkg/runtime/sys_x86.c index e68ff514a..0df6dfbbd 100644 --- a/src/pkg/runtime/sys_x86.c +++ b/src/pkg/runtime/sys_x86.c @@ -37,6 +37,19 @@ runtime·rewindmorestack(Gobuf *gobuf) gobuf->pc = gobuf->pc + 2 + *(int8*)(pc+1); return; } + if(pc[0] == 0xcc) { + // This is a breakpoint inserted by gdb. We could use + // runtime·findfunc to find the function. But if we + // do that, then we will continue execution at the + // function entry point, and we will not hit the gdb + // breakpoint. So for this case we don't change + // gobuf->pc, so that when we return we will execute + // the jump instruction and carry on. This means that + // stack unwinding may not work entirely correctly + // (http://golang.org/issue/5723) but the user is + // running under gdb anyhow. + return; + } runtime·printf("runtime: pc=%p %x %x %x %x %x\n", pc, pc[0], pc[1], pc[2], pc[3], pc[4]); runtime·throw("runtime: misuse of rewindmorestack"); } |