|
From: <sv...@va...> - 2005-05-10 04:57:02
|
Author: njn
Date: 2005-05-10 05:56:56 +0100 (Tue, 10 May 2005)
New Revision: 3654
Added:
trunk/coregrind/m_demangle/
trunk/coregrind/m_demangle/demangle.c
trunk/coregrind/pub_core_demangle.h
Removed:
trunk/coregrind/demangle/
trunk/coregrind/vg_demangle.c
Modified:
trunk/configure.in
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_demangle/Makefile.am
Log:
Modularised the demangler into m_demangle. (It very nearly fit our new
module structure as-is.)
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/configure.in 2005-05-10 04:50:05 UTC (rev 3653)
+++ trunk/configure.in 2005-05-10 04:56:56 UTC (rev 3654)
@@ -393,7 +393,7 @@
include/x86-linux/Makefile=20
auxprogs/Makefile
coregrind/Makefile=20
- coregrind/demangle/Makefile=20
+ coregrind/m_demangle/Makefile=20
coregrind/m_aspacemgr/Makefile=20
coregrind/m_replacemalloc/Makefile=20
coregrind/m_sigframe/Makefile=20
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-05-10 04:50:05 UTC (rev 3653)
+++ trunk/coregrind/Makefile.am 2005-05-10 04:56:56 UTC (rev 3654)
@@ -2,7 +2,7 @@
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
MODULES =3D \
- demangle \
+ m_demangle \
m_aspacemgr \
m_replacemalloc \
m_sigframe \
@@ -19,7 +19,7 @@
$(VG_ARCH_ALL) $(VG_OS_ALL) $(VG_PLATFORM_ALL) \
$(MODULES) .
=20
-AM_CPPFLAGS +=3D -DVG_LIBDIR=3D"\"$(valdir)"\" -I$(srcdir)/demangle \
+AM_CPPFLAGS +=3D -DVG_LIBDIR=3D"\"$(valdir)"\" \
-DKICKSTART_BASE=3D@KICKSTART_BASE@
=20
AM_CFLAGS =3D $(WERROR) -Wmissing-prototypes -Winline -Wall -Wshadow -O =
-g @ARCH_CORE_AM_CFLAGS@
@@ -39,6 +39,7 @@
core_asm.h \
pub_core_aspacemgr.h \
pub_core_debuglog.h \
+ pub_core_demangle.h \
pub_core_errormgr.h \
pub_core_execontext.h \
pub_core_mallocfree.h \
@@ -75,7 +76,6 @@
ume.c \
\
vg_scheduler.c \
- vg_demangle.c \
vg_hashtable.c \
vg_main.c \
vg_messages.c \
@@ -95,7 +95,7 @@
=20
## libplatform.a must be before libarch.a and libos.a, it seems.
stage2_extra=3D \
- demangle/libdemangle.a \
+ m_demangle/libdemangle.a \
m_aspacemgr/libaspacemgr.a \
m_sigframe/libsigframe.a \
m_syscalls/libsyscalls.a \
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-05-10 04:50:05 UTC (rev 3653)
+++ trunk/coregrind/core.h 2005-05-10 04:56:56 UTC (rev 3654)
@@ -718,14 +718,6 @@
extern void VG_(send_bytes_to_logging_sink) ( Char* msg, Int nbytes );
=20
/* ---------------------------------------------------------------------
- Exports of vg_demangle.c
- ------------------------------------------------------------------ */
-
-extern void VG_(demangle) ( Char* orig, Char* result, Int result_size );
-
-extern void VG_(reloc_abs_jump) ( UChar *jmp );
-
-/* ---------------------------------------------------------------------
Exports of vg_translate.c
------------------------------------------------------------------ */
=20
Copied: trunk/coregrind/m_demangle (from rev 3648, trunk/coregrind/demang=
le)
Modified: trunk/coregrind/m_demangle/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/demangle/Makefile.am 2005-05-10 02:47:21 UTC (rev 364=
8)
+++ trunk/coregrind/m_demangle/Makefile.am 2005-05-10 04:56:56 UTC (rev 3=
654)
@@ -18,7 +18,11 @@
noinst_LIBRARIES =3D libdemangle.a
=20
libdemangle_a_SOURCES =3D \
- cp-demangle.c cplus-dem.c dyn-string.c safe-ctype.c
+ cp-demangle.c \
+ cplus-dem.c \
+ demangle.c \
+ dyn-string.c \
+ safe-ctype.c
=20
## Ignore harmless warnings for these ones
cp-demangle.o: CFLAGS +=3D -Wno-unused -Wno-shadow=20
Copied: trunk/coregrind/m_demangle/demangle.c (from rev 3648, trunk/coreg=
rind/vg_demangle.c)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_demangle.c 2005-05-10 02:47:21 UTC (rev 3648)
+++ trunk/coregrind/m_demangle/demangle.c 2005-05-10 04:56:56 UTC (rev 36=
54)
@@ -0,0 +1,61 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Demangling of C++ mangled names. demangle.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "core.h"
+#include "demangle.h"
+
+void VG_(demangle) ( Char* orig, Char* result, Int result_size )
+{
+ Char* demangled =3D NULL;
+
+ VGP_PUSHCC(VgpDemangle);
+
+ if (VG_(clo_demangle))
+ demangled =3D VG_(cplus_demangle) ( orig, DMGL_ANSI | DMGL_PARAMS =
);
+
+ if (demangled) {
+ VG_(strncpy_safely)(result, demangled, result_size);
+ VG_(arena_free) (VG_AR_DEMANGLE, demangled);
+ } else {
+ VG_(strncpy_safely)(result, orig, result_size);
+ }
+
+ // 13 Mar 2005: We used to check here that the demangler wasn't leaki=
ng
+ // by calling the (now-removed) function VG_(is_empty_arena)(). But,
+ // very rarely (ie. I've heard of it twice in 3 years), the demangler
+ // does leak. But, we can't do much about it, and it's not a disaste=
r,
+ // so we just let it slide without aborting or telling the user.
+
+ VGP_POPCC(VgpDemangle);
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/coregrind/pub_core_demangle.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_demangle.h 2005-05-10 04:50:05 UTC (rev 3653=
)
+++ trunk/coregrind/pub_core_demangle.h 2005-05-10 04:56:56 UTC (rev 3654=
)
@@ -0,0 +1,45 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The C++ name demangler. pub_core_demangle.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_DEMANGLE_H
+#define __PUB_CORE_DEMANGLE_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module exports a single function for demangling C++
+// names.
+//--------------------------------------------------------------------
+
+extern void VG_(demangle) ( Char* orig, Char* result, Int result_size );
+
+#endif // __PUB_CORE_DEMANGLE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Deleted: trunk/coregrind/vg_demangle.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_demangle.c 2005-05-10 04:50:05 UTC (rev 3653)
+++ trunk/coregrind/vg_demangle.c 2005-05-10 04:56:56 UTC (rev 3654)
@@ -1,63 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Demangling of C++ mangled names. ---*/
-/*--- vg_demangle.c ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#include "core.h"
-#include "demangle.h"
-
-void VG_(demangle) ( Char* orig, Char* result, Int result_size )
-{
- Char* demangled =3D NULL;
-
- VGP_PUSHCC(VgpDemangle);
-
- if (VG_(clo_demangle))
- demangled =3D VG_(cplus_demangle) ( orig, DMGL_ANSI | DMGL_PARAMS =
);
-
- if (demangled) {
- VG_(strncpy_safely)(result, demangled, result_size);
- VG_(arena_free) (VG_AR_DEMANGLE, demangled);
- } else {
- VG_(strncpy_safely)(result, orig, result_size);
- }
-
- // 13 Mar 2005: We used to check here that the demangler wasn't leaki=
ng
- // by calling the (now-removed) function VG_(is_empty_arena)(). But,
- // very rarely (ie. I've heard of it twice in 3 years), the demangler
- // does leak. But, we can't do much about it, and it's not a disaste=
r,
- // so we just let it slide without aborting or telling the user.
-
- VGP_POPCC(VgpDemangle);
-}
-
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
|