diff options
author | Ken Thompson <ken@golang.org> | 2008-06-27 13:03:19 -0700 |
---|---|---|
committer | Ken Thompson <ken@golang.org> | 2008-06-27 13:03:19 -0700 |
commit | 866cbb931153f7cb5b77c22c67ad4bac3727f886 (patch) | |
tree | dc9788315b1d59c70656abf607d3846179a762ec /src/cmd/6l/list.c | |
parent | 17de5e24c7dd0f0012bb12efce1583281492ed41 (diff) | |
download | golang-866cbb931153f7cb5b77c22c67ad4bac3727f886.tar.gz |
segmented stack
SVN=125151
Diffstat (limited to 'src/cmd/6l/list.c')
-rw-r--r-- | src/cmd/6l/list.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/cmd/6l/list.c b/src/cmd/6l/list.c index 3af019280..98321565b 100644 --- a/src/cmd/6l/list.c +++ b/src/cmd/6l/list.c @@ -56,10 +56,13 @@ Pconv(Fmt *fp) switch(p->as) { case ATEXT: if(p->from.scale) { - sprint(str, "%-7s %-7A %D,%d,%D", + sprint(str, "%-7s %-7A %D,%d,%lD", str1, p->as, &p->from, p->from.scale, &p->to); break; } + sprint(str, "%-7s %-7A %D,%lD", + str1, p->as, &p->from, &p->to); + break; default: sprint(str, "%-7s %-7A %D,%D", @@ -95,6 +98,22 @@ Dconv(Fmt *fp) a = va_arg(fp->args, Adr*); i = a->type; + + if(fp->flags & FmtLong) { + if(i != D_CONST) { + // ATEXT dst is not constant + sprint(str, "!!%D", a); + goto brk; + } + parsetextconst(a->offset); + if(textinarg == 0 && textoutarg == 0) { + sprint(str, "$%lld", textstksiz); + goto brk; + } + sprint(str, "$%lld-%lld-%lld", textstksiz, textinarg, textoutarg); + goto brk; + } + if(i >= D_INDIR) { if(a->offset) sprint(str, "%lld(%R)", a->offset, i-D_INDIR); @@ -395,3 +414,26 @@ diag(char *fmt, ...) errorexit(); } } + +void +parsetextconst(vlong arg) +{ + textstksiz = arg & 0xffffffffLL; + if(textstksiz & 0x80000000LL) + textstksiz = -(-textstksiz & 0xffffffffLL); + + + // the following throws away one bit + // of precision, but maintains compat + textinarg = (arg >> 32) & 0xffffLL; + if(textinarg & 0x8000LL) + textinarg = -(-textinarg & 0xffffLL); + if(textinarg <= 0) + textinarg = 100; + + textoutarg = (arg >> 48) & 0xffffLL; + if(textoutarg & 0x8000LL) + textoutarg = -(-textoutarg & 0xffffLL); + if(textoutarg <= 0) + textoutarg = 0; +} |