summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-14 20:39:08 +0000
committerRuss Cox <rsc@golang.org>2014-09-14 20:39:08 +0000
commitaf9e91e0ce812fbb830e8e0e228436f11fbd6958 (patch)
tree240a53450c06c2b2dd653b7ecb70d9a6533025a9 /src
parent9c0ceaaa14192ef299c86b9e73f772c058f661cc (diff)
downloadgo-af9e91e0ce812fbb830e8e0e228436f11fbd6958.tar.gz
runtime: fix traceback of trap on ARM
The merged traceback was wrong for LR machines, because traceback didn't pass lr to gentraceback. Now that we have a test looking at traceback output for a trap (the test of runtime.Breakpoint), we caught this. While we're here, fix a 'set and not used' warning. Fixes arm build. TBR=r R=r CC=golang-codereviews https://codereview.appspot.com/143040043
Diffstat (limited to 'src')
-rw-r--r--src/runtime/mgc0.c3
-rw-r--r--src/runtime/traceback.go4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/mgc0.c b/src/runtime/mgc0.c
index c976b09c3..30a8ea2c9 100644
--- a/src/runtime/mgc0.c
+++ b/src/runtime/mgc0.c
@@ -634,9 +634,10 @@ scanframe(Stkframe *frame, void *unused)
// Scan local variables if stack frame has been allocated.
size = frame->varp - frame->sp;
- minsize = 0;
if(thechar != '6' && thechar != '8')
minsize = sizeof(uintptr);
+ else
+ minsize = 0;
if(size > minsize) {
stackmap = runtime·funcdata(f, FUNCDATA_LocalsPointerMaps);
if(stackmap == nil || stackmap->n <= 0) {
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index eaf54db31..07b68d29b 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -451,9 +451,9 @@ func traceback(pc uintptr, sp uintptr, lr uintptr, gp *g) {
}
// Print traceback. By default, omits runtime frames.
// If that means we print nothing at all, repeat forcing all frames printed.
- n = gentraceback(pc, sp, 0, gp, 0, nil, _TracebackMaxFrames, nil, nil, false)
+ n = gentraceback(pc, sp, lr, gp, 0, nil, _TracebackMaxFrames, nil, nil, false)
if n == 0 {
- n = gentraceback(pc, sp, 0, gp, 0, nil, _TracebackMaxFrames, nil, nil, true)
+ n = gentraceback(pc, sp, lr, gp, 0, nil, _TracebackMaxFrames, nil, nil, true)
}
if n == _TracebackMaxFrames {
print("...additional frames elided...\n")