﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
70	Demangle function names for omf debug info	Yuri Dario	bird	"This code is courtesy of froloff and slightly modified by me.


{{{
Index: emxomf.smak
===================================================================
--- emxomf.smak	(revision 2592)
+++ emxomf.smak	(working copy)
@@ -8,6 +8,7 @@
 .TSRC	:= $(addprefix src/emxomf/,emxomf.c stabshll.c grow.c)
 .TCF	:= $(CFLAGS.DEF.VERSION)
 .TDEP	:= @O@libomflib$A
+.TLDF	:= -liberty
 include mkexe.smak
 
 .TARGET	:= emxomfar.exe
Index: stabshll.c
===================================================================
--- stabshll.c	(revision 2592)
+++ stabshll.c	(working copy)
@@ -35,6 +35,7 @@
 #include ""grow.h""
 #include ""stabshll.h""
 
+#include <demangle.h>
 
 /*******************************************************************************
 *   Defined Constants And Macros                                               *
@@ -3325,8 +3326,18 @@
     abort ();
   n = p - str;
 
-  /** @todo name demangling */
-  name = strpool_addn (str_pool, str, n);
+  {
+     char mangled[1024];
+     char* demangled;
+     memcpy(mangled, str, n);
+     mangled[n]= '\0';
+     demangled = cplus_demangle (mangled, DMGL_ANSI | DMGL_PARAMS);
+     if (demangled != NULL)
+      name = strpool_addn (str_pool, demangled, strlen(demangled));
+    else
+      name = strpool_addn (str_pool, str, n);
+  }
+
   proc_start_addr = symbol->n_value;
 
   /* now let's see if there is a memfunc for this name. */

}}}

"	defect	closed	normal	libc-0.6.1	emx	0.6	normal	fixed		
