Skip to content

Commit 2c7ea98

Browse files
dkegel-fastlydeadprogram
authored andcommitted
runtime: add stubs for Func.FileLine and Frame.PC
With this, 'tinygo test' in github.com/pkg/errors at least compiles and passes a few tests: $ git clone github.com/pkg/errors $ cd errors $ tinygo test -c $ for a in $(go test -list Test | grep Test); do ./errors.test -test.run $a -test.v > $a.log 2>&1; done $ grep -l PASS *.log | wc -l 19 $ grep -l FAIL *.log | wc -l 11 For tinygo-org#2445
1 parent 57b8f7e commit 2c7ea98

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/runtime/stack.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ func (f *Func) Name() string {
1111
return ""
1212
}
1313

14+
func (f *Func) FileLine(pc uintptr) (file string, line int) {
15+
return "", 0
16+
}
17+
1418
func Caller(skip int) (pc uintptr, file string, line int, ok bool) {
1519
return 0, "", 0, false
1620
}

src/runtime/symtab.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type Frame struct {
99

1010
File string
1111
Line int
12+
PC uintptr
1213
}
1314

1415
func CallersFrames(callers []uintptr) *Frames {

0 commit comments

Comments
 (0)