1
0
mirror of https://github.com/golang/go synced 2024-11-22 00: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*); p = va_arg(fp->args, Prog*);
switch(p->as) { switch(p->as) {
case ADATA: case ADATA:
sprint(str, " %A %D/%d,%D", sprint(str, "(%L) %A %D/%d,%D",
p->as, &p->from, p->from.scale, &p->to); p->lineno, p->as, &p->from, p->from.scale, &p->to);
break; break;
case ATEXT: case ATEXT:
if(p->from.scale) { if(p->from.scale) {
sprint(str, " %A %D,%d,%lD", sprint(str, "(%L) %A %D,%d,%lD",
p->as, &p->from, p->from.scale, &p->to); p->lineno, p->as, &p->from, p->from.scale, &p->to);
break; break;
} }
sprint(str, " %A %D,%lD", sprint(str, "(%L) %A %D,%lD",
p->as, &p->from, &p->to); p->lineno, p->as, &p->from, &p->to);
break; break;
default: 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; break;
} }
return fmtstrcpy(fp, str); return fmtstrcpy(fp, str);

View File

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