From: Florian Krohm Date: Sun, 15 Sep 2013 10:42:26 +0000 (+0000) Subject: Fix inclusion of header files in coregrind. No pub_tool_*.h should be X-Git-Tag: svn/VALGRIND_3_9_0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c4ba95a2744d6021e22547c0d451c321cb151c2;p=thirdparty%2Fvalgrind.git Fix inclusion of header files in coregrind. No pub_tool_*.h should be included here. Added pub_core_poolalloc.h and renamed pub_tool_inner.h to pub_core_inner.h. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13548 --- diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 8d114f1e94..fd84ebc189 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -156,6 +156,7 @@ noinst_HEADERS = \ pub_core_gdbserver.h \ pub_core_hashtable.h \ pub_core_initimg.h \ + pub_core_inner.h \ pub_core_libcbase.h \ pub_core_libcassert.h \ pub_core_libcfile.h \ @@ -169,6 +170,7 @@ noinst_HEADERS = \ pub_core_options.h \ pub_core_oset.h \ pub_core_redir.h \ + pub_core_poolalloc.h \ pub_core_replacemalloc.h\ pub_core_sbprofile.h \ pub_core_scheduler.h \ diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c index 8bb37799af..d058099954 100644 --- a/coregrind/m_debuginfo/image.c +++ b/coregrind/m_debuginfo/image.c @@ -39,11 +39,11 @@ #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" /* VG_(read_millisecond_timer) */ #include "pub_core_libcfile.h" #include "priv_misc.h" /* dinfo_zalloc/free/strdup */ #include "priv_image.h" /* self */ -#include "pub_tool_libcproc.h" // RMME #include "minilzo.h" #define CACHE_ENTRY_SIZE_BITS (12+1) diff --git a/coregrind/m_gdbserver/m_gdbserver.c b/coregrind/m_gdbserver/m_gdbserver.c index 44a9990e0b..b367570439 100644 --- a/coregrind/m_gdbserver/m_gdbserver.c +++ b/coregrind/m_gdbserver/m_gdbserver.c @@ -33,21 +33,21 @@ #include "pub_core_libcproc.h" #include "pub_core_libcprint.h" #include "pub_core_mallocfree.h" -#include "pub_tool_libcsetjmp.h" +#include "pub_core_libcsetjmp.h" #include "pub_core_threadstate.h" #include "pub_core_gdbserver.h" #include "pub_core_options.h" #include "pub_core_libcsetjmp.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" -#include "pub_tool_hashtable.h" -#include "pub_tool_xarray.h" +#include "pub_core_hashtable.h" +#include "pub_core_xarray.h" #include "pub_core_libcassert.h" -#include "pub_tool_libcbase.h" +#include "pub_core_libcbase.h" #include "pub_core_libcsignal.h" #include "pub_core_signals.h" -#include "pub_tool_machine.h" // VG_(fnptr_to_fnentry) -#include "pub_tool_debuginfo.h" +#include "pub_core_machine.h" // VG_(fnptr_to_fnentry) +#include "pub_core_debuginfo.h" #include "pub_core_scheduler.h" #include "pub_core_syswrap.h" diff --git a/coregrind/m_gdbserver/server.h b/coregrind/m_gdbserver/server.h index 655a2abbba..41c9adb0f9 100644 --- a/coregrind/m_gdbserver/server.h +++ b/coregrind/m_gdbserver/server.h @@ -35,16 +35,16 @@ #include "pub_core_libcprint.h" #include "pub_core_mallocfree.h" #include "pub_core_syscall.h" -#include "pub_tool_libcproc.h" +#include "pub_core_libcproc.h" #include "pub_core_tooliface.h" -#include "pub_tool_libcassert.h" -#include "pub_tool_libcbase.h" -#include "pub_tool_options.h" -#include "pub_tool_libcsetjmp.h" +#include "pub_core_libcassert.h" +#include "pub_core_libcbase.h" +#include "pub_core_options.h" +#include "pub_core_libcsetjmp.h" #include "pub_core_threadstate.h" #include "pub_core_gdbserver.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_vki.h" +#include "pub_core_vki.h" #include "valgrind.h" /*------------- interface m_gdbserver <=> low level gdbserver */ diff --git a/coregrind/m_gdbserver/target.c b/coregrind/m_gdbserver/target.c index 72cf24243c..eef80eb9b5 100644 --- a/coregrind/m_gdbserver/target.c +++ b/coregrind/m_gdbserver/target.c @@ -29,11 +29,11 @@ #include "valgrind_low.h" #include "gdb/signals.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" #include "pub_core_gdbserver.h" -#include "pub_tool_debuginfo.h" +#include "pub_core_debuginfo.h" /* the_low_target defines the architecture specific aspects depending diff --git a/coregrind/m_gdbserver/valgrind-low-arm.c b/coregrind/m_gdbserver/valgrind-low-arm.c index b14084a2bc..d95f2d33ce 100644 --- a/coregrind/m_gdbserver/valgrind-low-arm.c +++ b/coregrind/m_gdbserver/valgrind-low-arm.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" #include "pub_core_gdbserver.h" diff --git a/coregrind/m_gdbserver/valgrind-low-mips32.c b/coregrind/m_gdbserver/valgrind-low-mips32.c index e0aaa7b32c..47adf4edd0 100644 --- a/coregrind/m_gdbserver/valgrind-low-mips32.c +++ b/coregrind/m_gdbserver/valgrind-low-mips32.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_debuginfo.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" diff --git a/coregrind/m_gdbserver/valgrind-low-mips64.c b/coregrind/m_gdbserver/valgrind-low-mips64.c index 092c3cbfc4..b1f3bbd460 100644 --- a/coregrind/m_gdbserver/valgrind-low-mips64.c +++ b/coregrind/m_gdbserver/valgrind-low-mips64.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_debuginfo.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" diff --git a/coregrind/m_gdbserver/valgrind-low-ppc32.c b/coregrind/m_gdbserver/valgrind-low-ppc32.c index ba4ae8fc4c..592e25b75e 100644 --- a/coregrind/m_gdbserver/valgrind-low-ppc32.c +++ b/coregrind/m_gdbserver/valgrind-low-ppc32.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" #include "pub_core_gdbserver.h" diff --git a/coregrind/m_gdbserver/valgrind-low-ppc64.c b/coregrind/m_gdbserver/valgrind-low-ppc64.c index a516d209b7..fa146c15f9 100644 --- a/coregrind/m_gdbserver/valgrind-low-ppc64.c +++ b/coregrind/m_gdbserver/valgrind-low-ppc64.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" #include "pub_core_gdbserver.h" diff --git a/coregrind/m_gdbserver/valgrind-low-s390x.c b/coregrind/m_gdbserver/valgrind-low-s390x.c index 6909e4c9c4..b06b920280 100644 --- a/coregrind/m_gdbserver/valgrind-low-s390x.c +++ b/coregrind/m_gdbserver/valgrind-low-s390x.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" #include "pub_core_gdbserver.h" diff --git a/coregrind/m_gdbserver/valgrind-low-x86.c b/coregrind/m_gdbserver/valgrind-low-x86.c index fc533f7f87..f2715a0edc 100644 --- a/coregrind/m_gdbserver/valgrind-low-x86.c +++ b/coregrind/m_gdbserver/valgrind-low-x86.c @@ -27,7 +27,7 @@ #include "regcache.h" #include "pub_core_aspacemgr.h" -#include "pub_tool_machine.h" +#include "pub_core_machine.h" #include "pub_core_threadstate.h" #include "pub_core_transtab.h" #include "pub_core_gdbserver.h" diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index 8c887e3fdd..ecffc83565 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -31,7 +31,7 @@ #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_debuglog.h" -#include "pub_tool_gdbserver.h" // VG_(gdb_printf) +#include "pub_core_gdbserver.h" // VG_(gdb_printf) #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcfile.h" // VG_(write)(), VG_(write_socket)() diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index 2f9869dc35..c288ab1d7b 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -445,7 +445,7 @@ Int VG_(machine_arm_archlevel) = 4; testing, so we need a VG_MINIMAL_JMP_BUF. */ #if defined(VGA_ppc32) || defined(VGA_ppc64) \ || defined(VGA_arm) || defined(VGA_s390x) || defined(VGA_mips32) -#include "pub_tool_libcsetjmp.h" +#include "pub_core_libcsetjmp.h" static VG_MINIMAL_JMP_BUF(env_unsup_insn); static void handler_unsup_insn ( Int x ) { VG_MINIMAL_LONGJMP(env_unsup_insn); diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 8953af1a0c..65fe23d35d 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -66,7 +66,7 @@ #include "pub_core_translate.h" // For VG_(translate) #include "pub_core_trampoline.h" #include "pub_core_transtab.h" -#include "pub_tool_inner.h" +#include "pub_core_inner.h" #if defined(ENABLE_INNER_CLIENT_REQUEST) #include "valgrind.h" #endif diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 013f89fafe..69666bf0eb 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -43,7 +43,7 @@ #include "pub_core_transtab.h" #include "pub_core_tooliface.h" -#include "pub_tool_inner.h" +#include "pub_core_inner.h" #if defined(ENABLE_INNER_CLIENT_REQUEST) #include "memcheck/memcheck.h" #endif diff --git a/coregrind/m_oset.c b/coregrind/m_oset.c index a2ad7d97f3..710958ec44 100644 --- a/coregrind/m_oset.c +++ b/coregrind/m_oset.c @@ -80,7 +80,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" #include "pub_core_oset.h" -#include "pub_tool_poolalloc.h" +#include "pub_core_poolalloc.h" /*--------------------------------------------------------------------*/ /*--- Types and constants ---*/ diff --git a/coregrind/m_poolalloc.c b/coregrind/m_poolalloc.c index e3b07fcf00..ee8f55fe6b 100644 --- a/coregrind/m_poolalloc.c +++ b/coregrind/m_poolalloc.c @@ -29,8 +29,8 @@ #include "pub_core_basics.h" #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" -#include "pub_tool_xarray.h" -#include "pub_tool_poolalloc.h" /* self */ +#include "pub_core_xarray.h" +#include "pub_core_poolalloc.h" /* self */ struct _PoolAlloc { UWord nrRef; /* nr reference to this pool allocator */ diff --git a/coregrind/m_scheduler/sched-lock-generic.c b/coregrind/m_scheduler/sched-lock-generic.c index 8fcdd7fae6..41f01a7abb 100644 --- a/coregrind/m_scheduler/sched-lock-generic.c +++ b/coregrind/m_scheduler/sched-lock-generic.c @@ -32,7 +32,7 @@ */ #include "pub_core_basics.h" -#include "pub_tool_mallocfree.h" +#include "pub_core_mallocfree.h" #include "priv_sema.h" #include "priv_sched-lock.h" #include "priv_sched-lock-impl.h" diff --git a/coregrind/m_scheduler/sched-lock.c b/coregrind/m_scheduler/sched-lock.c index 71bc559733..dbd9ba563a 100644 --- a/coregrind/m_scheduler/sched-lock.c +++ b/coregrind/m_scheduler/sched-lock.c @@ -29,8 +29,8 @@ #include "config.h" #include "pub_core_basics.h" -#include "pub_tool_libcbase.h" -#include "pub_tool_mallocfree.h" +#include "pub_core_libcbase.h" +#include "pub_core_mallocfree.h" #include "priv_sema.h" #include "priv_sched-lock.h" #include "priv_sched-lock-impl.h" diff --git a/coregrind/m_scheduler/sema.c b/coregrind/m_scheduler/sema.c index 2cb51d9df5..bbfde8659b 100644 --- a/coregrind/m_scheduler/sema.c +++ b/coregrind/m_scheduler/sema.c @@ -34,7 +34,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcfile.h" #include "pub_core_libcproc.h" // For VG_(gettid)() -#include "pub_tool_inner.h" +#include "pub_core_inner.h" #if defined(ENABLE_INNER_CLIENT_REQUEST) #include "helgrind/helgrind.h" #endif diff --git a/coregrind/m_scheduler/ticket-lock-linux.c b/coregrind/m_scheduler/ticket-lock-linux.c index 477b6a885a..d0bc59ead8 100644 --- a/coregrind/m_scheduler/ticket-lock-linux.c +++ b/coregrind/m_scheduler/ticket-lock-linux.c @@ -41,10 +41,10 @@ #include "pub_core_syscall.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" // __NR_futex -#include "pub_tool_libcproc.h" -#include "pub_tool_mallocfree.h" -#include "pub_tool_threadstate.h" -#include "pub_tool_inner.h" +#include "pub_core_libcproc.h" +#include "pub_core_mallocfree.h" +#include "pub_core_threadstate.h" +#include "pub_core_inner.h" #if defined(ENABLE_INNER_CLIENT_REQUEST) #include "helgrind/helgrind.h" #endif diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index cd19efbcfa..34dad5abf9 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -43,7 +43,7 @@ #include "pub_core_clientstate.h" // VG_(brk_base), VG_(brk_limit) #include "pub_core_debuglog.h" #include "pub_core_errormgr.h" -#include "pub_tool_gdbserver.h" // VG_(gdbserver) +#include "pub_core_gdbserver.h" // VG_(gdbserver) #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcfile.h" diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 9201aa6c38..1db46e0ad8 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -55,7 +55,7 @@ #include "pub_core_signals.h" #include "pub_core_syscall.h" #include "pub_core_syswrap.h" -#include "pub_tool_inner.h" +#include "pub_core_inner.h" #if defined(ENABLE_INNER_CLIENT_REQUEST) #include "valgrind.h" #endif diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 038d73258c..be879383c7 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -59,7 +59,7 @@ #include "pub_core_xarray.h" #include "pub_core_clientstate.h" // VG_(brk_base), VG_(brk_limit) #include "pub_core_errormgr.h" -#include "pub_tool_gdbserver.h" // VG_(gdbserver) +#include "pub_coretool_gdbserver.h" // VG_(gdbserver) #include "pub_core_libcfile.h" #include "pub_core_machine.h" // VG_(get_SP) #include "pub_core_mallocfree.h" diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index 2c1c47d8e7..9452f516ab 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -59,7 +59,7 @@ #include "pub_core_xarray.h" #include "pub_core_clientstate.h" /* VG_(brk_base), VG_(brk_limit) */ #include "pub_core_errormgr.h" -#include "pub_tool_gdbserver.h" /* VG_(gdbserver) */ +#include "pub_core_gdbserver.h" /* VG_(gdbserver) */ #include "pub_core_libcfile.h" #include "pub_core_machine.h" /* VG_(get_SP) */ #include "pub_core_mallocfree.h" diff --git a/coregrind/m_threadstate.c b/coregrind/m_threadstate.c index 3cd9478fa2..4d66836948 100644 --- a/coregrind/m_threadstate.c +++ b/coregrind/m_threadstate.c @@ -33,7 +33,7 @@ #include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy #include "pub_core_threadstate.h" #include "pub_core_libcassert.h" -#include "pub_tool_inner.h" +#include "pub_core_inner.h" #if defined(ENABLE_INNER_CLIENT_REQUEST) #include "helgrind/helgrind.h" #endif diff --git a/coregrind/pub_core_debuglog.h b/coregrind/pub_core_debuglog.h index c49f8ae349..efb9416738 100644 --- a/coregrind/pub_core_debuglog.h +++ b/coregrind/pub_core_debuglog.h @@ -47,7 +47,7 @@ portable way to avoid using stdarg.h. */ #include -#include "pub_tool_basics.h" /* For definition of VG_ macro */ +#include "pub_core_basics.h" /* For definition of VG_ macro */ /* There are no tool-visible exports from m_debuglog, hence no header file for it. */ diff --git a/coregrind/pub_core_gdbserver.h b/coregrind/pub_core_gdbserver.h index 9cb06c9905..08f34e949d 100644 --- a/coregrind/pub_core_gdbserver.h +++ b/coregrind/pub_core_gdbserver.h @@ -31,6 +31,7 @@ #define __PUB_CORE_GDBSERVER_H #include "pub_tool_gdbserver.h" +#include "pub_core_threadstate.h" // VgSchedReturnCode /* Return the path prefix for the named pipes (FIFOs) used by vgdb/gdb to communicate with valgrind */ diff --git a/include/pub_tool_inner.h b/coregrind/pub_core_inner.h similarity index 94% rename from include/pub_tool_inner.h rename to coregrind/pub_core_inner.h index 88c9b355bc..8998a65cb3 100644 --- a/include/pub_tool_inner.h +++ b/coregrind/pub_core_inner.h @@ -1,6 +1,6 @@ /*--------------------------------------------------------------------*/ -/*--- Utilities for inner Valgrind pub_tool_inner.h ---*/ +/*--- Utilities for inner Valgrind pub_core_inner.h ---*/ /*--------------------------------------------------------------------*/ /* @@ -28,8 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ -#ifndef __PUB_TOOL_INNER_H -#define __PUB_TOOL_INNER_H +#ifndef __PUB_CORE_INNER_H +#define __PUB_CORE_INNER_H //-------------------------------------------------------------------- // PURPOSE: This header should be imported by every file in Valgrind @@ -65,7 +65,7 @@ #endif -#endif // __PUB_TOOL_INNER_H +#endif // __PUB_CORE_INNER_H /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/pub_core_poolalloc.h b/coregrind/pub_core_poolalloc.h new file mode 100644 index 0000000000..c8127e6a73 --- /dev/null +++ b/coregrind/pub_core_poolalloc.h @@ -0,0 +1,42 @@ + +/*--------------------------------------------------------------------*/ +/*--- A simple pool (memory) allocator. pub_core_poolalloc.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2013-2013 Florian Krohm florian@eich-krohm.de + + 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_POOLALLOC_H +#define __PUB_CORE_POOLALLOC_H + +#include "pub_tool_poolalloc.h" + +// No core-only exports; everything in this module is visible to both +// the core and tools. + +#endif // __PUB_CORE_POOLALLOC_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/pub_core_threadstate.h b/coregrind/pub_core_threadstate.h index 7e7fa874db..6f25ec9d2c 100644 --- a/coregrind/pub_core_threadstate.h +++ b/coregrind/pub_core_threadstate.h @@ -40,6 +40,7 @@ //-------------------------------------------------------------------- #include "pub_tool_threadstate.h" +#include "pub_core_libcsetjmp.h" // VG_MINIMAL_JMP_BUF /*------------------------------------------------------------*/ /*--- Types ---*/ diff --git a/include/Makefile.am b/include/Makefile.am index c584283ab8..47f4c9af4d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -14,7 +14,6 @@ nobase_pkginclude_HEADERS = \ pub_tool_gdbserver.h \ pub_tool_poolalloc.h \ pub_tool_hashtable.h \ - pub_tool_inner.h \ pub_tool_libcbase.h \ pub_tool_libcassert.h \ pub_tool_libcfile.h \