From 340f28deabf1264ce48ff0423021f34a31543f9d Mon Sep 17 00:00:00 2001 From: Luuk van Dijk Date: Wed, 18 Aug 2010 00:16:05 +0200 Subject: [PATCH] runtime: correct line numbers for .goc files. Linenumbers start at 1. Also call goc2c with an absolute pathi to preserve debug info. R=rsc, r, ken2 CC=golang-dev https://golang.org/cl/1954049 --- src/pkg/runtime/Makefile | 2 +- src/pkg/runtime/goc2c.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile index 6571d802d4..a8e7bc7509 100644 --- a/src/pkg/runtime/Makefile +++ b/src/pkg/runtime/Makefile @@ -132,7 +132,7 @@ version.go: mkversion ./mkversion >version.go %.c: %.goc goc2c - ./goc2c $< > $@.tmp + ./goc2c `pwd`/$< > $@.tmp mv -f $@.tmp $@ %.$O: $(GOARCH)/%.c diff --git a/src/pkg/runtime/goc2c.c b/src/pkg/runtime/goc2c.c index 385b885855..826ceff3ab 100644 --- a/src/pkg/runtime/goc2c.c +++ b/src/pkg/runtime/goc2c.c @@ -28,7 +28,7 @@ static int gcc; /* File and line number */ static const char *file; -static unsigned int lineno; +static unsigned int lineno = 1; /* List of names and types. */ struct params { -- 2.50.0