aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2013-09-15 13:54:34 +0000
committerflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2013-09-15 13:54:34 +0000
commit535fb1b49a80f2e880f755ee618381de3e222ddf (patch)
tree4f52ffa70ed0878c655f4655a9311ee033ae94d0
parentc91f58449e6fc2a4ce0851639a342c4277612fbb (diff)
downloadvalgrind-535fb1b49a80f2e880f755ee618381de3e222ddf.tar.gz
Fix coregrind header files such that they can be included without
having to worry what other header files may have to be included beforehand. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13549 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r--coregrind/m_debuginfo/priv_d3basics.h2
-rw-r--r--coregrind/m_debuginfo/priv_image.h7
-rw-r--r--coregrind/m_debuginfo/priv_misc.h1
-rw-r--r--coregrind/m_debuginfo/priv_readdwarf.h9
-rw-r--r--coregrind/m_debuginfo/priv_readdwarf3.h4
-rw-r--r--coregrind/m_debuginfo/priv_readelf.h5
-rw-r--r--coregrind/m_debuginfo/priv_readmacho.h5
-rw-r--r--coregrind/m_debuginfo/priv_readpdb.h3
-rw-r--r--coregrind/m_debuginfo/priv_readstabs.h5
-rw-r--r--coregrind/m_debuginfo/priv_storage.h5
-rw-r--r--coregrind/m_debuginfo/priv_tytypes.h4
-rw-r--r--coregrind/m_gdbserver/regcache.h2
-rw-r--r--coregrind/m_gdbserver/target.h3
-rw-r--r--coregrind/m_gdbserver/valgrind_low.h3
-rw-r--r--coregrind/m_initimg/priv_initimg_pathscan.h2
-rw-r--r--coregrind/m_scheduler/priv_sched-lock-impl.h2
-rw-r--r--coregrind/m_scheduler/priv_sched-lock.h2
-rw-r--r--coregrind/m_scheduler/priv_sema.h2
-rw-r--r--coregrind/m_syswrap/priv_syswrap-darwin.h3
-rw-r--r--coregrind/m_syswrap/priv_syswrap-generic.h4
-rw-r--r--coregrind/m_syswrap/priv_syswrap-linux-variants.h3
-rw-r--r--coregrind/m_syswrap/priv_syswrap-linux.h3
-rw-r--r--coregrind/m_syswrap/priv_syswrap-main.h3
-rw-r--r--coregrind/m_syswrap/priv_syswrap-xen.h2
-rw-r--r--coregrind/m_syswrap/priv_types_n_macros.h2
-rw-r--r--coregrind/m_ume/priv_ume.h2
-rw-r--r--coregrind/pub_core_commandline.h1
-rw-r--r--coregrind/pub_core_coredump.h3
-rw-r--r--coregrind/pub_core_cpuid.h2
-rw-r--r--coregrind/pub_core_debugger.h2
-rw-r--r--coregrind/pub_core_demangle.h2
-rw-r--r--coregrind/pub_core_dispatch.h1
-rw-r--r--coregrind/pub_core_initimg.h1
-rw-r--r--coregrind/pub_core_libcassert.h1
-rw-r--r--coregrind/pub_core_machine.h1
-rw-r--r--coregrind/pub_core_redir.h3
-rw-r--r--coregrind/pub_core_replacemalloc.h1
-rw-r--r--coregrind/pub_core_sbprofile.h2
-rw-r--r--coregrind/pub_core_scheduler.h3
-rw-r--r--coregrind/pub_core_sigframe.h7
-rw-r--r--coregrind/pub_core_signals.h1
-rw-r--r--coregrind/pub_core_stacks.h2
-rw-r--r--coregrind/pub_core_stacktrace.h1
-rw-r--r--coregrind/pub_core_syscall.h2
-rw-r--r--coregrind/pub_core_syswrap.h3
-rw-r--r--coregrind/pub_core_threadstate.h1
-rw-r--r--coregrind/pub_core_trampoline.h2
-rw-r--r--coregrind/pub_core_translate.h2
-rw-r--r--coregrind/pub_core_ume.h2
-rw-r--r--coregrind/pub_core_vki.h1
-rw-r--r--include/pub_tool_aspacehl.h2
-rw-r--r--include/pub_tool_aspacemgr.h1
-rw-r--r--include/pub_tool_clientstate.h3
-rw-r--r--include/pub_tool_debuginfo.h2
-rw-r--r--include/pub_tool_execontext.h2
-rw-r--r--include/pub_tool_gdbserver.h1
-rw-r--r--include/pub_tool_hashtable.h2
-rw-r--r--include/pub_tool_libcassert.h2
-rw-r--r--include/pub_tool_libcbase.h2
-rw-r--r--include/pub_tool_libcfile.h3
-rw-r--r--include/pub_tool_libcprint.h2
-rw-r--r--include/pub_tool_libcproc.h3
-rw-r--r--include/pub_tool_libcsetjmp.h2
-rw-r--r--include/pub_tool_libcsignal.h3
-rw-r--r--include/pub_tool_machine.h1
-rw-r--r--include/pub_tool_mallocfree.h2
-rw-r--r--include/pub_tool_options.h1
-rw-r--r--include/pub_tool_oset.h2
-rw-r--r--include/pub_tool_poolalloc.h2
-rw-r--r--include/pub_tool_replacemalloc.h2
-rw-r--r--include/pub_tool_seqmatch.h2
-rw-r--r--include/pub_tool_signals.h2
-rw-r--r--include/pub_tool_sparsewa.h2
-rw-r--r--include/pub_tool_stacktrace.h2
-rw-r--r--include/pub_tool_threadstate.h2
-rw-r--r--include/pub_tool_vkiscnums.h1
-rw-r--r--include/pub_tool_wordfm.h2
-rw-r--r--include/pub_tool_xarray.h2
78 files changed, 172 insertions, 18 deletions
diff --git a/coregrind/m_debuginfo/priv_d3basics.h b/coregrind/m_debuginfo/priv_d3basics.h
index 61acc7156..1dd171c96 100644
--- a/coregrind/m_debuginfo/priv_d3basics.h
+++ b/coregrind/m_debuginfo/priv_d3basics.h
@@ -38,6 +38,8 @@
#ifndef __PRIV_D3BASICS_H
#define __PRIV_D3BASICS_H
+#include "pub_core_basics.h" // Addr
+#include "pub_core_debuginfo.h" // DebugInfo
/* This stuff is taken from gdb-6.6/include/elf/dwarf2.h, which is
GPL2+.
diff --git a/coregrind/m_debuginfo/priv_image.h b/coregrind/m_debuginfo/priv_image.h
index 083f0797f..169f3442f 100644
--- a/coregrind/m_debuginfo/priv_image.h
+++ b/coregrind/m_debuginfo/priv_image.h
@@ -30,6 +30,11 @@
/* Contributed by Julian Seward <jseward@acm.org> */
+#ifndef __PRIV_IMAGE_H
+#define __PRIV_IMAGE_H
+
+#include "pub_core_basics.h" // ULong
+#include "priv_misc.h" // ML_(dinfo_zalloc)
/*------------------------------------------------------------*/
/*--- DiImage -- abstract images ---*/
@@ -339,7 +344,7 @@ static inline Addr ML_(cur_step_Addr) ( DiCursor* c ) {
}
}
-
+#endif /* ndef __PRIV_IMAGE_H */
/*--------------------------------------------------------------------*/
/*--- end priv_image.h ---*/
diff --git a/coregrind/m_debuginfo/priv_misc.h b/coregrind/m_debuginfo/priv_misc.h
index ea871dd88..101d230db 100644
--- a/coregrind/m_debuginfo/priv_misc.h
+++ b/coregrind/m_debuginfo/priv_misc.h
@@ -36,6 +36,7 @@
#ifndef __PRIV_MISC_H
#define __PRIV_MISC_H
+#include "pub_core_basics.h" // SizeT
/* Allocate(zeroed), free, strdup, memdup, all in VG_AR_DINFO. */
void* ML_(dinfo_zalloc)( const HChar* cc, SizeT szB );
diff --git a/coregrind/m_debuginfo/priv_readdwarf.h b/coregrind/m_debuginfo/priv_readdwarf.h
index a8c6fdbeb..5b14480e2 100644
--- a/coregrind/m_debuginfo/priv_readdwarf.h
+++ b/coregrind/m_debuginfo/priv_readdwarf.h
@@ -31,6 +31,9 @@
#ifndef __PRIV_READDWARF_H
#define __PRIV_READDWARF_H
+#include "pub_core_debuginfo.h" // DebugInfo
+#include "priv_image.h" // DiSlice
+
/*
Stabs reader greatly improved by Nick Nethercote, Apr 02.
This module was also extensively hacked on by Jeremy Fitzhardinge
@@ -43,7 +46,7 @@
-------------------- */
extern
void ML_(read_debuginfo_dwarf3)
- ( struct _DebugInfo* di,
+ ( DebugInfo* di,
DiSlice escn_debug_info, /* .debug_info */
DiSlice escn_debug_types, /* .debug_types */
DiSlice escn_debug_abbv, /* .debug_abbrev */
@@ -55,7 +58,7 @@ void ML_(read_debuginfo_dwarf3)
DWARF1 reader
-------------------- */
extern
-void ML_(read_debuginfo_dwarf1) ( struct _DebugInfo* di,
+void ML_(read_debuginfo_dwarf1) ( DebugInfo* di,
UChar* dwarf1d, Int dwarf1d_sz,
UChar* dwarf1l, Int dwarf1l_sz );
@@ -64,7 +67,7 @@ void ML_(read_debuginfo_dwarf1) ( struct _DebugInfo* di,
-------------------- */
extern
void ML_(read_callframe_info_dwarf3)
- ( /*OUT*/struct _DebugInfo* di,
+ ( /*OUT*/ DebugInfo* di,
DiSlice escn_frame, Addr frame_avma, Bool is_ehframe );
diff --git a/coregrind/m_debuginfo/priv_readdwarf3.h b/coregrind/m_debuginfo/priv_readdwarf3.h
index 7cba4e223..5e038a1e8 100644
--- a/coregrind/m_debuginfo/priv_readdwarf3.h
+++ b/coregrind/m_debuginfo/priv_readdwarf3.h
@@ -37,11 +37,13 @@
#ifndef __PRIV_READDWARF3_H
#define __PRIV_READDWARF3_H
+#include "pub_core_debuginfo.h" // DebugInfo
+#include "priv_image.h" // DiSlice
/* Read variables and types from DWARF3 ".debug_info" sections. */
void
ML_(new_dwarf3_reader) (
- struct _DebugInfo* di,
+ DebugInfo* di,
DiSlice escn_debug_info, DiSlice escn_debug_types,
DiSlice escn_debug_abbv, DiSlice escn_debug_line,
DiSlice escn_debug_str, DiSlice escn_debug_ranges,
diff --git a/coregrind/m_debuginfo/priv_readelf.h b/coregrind/m_debuginfo/priv_readelf.h
index a78cbb933..d5a2a1cbd 100644
--- a/coregrind/m_debuginfo/priv_readelf.h
+++ b/coregrind/m_debuginfo/priv_readelf.h
@@ -32,6 +32,9 @@
#ifndef __PRIV_READELF_H
#define __PRIV_READELF_H
+#include "pub_core_basics.h" // SizeT
+#include "pub_core_debuginfo.h" // DebugInfo
+
/*
Stabs reader greatly improved by Nick Nethercote, Apr 02.
This module was also extensively hacked on by Jeremy Fitzhardinge
@@ -48,7 +51,7 @@ extern Bool ML_(is_elf_object_file)( void* image, SizeT n_image, Bool rel_ok );
info) and anything else we want, into the tables within the
supplied SegInfo.
*/
-extern Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di );
+extern Bool ML_(read_elf_debug_info) ( DebugInfo* di );
#endif /* ndef __PRIV_READELF_H */
diff --git a/coregrind/m_debuginfo/priv_readmacho.h b/coregrind/m_debuginfo/priv_readmacho.h
index e9da383a7..c5697cb4f 100644
--- a/coregrind/m_debuginfo/priv_readmacho.h
+++ b/coregrind/m_debuginfo/priv_readmacho.h
@@ -32,6 +32,9 @@
#ifndef __PRIV_READMACHO_H
#define __PRIV_READMACHO_H
+#include "pub_core_basics.h" // SizeT
+#include "pub_core_debuginfo.h" // DebugInfo
+
/* Identify a Mach-O object file by peering at the first few bytes of
it. */
extern Bool ML_(is_macho_object_file)( const void* buf, SizeT size );
@@ -42,7 +45,7 @@ extern Bool ML_(is_macho_object_file)( const void* buf, SizeT size );
info) and anything else we want, into the tables within the
supplied DebugInfo.
*/
-extern Bool ML_(read_macho_debug_info) ( struct _DebugInfo* si );
+extern Bool ML_(read_macho_debug_info) ( DebugInfo* si );
#endif /* ndef __PRIV_READMACHO_H */
diff --git a/coregrind/m_debuginfo/priv_readpdb.h b/coregrind/m_debuginfo/priv_readpdb.h
index 328e5f0ba..5baeff63c 100644
--- a/coregrind/m_debuginfo/priv_readpdb.h
+++ b/coregrind/m_debuginfo/priv_readpdb.h
@@ -37,6 +37,9 @@
#ifndef __PRIV_READPDB_H
#define __PRIV_READPDB_H
+#include "pub_core_basics.h" // Addr
+#include "pub_core_debuginfo.h" // DebugInfo
+
/* Returns True if OK, False for any kind of failure. */
extern Bool ML_(read_pdb_debug_info)(
DebugInfo* di,
diff --git a/coregrind/m_debuginfo/priv_readstabs.h b/coregrind/m_debuginfo/priv_readstabs.h
index f0e657dda..5b35d09bf 100644
--- a/coregrind/m_debuginfo/priv_readstabs.h
+++ b/coregrind/m_debuginfo/priv_readstabs.h
@@ -31,6 +31,9 @@
#ifndef __PRIV_READSTABS_H
#define __PRIV_READSTABS_H
+#include "pub_core_basics.h" // UChar
+#include "pub_core_debuginfo.h" // DebugInfo
+
/*
Stabs reader greatly improved by Nick Nethercote, Apr 02.
This module was also extensively hacked on by Jeremy Fitzhardinge
@@ -41,7 +44,7 @@
Stabs reader
-------------------- */
extern
-void ML_(read_debuginfo_stabs) ( struct _DebugInfo* di,
+void ML_(read_debuginfo_stabs) ( DebugInfo* di,
UChar* stabC, Int stab_sz,
HChar* stabstr, Int stabstr_sz );
diff --git a/coregrind/m_debuginfo/priv_storage.h b/coregrind/m_debuginfo/priv_storage.h
index 662837378..36c93935b 100644
--- a/coregrind/m_debuginfo/priv_storage.h
+++ b/coregrind/m_debuginfo/priv_storage.h
@@ -43,6 +43,11 @@
#ifndef __PRIV_STORAGE_H
#define __PRIV_STORAGE_H
+#include "pub_core_basics.h" // Addr
+#include "pub_core_xarray.h" // XArray
+#include "priv_d3basics.h" // GExpr et al.
+#include "priv_image.h" // DiCursor
+
/* --------------------- SYMBOLS --------------------- */
/* A structure to hold an ELF/MachO symbol (very crudely). Usually
diff --git a/coregrind/m_debuginfo/priv_tytypes.h b/coregrind/m_debuginfo/priv_tytypes.h
index 5a208b4c1..5d4dc0c7e 100644
--- a/coregrind/m_debuginfo/priv_tytypes.h
+++ b/coregrind/m_debuginfo/priv_tytypes.h
@@ -36,6 +36,10 @@
#ifndef __PRIV_TYTYPES_H
#define __PRIV_TYTYPES_H
+#include "pub_core_basics.h" // UWord
+#include "pub_core_xarray.h" // XArray
+#include "priv_misc.h" // MaybeULong
+
typedef
enum {
Te_EMPTY=10, /* empty (contains no info) */
diff --git a/coregrind/m_gdbserver/regcache.h b/coregrind/m_gdbserver/regcache.h
index abd4eb721..cb6fef799 100644
--- a/coregrind/m_gdbserver/regcache.h
+++ b/coregrind/m_gdbserver/regcache.h
@@ -22,6 +22,8 @@
#ifndef REGCACHE_H
#define REGCACHE_H
+#include "pub_core_basics.h" // Bool
+
struct inferior_list_entry;
/* Create a new register cache for INFERIOR. */
diff --git a/coregrind/m_gdbserver/target.h b/coregrind/m_gdbserver/target.h
index 2d4949cb0..2b783ed31 100644
--- a/coregrind/m_gdbserver/target.h
+++ b/coregrind/m_gdbserver/target.h
@@ -26,6 +26,9 @@
#ifndef TARGET_H
#define TARGET_H
+#include "pub_core_basics.h" // Addr
+#include "server.h" // CORE_ADDR
+
/* This file defines the architecture independent Valgrind gdbserver
high level operations such as read memory, get/set registers, ...
diff --git a/coregrind/m_gdbserver/valgrind_low.h b/coregrind/m_gdbserver/valgrind_low.h
index c8d53cbaf..707d43806 100644
--- a/coregrind/m_gdbserver/valgrind_low.h
+++ b/coregrind/m_gdbserver/valgrind_low.h
@@ -26,6 +26,9 @@
#ifndef VALGRIND_LOW_H
#define VALGRIND_LOW_H
+#include "pub_core_basics.h" // ThreadId
+#include "server.h" // CORE_ADDR
+
/* defines the characteristics of the "low" valgrind target architecture.
In other words, struct valgrind_target_ops defines the functions and
data which are specific to the architecture (x86 or amd64 or
diff --git a/coregrind/m_initimg/priv_initimg_pathscan.h b/coregrind/m_initimg/priv_initimg_pathscan.h
index 1afb9a15d..deb015896 100644
--- a/coregrind/m_initimg/priv_initimg_pathscan.h
+++ b/coregrind/m_initimg/priv_initimg_pathscan.h
@@ -32,6 +32,8 @@
#ifndef __PRIV_INITIMG_PATHSCAN_H
#define __PRIV_INITIMG_PATHSCAN_
+#include "pub_core_basics.h" // HChar
+
extern const HChar* ML_(find_executable) ( const HChar* exec );
#endif
diff --git a/coregrind/m_scheduler/priv_sched-lock-impl.h b/coregrind/m_scheduler/priv_sched-lock-impl.h
index efff82e22..e49250ccd 100644
--- a/coregrind/m_scheduler/priv_sched-lock-impl.h
+++ b/coregrind/m_scheduler/priv_sched-lock-impl.h
@@ -32,6 +32,8 @@
#ifndef __PRIV_SCHED_LOCK_IMPL_H
#define __PRIV_SCHED_LOCK_IMPL_H
+#include "pub_core_basics.h" // HChar
+
struct sched_lock_ops {
const HChar *(*get_sched_lock_name)(void);
struct sched_lock *(*create_sched_lock)(void);
diff --git a/coregrind/m_scheduler/priv_sched-lock.h b/coregrind/m_scheduler/priv_sched-lock.h
index a0b348801..a07d83d21 100644
--- a/coregrind/m_scheduler/priv_sched-lock.h
+++ b/coregrind/m_scheduler/priv_sched-lock.h
@@ -32,6 +32,8 @@
#ifndef __PRIV_SCHED_LOCK_H
#define __PRIV_SCHED_LOCK_H
+#include "pub_core_basics.h" // Bool
+
struct sched_lock;
enum SchedLockType { sched_lock_generic, sched_lock_ticket };
diff --git a/coregrind/m_scheduler/priv_sema.h b/coregrind/m_scheduler/priv_sema.h
index d0443226b..1f2f7e955 100644
--- a/coregrind/m_scheduler/priv_sema.h
+++ b/coregrind/m_scheduler/priv_sema.h
@@ -31,6 +31,8 @@
#ifndef __PRIV_SEMA_H
#define __PRIV_SEMA_H
+#include "pub_core_basics.h" // Bool
+
/* Not really a semaphore, but use a pipe for a token-passing scheme */
typedef struct {
Int pipe[2];
diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h
index ec012c081..d0ecd2311 100644
--- a/coregrind/m_syswrap/priv_syswrap-darwin.h
+++ b/coregrind/m_syswrap/priv_syswrap-darwin.h
@@ -31,7 +31,8 @@
#ifndef __PRIV_SYSWRAP_DARWIN_H
#define __PRIV_SYSWRAP_DARWIN_H
-/* requires #include "priv_types_n_macros.h" */
+#include "pub_core_basics.h" // ThreadId
+#include "priv_types_n_macros.h" // DECL_TEMPLATE
// syswrap-darwin.c
Addr allocstack ( ThreadId tid );
diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h
index 0aa02611e..6faf6616e 100644
--- a/coregrind/m_syswrap/priv_syswrap-generic.h
+++ b/coregrind/m_syswrap/priv_syswrap-generic.h
@@ -31,7 +31,9 @@
#ifndef __PRIV_SYSWRAP_GENERIC_H
#define __PRIV_SYSWRAP_GENERIC_H
-/* requires #include "priv_types_n_macros.h" */
+#include "pub_core_basics.h" // ThreadId
+#include "pub_core_vki.h" // vki_msghdr
+#include "priv_types_n_macros.h" // DECL_TEMPLATE
// Return true if address range entirely contained within client
diff --git a/coregrind/m_syswrap/priv_syswrap-linux-variants.h b/coregrind/m_syswrap/priv_syswrap-linux-variants.h
index 047ea131c..6bd0563b2 100644
--- a/coregrind/m_syswrap/priv_syswrap-linux-variants.h
+++ b/coregrind/m_syswrap/priv_syswrap-linux-variants.h
@@ -32,8 +32,7 @@
#ifndef __PRIV_SYSWRAP_LINUX_VARIANTS_H
#define __PRIV_SYSWRAP_LINUX_VARIANTS_H
-/* requires #include "priv_types_n_macros.h" */
-
+#include "pub_core_basics.h" // ThreadId
/* ---------------------------------------------------------------
BProc wrappers
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
index c09dc103a..482891f41 100644
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
@@ -31,7 +31,8 @@
#ifndef __PRIV_SYSWRAP_LINUX_H
#define __PRIV_SYSWRAP_LINUX_H
-/* requires #include "priv_types_n_macros.h" */
+#include "pub_core_basics.h" // ThreadId
+#include "priv_types_n_macros.h" // DECL_TEMPLATE
// Clone-related functions
extern Word ML_(start_thread_NORETURN) ( void* arg );
diff --git a/coregrind/m_syswrap/priv_syswrap-main.h b/coregrind/m_syswrap/priv_syswrap-main.h
index 1fbf8a4c3..46563264b 100644
--- a/coregrind/m_syswrap/priv_syswrap-main.h
+++ b/coregrind/m_syswrap/priv_syswrap-main.h
@@ -31,6 +31,9 @@
#ifndef __PRIV_SYSWRAP_MAIN_H
#define __PRIV_SYSWRAP_MAIN_H
+#include "pub_core_basics.h" // ThreadID
+#include "pub_core_threadstate.h" // ThreadArchState
+
/* Back up a thread so as to restart a system call. */
extern
void ML_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch );
diff --git a/coregrind/m_syswrap/priv_syswrap-xen.h b/coregrind/m_syswrap/priv_syswrap-xen.h
index 4dc4748d8..b17bc862b 100644
--- a/coregrind/m_syswrap/priv_syswrap-xen.h
+++ b/coregrind/m_syswrap/priv_syswrap-xen.h
@@ -1,6 +1,8 @@
#ifndef __PRIV_SYSWRAP_XEN_H
#define __PRIV_SYSWRAP_XEN_H
+#include "priv_types_n_macros.h" // DECL_TEMPLATE
+
DECL_TEMPLATE(xen, hypercall);
#endif // __PRIV_SYSWRAP_XEN_H
diff --git a/coregrind/m_syswrap/priv_types_n_macros.h b/coregrind/m_syswrap/priv_types_n_macros.h
index ce07877da..a37ad6ac9 100644
--- a/coregrind/m_syswrap/priv_types_n_macros.h
+++ b/coregrind/m_syswrap/priv_types_n_macros.h
@@ -32,6 +32,8 @@
#ifndef __PRIV_TYPES_N_MACROS_H
#define __PRIV_TYPES_N_MACROS_H
+#include "pub_core_basics.h" // Addr
+
/* requires #include "pub_core_options.h" */
/* requires #include "pub_core_signals.h" */
diff --git a/coregrind/m_ume/priv_ume.h b/coregrind/m_ume/priv_ume.h
index cba484abe..1b6e56169 100644
--- a/coregrind/m_ume/priv_ume.h
+++ b/coregrind/m_ume/priv_ume.h
@@ -32,6 +32,8 @@
#ifndef __PRIV_UME_H
#define __PRIV_UME_H
+#include "pub_core_ume.h" // ExeInfo
+
extern int VG_(do_exec_inner)(const HChar *exe, ExeInfo *info);
#if defined(VGO_linux)
diff --git a/coregrind/pub_core_commandline.h b/coregrind/pub_core_commandline.h
index 422080cbb..4429b19ba 100644
--- a/coregrind/pub_core_commandline.h
+++ b/coregrind/pub_core_commandline.h
@@ -31,6 +31,7 @@
#ifndef __PUB_CORE_COMMANDLINE_H
#define __PUB_CORE_COMMANDLINE_H
+#include "pub_core_basics.h" // VG_ macro
/* Split up the args presented by the launcher to m_main.main(), and
park them in VG_(args_for_client), VG_(args_for_valgrind) and
diff --git a/coregrind/pub_core_coredump.h b/coregrind/pub_core_coredump.h
index b2caa563d..9d94fbf2e 100644
--- a/coregrind/pub_core_coredump.h
+++ b/coregrind/pub_core_coredump.h
@@ -31,6 +31,9 @@
#ifndef __PUB_CORE_COREDUMP_H
#define __PUB_CORE_COREDUMP_H
+#include "pub_core_basics.h" // ThreadId
+#include "pub_core_vki.h" // vki_siginfo_t
+
//--------------------------------------------------------------------
// PURPOSE: This module produces a core dump when asked.
//--------------------------------------------------------------------
diff --git a/coregrind/pub_core_cpuid.h b/coregrind/pub_core_cpuid.h
index 269ae57df..43f4fd91f 100644
--- a/coregrind/pub_core_cpuid.h
+++ b/coregrind/pub_core_cpuid.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_CPUID_H
#define __PUB_CORE_CPUID_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module provides Valgrind's interface to the x86/amd64
// CPUID instruction.
diff --git a/coregrind/pub_core_debugger.h b/coregrind/pub_core_debugger.h
index c82e60ebc..e55df1a25 100644
--- a/coregrind/pub_core_debugger.h
+++ b/coregrind/pub_core_debugger.h
@@ -36,6 +36,8 @@
// running program.
//--------------------------------------------------------------------
+#include "pub_core_basics.h" // ThreadId
+
extern void VG_(start_debugger) ( ThreadId tid );
#endif // __PUB_CORE_DEBUGGER_H
diff --git a/coregrind/pub_core_demangle.h b/coregrind/pub_core_demangle.h
index 749ede18b..94b3fffa4 100644
--- a/coregrind/pub_core_demangle.h
+++ b/coregrind/pub_core_demangle.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_DEMANGLE_H
#define __PUB_CORE_DEMANGLE_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module exports functions for demangling C++ and
// Z-encoded names.
diff --git a/coregrind/pub_core_dispatch.h b/coregrind/pub_core_dispatch.h
index 8438556a4..bf29e0b46 100644
--- a/coregrind/pub_core_dispatch.h
+++ b/coregrind/pub_core_dispatch.h
@@ -40,6 +40,7 @@
//--------------------------------------------------------------------
#include "pub_core_dispatch_asm.h"
+#include "pub_core_basics.h" // Addr
/* Run translations, with the given guest state, and starting by
running the host code at 'host_addr'. It is almost always the case
diff --git a/coregrind/pub_core_initimg.h b/coregrind/pub_core_initimg.h
index 912eced65..915583c20 100644
--- a/coregrind/pub_core_initimg.h
+++ b/coregrind/pub_core_initimg.h
@@ -32,6 +32,7 @@
#ifndef __PUB_CORE_INITIMG_H
#define __PUB_CORE_INITIMG_H
+#include "pub_core_basics.h" // Addr
//--------------------------------------------------------------------
// PURPOSE: Map the client executable into memory, then set up its
diff --git a/coregrind/pub_core_libcassert.h b/coregrind/pub_core_libcassert.h
index b7880d814..2f7e03ed0 100644
--- a/coregrind/pub_core_libcassert.h
+++ b/coregrind/pub_core_libcassert.h
@@ -37,6 +37,7 @@
//--------------------------------------------------------------------
#include "pub_tool_libcassert.h"
+#include "pub_core_basics.h" // UnwindStartRegs
// Useful for making failing stubs, when certain things haven't yet been
// implemented.
diff --git a/coregrind/pub_core_machine.h b/coregrind/pub_core_machine.h
index 97324a380..5652779f0 100644
--- a/coregrind/pub_core_machine.h
+++ b/coregrind/pub_core_machine.h
@@ -38,6 +38,7 @@
//--------------------------------------------------------------------
#include "pub_tool_machine.h"
+#include "pub_core_basics.h" // UnwindStartRegs
// XXX: this is *really* the wrong spot for these things
#if defined(VGP_x86_linux)
diff --git a/coregrind/pub_core_redir.h b/coregrind/pub_core_redir.h
index 1d7811297..1956a1035 100644
--- a/coregrind/pub_core_redir.h
+++ b/coregrind/pub_core_redir.h
@@ -55,7 +55,8 @@
//--------------------------------------------------------------------
#include "pub_tool_redir.h"
-
+#include "pub_core_basics.h" // Addr
+#include "pub_core_debuginfo.h" // DebugInfo
//--------------------------------------------------------------------
// Notifications - by which we are told of state changes
diff --git a/coregrind/pub_core_replacemalloc.h b/coregrind/pub_core_replacemalloc.h
index e0eabb040..44c0241e5 100644
--- a/coregrind/pub_core_replacemalloc.h
+++ b/coregrind/pub_core_replacemalloc.h
@@ -37,6 +37,7 @@
//--------------------------------------------------------------------
#include "pub_tool_replacemalloc.h"
+#include "pub_core_mallocfree.h" // vg_mallinfo
// things vg_replace_malloc.o needs to know about
struct vg_mallocfunc_info {
diff --git a/coregrind/pub_core_sbprofile.h b/coregrind/pub_core_sbprofile.h
index 4b5845695..d5d61273a 100644
--- a/coregrind/pub_core_sbprofile.h
+++ b/coregrind/pub_core_sbprofile.h
@@ -32,6 +32,8 @@
#ifndef __PUB_CORE_SBPROFILE_H
#define __PUB_CORE_SBPROFILE_H
+#include "pub_core_basics.h" // VG_ macro
+
/* Get and print a profile. Also, zero out the counters so that if we
call it again later, the second call will only show new work done
since the first call. ecs_done == 0 is taken to mean this is a
diff --git a/coregrind/pub_core_scheduler.h b/coregrind/pub_core_scheduler.h
index 60d8c8752..c011312c3 100644
--- a/coregrind/pub_core_scheduler.h
+++ b/coregrind/pub_core_scheduler.h
@@ -31,6 +31,9 @@
#ifndef __PUB_CORE_SCHEDULER_H
#define __PUB_CORE_SCHEDULER_H
+#include "pub_core_basics.h" // VG_ macro
+#include "pub_core_threadstate.h" // VgSchedReturnCode
+
//--------------------------------------------------------------------
// PURPOSE: This module is the scheduler, which is the main loop
// controlling the running of all the program's threads.
diff --git a/coregrind/pub_core_sigframe.h b/coregrind/pub_core_sigframe.h
index 67b864d94..194f666e8 100644
--- a/coregrind/pub_core_sigframe.h
+++ b/coregrind/pub_core_sigframe.h
@@ -32,16 +32,15 @@
#ifndef __PUB_CORE_SIGFRAME_H
#define __PUB_CORE_SIGFRAME_H
+#include "pub_core_basics.h" // VG_ macro
+#include "pub_tool_vki.h" // vki_sigset_t et al.
+
//--------------------------------------------------------------------
// PURPOSE: This module creates and destroys signal delivery frames
// for client threads, saving/restoring the thread CPU state in the
// frame appropriately.
//--------------------------------------------------------------------
-/* There are no tool-visible exports from m_sigframe, hence no header
- file for it. */
-/* #include "pub_tool_sigframe.h" */
-
/* Create a signal frame for thread 'tid'. */
extern
void VG_(sigframe_create) ( ThreadId tid,
diff --git a/coregrind/pub_core_signals.h b/coregrind/pub_core_signals.h
index 0731a4f03..7560f5aee 100644
--- a/coregrind/pub_core_signals.h
+++ b/coregrind/pub_core_signals.h
@@ -36,6 +36,7 @@
//--------------------------------------------------------------------
#include "pub_tool_signals.h" // I want to get rid of this header...
+#include "pub_tool_vki.h" // vki_sigset_t et al.
/* Highest signal the kernel will let us use */
extern Int VG_(max_signal);
diff --git a/coregrind/pub_core_stacks.h b/coregrind/pub_core_stacks.h
index 0a05b5031..4f342f4b1 100644
--- a/coregrind/pub_core_stacks.h
+++ b/coregrind/pub_core_stacks.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_STACKS_H
#define __PUB_CORE_STACKS_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module deals with the registration of stacks for the
// purposes of detecting stack switches.
diff --git a/coregrind/pub_core_stacktrace.h b/coregrind/pub_core_stacktrace.h
index 36c7fd8d8..ace9b58e2 100644
--- a/coregrind/pub_core_stacktrace.h
+++ b/coregrind/pub_core_stacktrace.h
@@ -37,6 +37,7 @@
//--------------------------------------------------------------------
#include "pub_tool_stacktrace.h"
+#include "pub_core_basics.h" // UnwindStartRegs
// Variant that gives a little more control over the stack-walking
// (this is the "worker" function that actually does the walking).
diff --git a/coregrind/pub_core_syscall.h b/coregrind/pub_core_syscall.h
index 1648f8c15..6f2eb08bf 100644
--- a/coregrind/pub_core_syscall.h
+++ b/coregrind/pub_core_syscall.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_SYSCALL_H
#define __PUB_CORE_SYSCALL_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module contains the code for actually executing syscalls.
//--------------------------------------------------------------------
diff --git a/coregrind/pub_core_syswrap.h b/coregrind/pub_core_syswrap.h
index 02cc9b731..890d80ec5 100644
--- a/coregrind/pub_core_syswrap.h
+++ b/coregrind/pub_core_syswrap.h
@@ -31,6 +31,9 @@
#ifndef __PUB_CORE_SYSWRAP_H
#define __PUB_CORE_SYSWRAP_H
+#include "pub_core_basics.h" // VG_ macro
+#include "pub_core_threadstate.h" // ThreadArchState
+
//--------------------------------------------------------------------
// PURPOSE: This module contains all the syscall junk: mostly PRE/POST
// wrappers, but also the main syscall jacketing code.
diff --git a/coregrind/pub_core_threadstate.h b/coregrind/pub_core_threadstate.h
index 6f25ec9d2..54dce4a58 100644
--- a/coregrind/pub_core_threadstate.h
+++ b/coregrind/pub_core_threadstate.h
@@ -41,6 +41,7 @@
#include "pub_tool_threadstate.h"
#include "pub_core_libcsetjmp.h" // VG_MINIMAL_JMP_BUF
+#include "pub_core_vki.h" // vki_sigset_t
/*------------------------------------------------------------*/
/*--- Types ---*/
diff --git a/coregrind/pub_core_trampoline.h b/coregrind/pub_core_trampoline.h
index b536edec1..69f8037ee 100644
--- a/coregrind/pub_core_trampoline.h
+++ b/coregrind/pub_core_trampoline.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_TRAMPOLINE_H
#define __PUB_CORE_TRAMPOLINE_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module defines a few replacement functions for Linux
// vsyscalls, which we can't implement directly. It also contains
diff --git a/coregrind/pub_core_translate.h b/coregrind/pub_core_translate.h
index c399d5886..bdac572d6 100644
--- a/coregrind/pub_core_translate.h
+++ b/coregrind/pub_core_translate.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_TRANSLATE_H
#define __PUB_CORE_TRANSLATE_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module is Valgrind's interface to the JITter. It's
// basically a wrapper around Vex.
diff --git a/coregrind/pub_core_ume.h b/coregrind/pub_core_ume.h
index 2ac460032..2903b590f 100644
--- a/coregrind/pub_core_ume.h
+++ b/coregrind/pub_core_ume.h
@@ -31,6 +31,8 @@
#ifndef __PUB_CORE_UME_H
#define __PUB_CORE_UME_H
+#include "pub_core_basics.h" // VG_ macro
+
//--------------------------------------------------------------------
// PURPOSE: This module implements user-mode execve, ie. program loading
// and exec'ing.
diff --git a/coregrind/pub_core_vki.h b/coregrind/pub_core_vki.h
index 457d0f600..8b849b03e 100644
--- a/coregrind/pub_core_vki.h
+++ b/coregrind/pub_core_vki.h
@@ -42,6 +42,7 @@
that means the only thing to be done here is ... */
#include "pub_tool_vki.h"
+#include "pub_core_basics.h" // VG_ macro
/* Do initial consistency checks on some of the definitions to do with
signals (vki_sigset_t and vki_sigaction_{toK,fromK}_t). This stuff
diff --git a/include/pub_tool_aspacehl.h b/include/pub_tool_aspacehl.h
index 82cebade3..2ec3ccfa5 100644
--- a/include/pub_tool_aspacehl.h
+++ b/include/pub_tool_aspacehl.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_ASPACEHL_H
#define __PUB_TOOL_ASPACEHL_H
+#include "pub_tool_basics.h" // VG_ macro
+
// Extract from aspacem a vector of the current segment start
// addresses. The vector is dynamically allocated and should be freed
// by the caller when done. REQUIRES m_mallocfree to be running.
diff --git a/include/pub_tool_aspacemgr.h b/include/pub_tool_aspacemgr.h
index 3f02cfce2..4924b6142 100644
--- a/include/pub_tool_aspacemgr.h
+++ b/include/pub_tool_aspacemgr.h
@@ -31,6 +31,7 @@
#ifndef __PUB_TOOL_ASPACEMGR_H
#define __PUB_TOOL_ASPACEMGR_H
+#include "pub_tool_basics.h" // VG_ macro
//--------------------------------------------------------------
// Definition of address-space segments
diff --git a/include/pub_tool_clientstate.h b/include/pub_tool_clientstate.h
index d2d8a0672..86d3d4779 100644
--- a/include/pub_tool_clientstate.h
+++ b/include/pub_tool_clientstate.h
@@ -31,6 +31,9 @@
#ifndef __PUB_TOOL_CLIENTSTATE_H
#define __PUB_TOOL_CLIENTSTATE_H
+#include "pub_tool_basics.h" // VG_ macro
+#include "pub_tool_xarray.h" // XArray
+
/* Note, this header requires pub_{core,tool}_xarray.h to be
included ahead of it. */
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
index 2f734c803..9421551cd 100644
--- a/include/pub_tool_debuginfo.h
+++ b/include/pub_tool_debuginfo.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_DEBUGINFO_H
#define __PUB_TOOL_DEBUGINFO_H
+#include "pub_tool_basics.h" // VG_ macro
+
/*====================================================================*/
/*=== Obtaining debug information ===*/
/*====================================================================*/
diff --git a/include/pub_tool_execontext.h b/include/pub_tool_execontext.h
index 66d90a40b..b7932fd81 100644
--- a/include/pub_tool_execontext.h
+++ b/include/pub_tool_execontext.h
@@ -30,6 +30,8 @@
#ifndef __PUB_TOOL_EXECONTEXT_H
#define __PUB_TOOL_EXECONTEXT_H
+#include "pub_tool_basics.h" // ThreadID
+
// It's an abstract type.
typedef
struct _ExeContext
diff --git a/include/pub_tool_gdbserver.h b/include/pub_tool_gdbserver.h
index 6627a2f32..c9890ab2a 100644
--- a/include/pub_tool_gdbserver.h
+++ b/include/pub_tool_gdbserver.h
@@ -30,6 +30,7 @@
#ifndef __PUB_TOOL_GDBSERVER_H
#define __PUB_TOOL_GDBSERVER_H
+#include "pub_tool_basics.h" // VG_ macro
#include "libvex.h"
#include "libvex_ir.h"
diff --git a/include/pub_tool_hashtable.h b/include/pub_tool_hashtable.h
index b8d80f4ed..91fe5f2df 100644
--- a/include/pub_tool_hashtable.h
+++ b/include/pub_tool_hashtable.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_HASHTABLE_H
#define __PUB_TOOL_HASHTABLE_H
+#include "pub_tool_basics.h" // VG_ macro
+
/* Generic type for a separately-chained hash table. Via a kind of dodgy
C-as-C++ style inheritance, tools can extend the VgHashNode type, so long
as the first two fields match the sizes of these two fields. Requires
diff --git a/include/pub_tool_libcassert.h b/include/pub_tool_libcassert.h
index 7a2c5bd3f..f30010438 100644
--- a/include/pub_tool_libcassert.h
+++ b/include/pub_tool_libcassert.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_LIBCBASSERT_H
#define __PUB_TOOL_LIBCBASSERT_H
+#include "pub_tool_basics.h" // VG_ macro
+
#define tl_assert(expr) \
((void) (LIKELY(expr) ? 0 : \
(VG_(assert_fail) (/*isCore?*/False, #expr, \
diff --git a/include/pub_tool_libcbase.h b/include/pub_tool_libcbase.h
index 05d6bfdf1..2800dd6ec 100644
--- a/include/pub_tool_libcbase.h
+++ b/include/pub_tool_libcbase.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_LIBCBASE_H
#define __PUB_TOOL_LIBCBASE_H
+#include "pub_tool_basics.h" // VG_ macro
+
/* ---------------------------------------------------------------------
Char functions.
------------------------------------------------------------------ */
diff --git a/include/pub_tool_libcfile.h b/include/pub_tool_libcfile.h
index 3b4d7cef7..58e0331db 100644
--- a/include/pub_tool_libcfile.h
+++ b/include/pub_tool_libcfile.h
@@ -31,6 +31,9 @@
#ifndef __PUB_TOOL_LIBCFILE_H
#define __PUB_TOOL_LIBCFILE_H
+#include "pub_tool_basics.h" // VG_ macro
+#include "pub_tool_vki.h" // vki_dirent et al.
+
/* ---------------------------------------------------------------------
File-related functions.
------------------------------------------------------------------ */
diff --git a/include/pub_tool_libcprint.h b/include/pub_tool_libcprint.h
index 8536a815b..775e4f573 100644
--- a/include/pub_tool_libcprint.h
+++ b/include/pub_tool_libcprint.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_LIBCPRINT_H
#define __PUB_TOOL_LIBCPRINT_H
+#include "pub_tool_basics.h" // VG_ macro
+
/* ---------------------------------------------------------------------
Formatting functions
------------------------------------------------------------------ */
diff --git a/include/pub_tool_libcproc.h b/include/pub_tool_libcproc.h
index 7432b82ae..d55b9599f 100644
--- a/include/pub_tool_libcproc.h
+++ b/include/pub_tool_libcproc.h
@@ -31,6 +31,9 @@
#ifndef __PUB_TOOL_LIBCPROC_H
#define __PUB_TOOL_LIBCPROC_H
+#include "pub_tool_basics.h" // VG_ macro
+#include "pub_tool_vki.h" // vki_rlimit
+
/* ---------------------------------------------------------------------
Command-line and environment stuff
------------------------------------------------------------------ */
diff --git a/include/pub_tool_libcsetjmp.h b/include/pub_tool_libcsetjmp.h
index cb81e93a4..475d16ec2 100644
--- a/include/pub_tool_libcsetjmp.h
+++ b/include/pub_tool_libcsetjmp.h
@@ -32,6 +32,8 @@
#ifndef __PUB_TOOL_LIBCSETJMP_H
#define __PUB_TOOL_LIBCSETJMP_H
+#include "pub_tool_basics.h" // UWord
+
//--------------------------------------------------------------------
// PURPOSE: Provides a minimal setjmp/longjmp facility, that saves/
// restores integer registers, but not necessarily anything more.
diff --git a/include/pub_tool_libcsignal.h b/include/pub_tool_libcsignal.h
index bc5bc9c45..48794bed5 100644
--- a/include/pub_tool_libcsignal.h
+++ b/include/pub_tool_libcsignal.h
@@ -31,6 +31,9 @@
#ifndef __PUB_TOOL_LIBCBSIGNAL_H
#define __PUB_TOOL_LIBCBSIGNAL_H
+#include "pub_tool_basics.h" // VG_ macro
+#include "pub_tool_vki.h" // vki_sigset
+
/* Note that these use the vki_ (kernel) structure
definitions, which are different in places from those that glibc
defines. Since we're operating right at the kernel interface, glibc's view
diff --git a/include/pub_tool_machine.h b/include/pub_tool_machine.h
index 99aae0317..8029b633c 100644
--- a/include/pub_tool_machine.h
+++ b/include/pub_tool_machine.h
@@ -31,6 +31,7 @@
#ifndef __PUB_TOOL_MACHINE_H
#define __PUB_TOOL_MACHINE_H
+#include "pub_tool_basics.h" // ThreadID
#include "libvex.h" // VexArchInfo
#if defined(VGP_x86_linux)
diff --git a/include/pub_tool_mallocfree.h b/include/pub_tool_mallocfree.h
index c6c37d1e4..e182d1bf5 100644
--- a/include/pub_tool_mallocfree.h
+++ b/include/pub_tool_mallocfree.h
@@ -32,6 +32,8 @@
#ifndef __PUB_TOOL_MALLOCFREE_H
#define __PUB_TOOL_MALLOCFREE_H
+#include "pub_tool_basics.h" // SizeT
+
// These can be for allocating memory used by tools.
// Nb: the allocators *always succeed* -- they never return NULL (Valgrind
// will abort if they can't allocate the memory).
diff --git a/include/pub_tool_options.h b/include/pub_tool_options.h
index ef1371265..08d6dba2d 100644
--- a/include/pub_tool_options.h
+++ b/include/pub_tool_options.h
@@ -31,6 +31,7 @@
#ifndef __PUB_TOOL_OPTIONS_H
#define __PUB_TOOL_OPTIONS_H
+#include "pub_tool_basics.h" // for VG_ macro
#include "libvex.h" // for VexControl
diff --git a/include/pub_tool_oset.h b/include/pub_tool_oset.h
index 9eb789ba7..a22bda6bb 100644
--- a/include/pub_tool_oset.h
+++ b/include/pub_tool_oset.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_OSET_H
#define __PUB_TOOL_OSET_H
+#include "pub_tool_basics.h" // Word
+
// This module implements an ordered set, a data structure with fast
// (eg. amortised log(n) or better) insertion, lookup and deletion of
// elements. It does not allow duplicates, and will assert if you insert a
diff --git a/include/pub_tool_poolalloc.h b/include/pub_tool_poolalloc.h
index 385483ddf..f829f0938 100644
--- a/include/pub_tool_poolalloc.h
+++ b/include/pub_tool_poolalloc.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_POOLALLOC_H
#define __PUB_TOOL_POOLALLOC_H
+#include "pub_tool_basics.h" // UWord
+
//--------------------------------------------------------------------
// PURPOSE: Provides efficient allocation and free of elements of
// the same size.
diff --git a/include/pub_tool_replacemalloc.h b/include/pub_tool_replacemalloc.h
index a44e15623..e0905737b 100644
--- a/include/pub_tool_replacemalloc.h
+++ b/include/pub_tool_replacemalloc.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_REPLACEMALLOC_H
#define __PUB_TOOL_REPLACEMALLOC_H
+#include "pub_tool_basics.h" // Addr
+
/* If a tool replaces malloc() et al, the easiest way to do so is to
link libreplacemalloc_toolpreload.o into its vgpreload_*.so file, and
use the functions declared below. You can do it from scratch,
diff --git a/include/pub_tool_seqmatch.h b/include/pub_tool_seqmatch.h
index 075c74d58..28cae8ae3 100644
--- a/include/pub_tool_seqmatch.h
+++ b/include/pub_tool_seqmatch.h
@@ -32,6 +32,8 @@
#ifndef __PUB_TOOL_SEQMATCH_H
#define __PUB_TOOL_SEQMATCH_H
+#include "pub_tool_basics.h" // UWord
+
/* Perform totally abstractified sequence matching, of an input
sequence against a pattern sequence. The pattern sequence may
include '*' elements (matches any number of anything) and '?'
diff --git a/include/pub_tool_signals.h b/include/pub_tool_signals.h
index e54063677..3d34d8390 100644
--- a/include/pub_tool_signals.h
+++ b/include/pub_tool_signals.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_SIGNALS_H
#define __PUB_TOOL_SIGNALS_H
+#include "pub_tool_basics.h" // Addr
+
// Register an interest in apparently internal faults; used code which
// wanders around dangerous memory (ie, leakcheck). The catcher is
// not expected to return.
diff --git a/include/pub_tool_sparsewa.h b/include/pub_tool_sparsewa.h
index 5336fee9c..433056996 100644
--- a/include/pub_tool_sparsewa.h
+++ b/include/pub_tool_sparsewa.h
@@ -32,6 +32,8 @@
#ifndef __PUB_TOOL_SPARSEWA_H
#define __PUB_TOOL_SPARSEWA_H
+#include "pub_tool_basics.h" // UWord
+
//--------------------------------------------------------------------
// PURPOSE: (see coregrind/pub_core_sparsewa.h for details)
//--------------------------------------------------------------------
diff --git a/include/pub_tool_stacktrace.h b/include/pub_tool_stacktrace.h
index 8501e0a5b..235dcd604 100644
--- a/include/pub_tool_stacktrace.h
+++ b/include/pub_tool_stacktrace.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_STACKTRACE_H
#define __PUB_TOOL_STACKTRACE_H
+#include "pub_tool_basics.h" // Addr
+
// The basic stack trace type: just an array of code addresses.
typedef Addr* StackTrace;
diff --git a/include/pub_tool_threadstate.h b/include/pub_tool_threadstate.h
index a2a41a56e..f48a18c86 100644
--- a/include/pub_tool_threadstate.h
+++ b/include/pub_tool_threadstate.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_THREADSTATE_H
#define __PUB_TOOL_THREADSTATE_H
+#include "pub_tool_basics.h" // ThreadID
+
/* The maximum number of pthreads that we support. This is
deliberately not very high since our implementation of some of the
scheduler algorithms is surely O(N) in the number of threads, since
diff --git a/include/pub_tool_vkiscnums.h b/include/pub_tool_vkiscnums.h
index 074037b34..8e0307924 100644
--- a/include/pub_tool_vkiscnums.h
+++ b/include/pub_tool_vkiscnums.h
@@ -34,6 +34,7 @@
#define __PUB_TOOL_VKISCNUMS_H
#include "pub_tool_vkiscnums_asm.h"
+#include "pub_tool_basics.h" // Word
// This converts a syscall number into a string, suitable for printing. It is
diff --git a/include/pub_tool_wordfm.h b/include/pub_tool_wordfm.h
index 15bf76a0e..341adebbe 100644
--- a/include/pub_tool_wordfm.h
+++ b/include/pub_tool_wordfm.h
@@ -52,6 +52,8 @@
#ifndef __PUB_TOOL_WORDFM_H
#define __PUB_TOOL_WORDFM_H
+#include "pub_tool_basics.h" // Word
+
//------------------------------------------------------------------//
//--- WordFM ---//
//--- Public interface ---//
diff --git a/include/pub_tool_xarray.h b/include/pub_tool_xarray.h
index 91484e094..16f036bf3 100644
--- a/include/pub_tool_xarray.h
+++ b/include/pub_tool_xarray.h
@@ -31,6 +31,8 @@
#ifndef __PUB_TOOL_XARRAY_H
#define __PUB_TOOL_XARRAY_H
+#include "pub_tool_basics.h" // Word
+
//--------------------------------------------------------------------
// PURPOSE: Provides a simple but useful structure, which is an array
// in which elements can be added at the end. The array is expanded