diff --git a/sys/src/cmd/dtracy/act.c b/sys/src/cmd/dtracy/act.c index dde47ae57..2159ce19e 100644 --- a/sys/src/cmd/dtracy/act.c +++ b/sys/src/cmd/dtracy/act.c @@ -192,7 +192,8 @@ prepprintf(Node **arg, int narg, DTActGr *g, int *recoff) goto again; case 'x': case 'X': case 'o': case 'b': case 'd': if(n >= narg) sysfatal("printf() too few arguments"); - if(arg[n]->typ->type != TYPINT) sysfatal("print() %%%c with non-integer", *fmt); + if(arg[n]->typ->type != TYPINT) + sysfatal("%d: print() %%%c with non-integer", arg[n]->line, *fmt); arg[n] = tracegen(arg[n], g, recoff); n++; fmtrune(&f, 'l'); @@ -201,7 +202,8 @@ prepprintf(Node **arg, int narg, DTActGr *g, int *recoff) break; case 's': if(n >= narg) sysfatal("printf() too few arguments"); - if(arg[n]->typ->type != TYPSTRING) sysfatal("print() %%s with non-string"); + if(arg[n]->typ->type != TYPSTRING) + sysfatal("%d: print() %%s with non-string", arg[n]->line); arg[n] = tracegen(arg[n], g, recoff); n++; fmtrune(&f, *fmt); diff --git a/sys/src/cmd/dtracy/dat.h b/sys/src/cmd/dtracy/dat.h index 5087a609e..cffc1968b 100644 --- a/sys/src/cmd/dtracy/dat.h +++ b/sys/src/cmd/dtracy/dat.h @@ -75,6 +75,7 @@ struct Node { Symbol *sym; char *str; s64int num; + int line; /* used by elidecasts() */ char databits; diff --git a/sys/src/cmd/dtracy/lex.c b/sys/src/cmd/dtracy/lex.c index c820f145c..bd7825542 100644 --- a/sys/src/cmd/dtracy/lex.c +++ b/sys/src/cmd/dtracy/lex.c @@ -239,6 +239,7 @@ node(int type, ...) n = emalloc(sizeof(Node)); n->type = type; + n->line = lineno; va_start(va, type); switch(type){ case OBIN: