|
From: <sv...@va...> - 2008-10-27 09:58:37
|
Author: sewardj
Date: 2008-10-27 09:54:14 +0000 (Mon, 27 Oct 2008)
New Revision: 8714
Log:
Fix #includes in some more libiberty files that seem to have been
forgotten about in r8710. This should _really_ make the revised
demangler independent of any system installed libiberty.
Modified:
trunk/coregrind/m_demangle/dyn-string.c
trunk/coregrind/m_demangle/safe-ctype.c
trunk/coregrind/m_demangle/vg_libciface.h
Modified: trunk/coregrind/m_demangle/dyn-string.c
===================================================================
--- trunk/coregrind/m_demangle/dyn-string.c 2008-10-27 01:25:14 UTC (rev 8713)
+++ trunk/coregrind/m_demangle/dyn-string.c 2008-10-27 09:54:14 UTC (rev 8714)
@@ -28,25 +28,34 @@
the Free Software Foundation, 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1301, USA. */
-/////////////////////////////
-#include <string.h>
-#include <stdlib.h>
-/////////////////////////////
+#if 0 /* in valgrind */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#endif /* ! in valgrind */
+#if 0 /* in valgrind */
#include <stdio.h>
+#endif /* ! in valgrind */
+#if 0 /* in valgrind */
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#endif /* ! in valgrind */
+#if 0 /* in valgrind */
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#endif /* ! in valgrind */
+#if 0 /* in valgrind */
#include "libiberty.h"
+#endif /* ! in valgrind */
+
+#include "vg_libciface.h"
+
#include "dyn-string.h"
/* Performs in-place initialization of a dyn_string struct. This
Modified: trunk/coregrind/m_demangle/safe-ctype.c
===================================================================
--- trunk/coregrind/m_demangle/safe-ctype.c 2008-10-27 01:25:14 UTC (rev 8713)
+++ trunk/coregrind/m_demangle/safe-ctype.c 2008-10-27 09:54:14 UTC (rev 8714)
@@ -115,10 +115,16 @@
*/
+#if 0 /* in valgrind */
#include "ansidecl.h"
#include <safe-ctype.h>
#include <stdio.h> /* for EOF */
+#endif /* ! in valgrind */
+#include "vg_libciface.h"
+
+#include "safe-ctype.h"
+
#if EOF != -1
#error "<safe-ctype.h> requires EOF == -1"
#endif
Modified: trunk/coregrind/m_demangle/vg_libciface.h
===================================================================
--- trunk/coregrind/m_demangle/vg_libciface.h 2008-10-27 01:25:14 UTC (rev 8713)
+++ trunk/coregrind/m_demangle/vg_libciface.h 2008-10-27 09:54:14 UTC (rev 8714)
@@ -74,6 +74,11 @@
#define xstrdup(_str) \
VG_(arena_strdup)(VG_AR_DEMANGLE,"m_demangle.xstrdup",(_str))
+/* Required by safe-ctype.h */
+
+#undef EOF
+#define EOF -1
+
/* Taken from libiberty.h: */
#define ARRAY_SIZE(_arr) \
|
|
From: Josef W. <Jos...@gm...> - 2008-10-27 14:56:25
|
On Monday 27 October 2008, sv...@va... wrote: > Fix #includes in some more libiberty files that seem to have been > forgotten about in r8710. This should _really_ make the revised > demangler independent of any system installed libiberty. Thanks for this! However, some time ago I checked out the Sun C++ compiler for Linux, and it uses a different kind of demangling. So perhaps we should realize that any internal demangler can not cover all cases. Providing a workaround for border cases like this (e.g. pasting the log output of Valgrind trough the "c++filt" delivered with Sun C++ - no idea if this works) seems to be useful. Josef |
|
From: Julian S. <js...@ac...> - 2008-10-27 15:13:38
|
> However, some time ago I checked out the Sun C++ compiler for Linux, and
> it uses a different kind of demangling. So perhaps we should realize that
> any internal demangler can not cover all cases.
This was only a demangler update. V's demangler should already be able to
handle basically anything that c++filt can handle. However, it is set to
"auto_demangler" style, which I think means that it tries to demangle
according to the G++ 3.0 rules, and if that doesn't work then it tries
some heuristic hacks for other mangling systems (lucid, cfront, arm, java,
etc) but often fails.
So my belief is, if the demangler is made to operate in "arm" mode first,
(or whatever sun CC is using) then it should work well. It's just a 1-line
change, to tell it what the default "demangling style" is.
Maybe we should add a flag identical to c++filt's --format flag:
[-s|--format {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat}]
in order to support this conveniently.
J
|