show line numbers in dtracy type errors
This commit is contained in:
parent
17ebe55031
commit
8150f68995
3 changed files with 6 additions and 2 deletions
|
@ -192,7 +192,8 @@ prepprintf(Node **arg, int narg, DTActGr *g, int *recoff)
|
||||||
goto again;
|
goto again;
|
||||||
case 'x': case 'X': case 'o': case 'b': case 'd':
|
case 'x': case 'X': case 'o': case 'b': case 'd':
|
||||||
if(n >= narg) sysfatal("printf() too few arguments");
|
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);
|
arg[n] = tracegen(arg[n], g, recoff);
|
||||||
n++;
|
n++;
|
||||||
fmtrune(&f, 'l');
|
fmtrune(&f, 'l');
|
||||||
|
@ -201,7 +202,8 @@ prepprintf(Node **arg, int narg, DTActGr *g, int *recoff)
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
if(n >= narg) sysfatal("printf() too few arguments");
|
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);
|
arg[n] = tracegen(arg[n], g, recoff);
|
||||||
n++;
|
n++;
|
||||||
fmtrune(&f, *fmt);
|
fmtrune(&f, *fmt);
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct Node {
|
||||||
Symbol *sym;
|
Symbol *sym;
|
||||||
char *str;
|
char *str;
|
||||||
s64int num;
|
s64int num;
|
||||||
|
int line;
|
||||||
|
|
||||||
/* used by elidecasts() */
|
/* used by elidecasts() */
|
||||||
char databits;
|
char databits;
|
||||||
|
|
|
@ -239,6 +239,7 @@ node(int type, ...)
|
||||||
|
|
||||||
n = emalloc(sizeof(Node));
|
n = emalloc(sizeof(Node));
|
||||||
n->type = type;
|
n->type = type;
|
||||||
|
n->line = lineno;
|
||||||
va_start(va, type);
|
va_start(va, type);
|
||||||
switch(type){
|
switch(type){
|
||||||
case OBIN:
|
case OBIN:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue