diff options
author | rsc <devnull@localhost> | 2004-04-21 20:04:18 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-21 20:04:18 +0000 |
commit | 4a64a77bd3c08809a1cfb4c5a76c2efbd33b1d7b (patch) | |
tree | 0b8c455a945ad65fdcae1a9798fdfc53b8ace15b /src/cmd/acid | |
parent | a3785ca2cc1c8693d89ebe44216acf781a634718 (diff) | |
download | plan9port-4a64a77bd3c08809a1cfb4c5a76c2efbd33b1d7b.tar.gz plan9port-4a64a77bd3c08809a1cfb4c5a76c2efbd33b1d7b.tar.bz2 plan9port-4a64a77bd3c08809a1cfb4c5a76c2efbd33b1d7b.zip |
add registers
Diffstat (limited to 'src/cmd/acid')
-rw-r--r-- | src/cmd/acid/list.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cmd/acid/list.c b/src/cmd/acid/list.c index 76214b2d..ad86966b 100644 --- a/src/cmd/acid/list.c +++ b/src/cmd/acid/list.c @@ -192,6 +192,32 @@ listvar(char *s, long v) } static List* +listregisters(Map *map, Regs *regs) +{ + List **tail, *l2, *l; + Regdesc *rp; + ulong v; + + l2 = 0; + tail = &l2; + for(rp=mach->reglist; rp->name; rp++){ + if(rget(regs, rp->name, &v) < 0) + continue; + l = al(TSTRING); + l->store.fmt = 's'; + l->store.u.string = strnode(rp->name); + *tail = l; + tail = &l->next; + l = al(TINT); + l->store.fmt = 'X'; + l->store.u.ival = v; + *tail = l; + tail = &l->next; + } + return l2; +} + +static List* listlocals(Map *map, Regs *regs, Symbol *fn, int class) { int i; @@ -266,5 +292,9 @@ trlist(Map *map, Regs *regs, ulong pc, ulong callerpc, Symbol *sym, int depth) if(sym) l->store.u.l = listautos(map, regs, sym); + l->next = al(TLIST); /* make list of registers */ + l = l->next; + l->store.u.l = listregisters(map, regs); + return depth<40; } |