1
0
mirror of https://github.com/golang/go synced 2024-11-21 18:14:42 -07:00

6c, 8c: show line numbers in -S output

R=ken2
CC=golang-dev
https://golang.org/cl/2107047
This commit is contained in:
Russ Cox 2010-09-10 11:53:51 -04:00
parent 82ee481dfc
commit 2cda191aef
2 changed files with 29 additions and 16 deletions

View File

@ -78,22 +78,23 @@ Pconv(Fmt *fp)
p = va_arg(fp->args, Prog*);
switch(p->as) {
case ADATA:
sprint(str, " %A %D/%d,%D",
p->as, &p->from, p->from.scale, &p->to);
sprint(str, "(%L) %A %D/%d,%D",
p->lineno, p->as, &p->from, p->from.scale, &p->to);
break;
case ATEXT:
if(p->from.scale) {
sprint(str, " %A %D,%d,%lD",
p->as, &p->from, p->from.scale, &p->to);
sprint(str, "(%L) %A %D,%d,%lD",
p->lineno, p->as, &p->from, p->from.scale, &p->to);
break;
}
sprint(str, " %A %D,%lD",
p->as, &p->from, &p->to);
sprint(str, "(%L) %A %D,%lD",
p->lineno, p->as, &p->from, &p->to);
break;
default:
sprint(str, " %A %D,%lD", p->as, &p->from, &p->to);
sprint(str, "(%L) %A %D,%lD",
p->lineno, p->as, &p->from, &p->to);
break;
}
return fmtstrcpy(fp, str);

View File

@ -76,15 +76,27 @@ Pconv(Fmt *fp)
Prog *p;
p = va_arg(fp->args, Prog*);
if(p->as == ADATA)
sprint(str, " %A %D/%d,%D",
p->as, &p->from, p->from.scale, &p->to);
else if(p->as == ATEXT)
sprint(str, " %A %D,%d,%D",
p->as, &p->from, p->from.scale, &p->to);
else
sprint(str, " %A %D,%D",
p->as, &p->from, &p->to);
switch(p->as) {
case ADATA:
sprint(str, "(%L) %A %D/%d,%D",
p->lineno, p->as, &p->from, p->from.scale, &p->to);
break;
case ATEXT:
if(p->from.scale) {
sprint(str, "(%L) %A %D,%d,%lD",
p->lineno, p->as, &p->from, p->from.scale, &p->to);
break;
}
sprint(str, "(%L) %A %D,%lD",
p->lineno, p->as, &p->from, &p->to);
break;
default:
sprint(str, "(%L) %A %D,%lD",
p->lineno, p->as, &p->from, &p->to);
break;
}
return fmtstrcpy(fp, str);
}