diff options
author | rsc <devnull@localhost> | 2005-11-29 04:05:42 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-11-29 04:05:42 +0000 |
commit | 140c21e2f1fee2016af107b87f42a591f300f56a (patch) | |
tree | 5ac4ae95161de1ea41ab7a41805ff571b23adcd6 /src/libmach | |
parent | 2eb305240f559fa69a08969184ce9585d16f8b02 (diff) | |
download | plan9port-140c21e2f1fee2016af107b87f42a591f300f56a.tar.gz plan9port-140c21e2f1fee2016af107b87f42a591f300f56a.tar.bz2 plan9port-140c21e2f1fee2016af107b87f42a591f300f56a.zip |
test program
Diffstat (limited to 'src/libmach')
-rw-r--r-- | src/libmach/demangler.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libmach/demangler.c b/src/libmach/demangler.c new file mode 100644 index 00000000..a2a9b963 --- /dev/null +++ b/src/libmach/demangler.c @@ -0,0 +1,27 @@ +#include <u.h> +#include <libc.h> +#include <bio.h> +#include <mach.h> + +void +main(void) +{ + Biobuf b, bout; + char *p, *s; + char buf[100000]; + + Binit(&b, 0, OREAD); + Binit(&bout, 1, OWRITE); + + while((p = Brdline(&b, '\n')) != nil){ + p[Blinelen(&b)-1] = 0; + werrstr("no error"); + s = demanglegcc2(p, buf); + if(s == p) + Bprint(&bout, "# %s (%r)\n", p); + else + Bprint(&bout, "%s\t%s\n", p, s); + } + Bflush(&bout); + exits(0); +} |