aboutsummaryrefslogtreecommitdiff
path: root/src/libmach/demangler.c
blob: c6bb8756b65db4ca354f5e502a1881aee94e3cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
}