Commit 6d69fd1f authored by Russ Cox's avatar Russ Cox

runtime: fix Caller

log: add test of Caller

New regexp in log test is picky and will require some
maintenance, but it catches off-by-one mistakes too.

Fixes #710.

R=gri
CC=esko.luontola, golang-dev
https://golang.org/cl/887043
parent a267ff6a
......@@ -17,7 +17,7 @@ const (
Rdate = `[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]`
Rtime = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]`
Rmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]`
Rline = `[0-9]+:`
Rline = `(58|60):` // must update if the calls to l.Logf / l.Log below move
Rlongfile = `.*/[A-Za-z0-9_\-]+\.go:` + Rline
Rshortfile = `[A-Za-z0-9_\-]+\.go:` + Rline
)
......
......@@ -479,7 +479,7 @@ void
{
Func *f;
if(callers(skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) {
if(callers(1+skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) {
retfile = emptystring;
retline = 0;
retbool = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment