summaryrefslogtreecommitdiff
path: root/sys/src/cmd/acid/util.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-02-09 22:43:09 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-02-09 22:43:09 +0100
commit16acf605e21e55e8f0520cf54016bfec5291802e (patch)
treeb63615e24216e3d054c052cf330372e1a45b4a23 /sys/src/cmd/acid/util.c
parent9bdf602ebbdcfcb4baaeb17499a1f1f6865ddc61 (diff)
acid: make 'a' and 'A' format to have the same size as mach->szaddr
to make it easier to write portable acid code, we introduce 'A' format in the same meaning as in db(1): A Print the value of dot in hexadecimal. Dot is unaffected. both 'a' (symbolic) and 'A' will both have 64 or 32 bit size depending on the mach, so pointer array indexing works the same.
Diffstat (limited to 'sys/src/cmd/acid/util.c')
-rw-r--r--sys/src/cmd/acid/util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/src/cmd/acid/util.c b/sys/src/cmd/acid/util.c
index b47d4cbbb..46431f75e 100644
--- a/sys/src/cmd/acid/util.c
+++ b/sys/src/cmd/acid/util.c
@@ -7,6 +7,7 @@
#include "acid.h"
#include "y.tab.h"
+char afmt = 'X';
static int syren;
Lsym*
@@ -88,7 +89,7 @@ varsym(void)
l->v->type = TINT;
l->v->ival = v;
if(l->v->comt == 0)
- l->v->fmt = 'X';
+ l->v->fmt = 'A';
/* Enter as list of { name, type, value } */
list = al(TSTRING);
@@ -101,7 +102,7 @@ varsym(void)
list->ival = s->type;
list->next = al(TINT);
list = list->next;
- list->fmt = 'X';
+ list->fmt = l->v->fmt;
list->ival = v;
}
@@ -122,6 +123,12 @@ varreg(void)
Reglist *r;
List **tail, *li;
+ if(mach->szaddr == 8){
+ afmt = 'Y';
+ fsize['a'] = fsize[afmt];
+ fsize['A'] = fsize[afmt];
+ }
+
l = mkvar("registers");
v = l->v;
v->set = 1;