Commit Diff


commit - 2eb305240f559fa69a08969184ce9585d16f8b02
commit + 140c21e2f1fee2016af107b87f42a591f300f56a
blob - /dev/null
blob + a2a9b9636ee59ea7d32ea85e9c4747d332cc10f4 (mode 644)
--- /dev/null
+++ 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);
+}