The debugging example in Neo's 9 Inro book, the hi.c program, shows
the parameters to functions vfprint and dofmt in reverse order to
their respective signatures.

cpu% acid 4328
/proc/4328/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: stk()
dofmt(fmt=0x0,f=0x7fffffffee30)+0x177 /sys/src/libc/fmt/dofmt.c:37
vfprint(args=0x7fffffffeed0,fmt=0x0)+0x57 /sys/src/libc/fmt/vfprint.c:30
print(fmt=0xfefefefefefefefe)+0x25 /sys/src/libc/fmt/print.c:13
main(argv=0x7fffffffefa0)+0x1c /usr/ak/tmp/9intro/ch2/hi.c:10
_callmain+0x63 /sys/src/libc/9sys/callmain.c:22

cpu% sig dofmt vfprint
int dofmt(Fmt *f, char *fmt);
int vfprint(int fd, char *format, va_list v)

The ls(1) debugging example given in the 'Using the Library Functions'
section of the acid.pdf paper shows the ls function's parameters in
the same order as given in the function definition.

cpu% grep '^ls' /sys/src/cmd/ls.c
ls(char *s, int multi)

cpu% acid /bin/ls
/bin/ls:amd64 plan 9 executable
[...]
acid: stk()
ls(s=0xfefefefe0000004d,multi=0x0)+0x0 /sys/src/cmd/ls.c:88
main(argc=0xfefefefe00000000,argv=0x7fffffffefa8)+0xb5 /sys/src/cmd/ls.c:80
_callmain+0x63 /sys/src/libc/9sys/callmain.c:22

Perusing both the acid(1) manpage and the acid.pdf pager didn't
clarify this for me.
I'd appreciate someone clarifying this for me.

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T11154b322e6bc833-M80e692d32502c3219df9fd78
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to