From: Florian Krohm Date: Sun, 15 Sep 2013 13:54:34 +0000 (+0000) Subject: Fix coregrind header files such that they can be included without X-Git-Tag: svn/VALGRIND_3_9_0~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6c7a2893cfe97708d15fdd6ac87db98fe60896a;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/coregrind/m_debuginfo/priv_d3basics.h b/coregrind/m_debuginfo/priv_d3basics.h index 61acc71567..1dd171c963 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 083f0797f6..169f3442f4 100644 --- a/coregrind/m_debuginfo/priv_image.h +++ b/coregrind/m_debuginfo/priv_image.h @@ -30,6 +30,11 @@ /* Contributed by Julian Seward */ +#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 ea871dd884..101d230dbe 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 a8c6fdbeb2..5b14480e20 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 7cba4e2237..5e038a1e8c 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 a78cbb9332..d5a2a1cbdd 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 e9da383a79..c5697cb4f7 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 328e5f0ba9..5baeff63c6 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 f0e657dda6..5b35d09bf1 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 662837378d..36c93935b8 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 5a208b4c1c..5d4dc0c7e0 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 abd4eb7217..cb6fef7990 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 2d4949cb07..2b783ed319 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 c8d53cbaf5..707d43806f 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 1afb9a15d5..deb0158969 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 efff82e22b..e49250ccdc 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 a0b3488015..a07d83d216 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 d0443226b9..1f2f7e955d 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 ec012c081c..d0ecd23115 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 0aa02611e2..6faf6616ea 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 047ea131c2..6bd0563b29 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 c09dc103ad..482891f416 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 1fbf8a4c33..46563264b5 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 4dc4748d89..b17bc862b0 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 ce07877da4..a37ad6ac91 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 cba484abe6..1b6e561690 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 422080cbb8..4429b19bad 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 b2caa563d9..9d94fbf2e8 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 269ae57df8..43f4fd91f2 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 c82e60ebc6..e55df1a259 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 749ede18b7..94b3fffa4f 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 8438556a41..bf29e0b46b 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 912eced652..915583c20e 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 b7880d8140..2f7e03ed0f 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 97324a3807..5652779f0f 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 1d78112974..1956a10350 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 e0eabb040d..44c0241e59 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 4b5845695d..d5d61273a8 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 60d8c87520..c011312c32 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 67b864d940..194f666e8d 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 0731a4f039..7560f5aeea 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 0a05b5031d..4f342f4b18 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 36c7fd8d87..ace9b58e2b 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 1648f8c15c..6f2eb08bfd 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 02cc9b7314..890d80ec58 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 6f25ec9d2c..54dce4a588 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 b536edec17..69f8037ee4 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 c399d5886f..bdac572d68 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 2ac4600324..2903b590f2 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 457d0f6009..8b849b03e2 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 82cebade3e..2ec3ccfa58 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 3f02cfce22..4924b6142f 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 d2d8a0672b..86d3d4779a 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 2f734c803e..9421551cd6 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 66d90a40ba..b7932fd818 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 6627a2f32c..c9890ab2a1 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 b8d80f4edd..91fe5f2dfa 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 7a2c5bd3fa..f30010438c 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 05d6bfdf19..2800dd6ecd 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 3b4d7cef71..58e0331dba 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 8536a815b4..775e4f5730 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 7432b82ae4..d55b9599f9 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 cb81e93a48..475d16ec26 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 bc5bc9c457..48794bed52 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 99aae0317d..8029b633cd 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 c6c37d1e40..e182d1bf5c 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 ef13712656..08d6dba2db 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 9eb789ba7e..a22bda6bb8 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 385483ddfc..f829f0938d 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 a44e156236..e0905737b1 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 075c74d58b..28cae8ae3c 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 e540636774..3d34d8390a 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 5336fee9c1..4330569968 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 8501e0a5bd..235dcd6042 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 a2a41a56e2..f48a18c86c 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 074037b34b..8e03079247 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 15bf76a0e6..341adebbe2 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 91484e0943..16f036bf3b 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