|
From: <sv...@va...> - 2005-06-03 03:08:44
|
Author: njn Date: 2005-06-03 04:08:39 +0100 (Fri, 03 Jun 2005) New Revision: 3840 Added: trunk/coregrind/pub_core_libcprint.h trunk/include/pub_tool_libcprint.h Removed: trunk/coregrind/vg_messages.c Modified: trunk/cachegrind/amd64/cg_arch.c trunk/cachegrind/arm/cg_arch.c trunk/cachegrind/cg_main.c trunk/cachegrind/x86/cg_arch.c trunk/coregrind/Makefile.am trunk/coregrind/core.h trunk/coregrind/linux/core_os.c trunk/coregrind/m_aspacemgr/aspacemgr.c trunk/coregrind/m_aspacemgr/read_procselfmaps.c trunk/coregrind/m_debuginfo/dwarf.c trunk/coregrind/m_debuginfo/stabs.c trunk/coregrind/m_debuginfo/symtab.c trunk/coregrind/m_debuginfo/symtypes.c trunk/coregrind/m_demangle/cplus-dem.c trunk/coregrind/m_errormgr.c trunk/coregrind/m_execontext.c trunk/coregrind/m_libcbase.c trunk/coregrind/m_main.c trunk/coregrind/m_mallocfree.c trunk/coregrind/m_profile.c trunk/coregrind/m_redir.c trunk/coregrind/m_replacemalloc/replacemalloc_core.c trunk/coregrind/m_scheduler/scheduler.c trunk/coregrind/m_sigframe/sigframe-amd64-linux.c trunk/coregrind/m_sigframe/sigframe-x86-linux.c trunk/coregrind/m_signals.c trunk/coregrind/m_skiplist.c trunk/coregrind/m_stacktrace.c trunk/coregrind/m_syscalls/syscalls-amd64-linux.c trunk/coregrind/m_syscalls/syscalls-linux.c trunk/coregrind/m_syscalls/syscalls-x86-linux.c trunk/coregrind/m_syscalls/syscalls.c trunk/coregrind/m_tooliface.c trunk/coregrind/m_translate.c trunk/coregrind/m_transtab.c trunk/coregrind/vg_mylibc.c trunk/helgrind/hg_main.c trunk/include/Makefile.am trunk/include/tool.h trunk/lackey/lk_main.c trunk/massif/ms_main.c trunk/memcheck/mac_leakcheck.c trunk/memcheck/mac_malloc_wrappers.c trunk/memcheck/mac_shared.c trunk/memcheck/mc_main.c trunk/memcheck/mc_translate.c Log: Modularise printing functions in m_libcprint. Modified: trunk/cachegrind/amd64/cg_arch.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/cachegrind/amd64/cg_arch.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/cachegrind/amd64/cg_arch.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -31,6 +31,7 @@ #include "tool.h" #include "cg_arch.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" =20 // All CPUID info taken from sandpile.org/a32/cpuid.htm */ // Probably only works for Intel and AMD chips, and probably only for so= me of Modified: trunk/cachegrind/arm/cg_arch.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/cachegrind/arm/cg_arch.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/cachegrind/arm/cg_arch.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -30,7 +30,6 @@ =20 #include "tool.h" #include "cg_arch.h" -#include "pub_tool_libcbase.h" =20 void VGA_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c, Bool all_caches_clo_defined) Modified: trunk/cachegrind/cg_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/cachegrind/cg_main.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/cachegrind/cg_main.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -33,6 +33,7 @@ #include "pub_tool_debuginfo.h" #include "pub_tool_hashtable.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" #include "pub_tool_profile.h" Modified: trunk/cachegrind/x86/cg_arch.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/cachegrind/x86/cg_arch.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/cachegrind/x86/cg_arch.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -30,6 +30,7 @@ =20 #include "tool.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" #include "cg_arch.h" =20 // All CPUID info taken from sandpile.org/a32/cpuid.htm */ Modified: trunk/coregrind/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/Makefile.am 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/Makefile.am 2005-06-03 03:08:39 UTC (rev 3840) @@ -47,6 +47,7 @@ pub_core_execontext.h \ pub_core_hashtable.h \ pub_core_libcbase.h \ + pub_core_libcprint.h \ pub_core_main.h \ pub_core_mallocfree.h \ pub_core_options.h \ @@ -89,6 +90,7 @@ m_execontext.c \ m_hashtable.c \ m_libcbase.c \ + m_libcprint.c \ m_main.c \ m_mallocfree.c \ m_options.c \ @@ -102,7 +104,6 @@ m_transtab.c \ \ ume.c \ - vg_messages.c \ vg_mylibc.c \ vg_threadmodel.c \ vg_pthreadmodel.c Modified: trunk/coregrind/core.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/core.h 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/core.h 2005-06-03 03:08:39 UTC (rev 3840) @@ -128,10 +128,6 @@ extern void VG_(unimplemented) ( Char* msg ) __attribute__((__noreturn__)); =20 -/* Tell the logging mechanism whether we are logging to a file - descriptor or a socket descriptor. */ -extern Bool VG_(logging_to_socket); - /* Tools use VG_(strdup)() which doesn't expose ArenaId */ extern Char* VG_(arena_strdup) ( ArenaId aid, const Char* s); =20 Modified: trunk/coregrind/linux/core_os.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/linux/core_os.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/linux/core_os.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -30,6 +30,7 @@ =20 #include "core.h" #include "pub_core_debuglog.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_signals.h" #include "pub_core_tooliface.h" Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-02 03:52:53 UTC (rev = 3839) +++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-03 03:08:39 UTC (rev = 3840) @@ -33,6 +33,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_syscalls.h" #include "pub_core_tooliface.h" Modified: trunk/coregrind/m_aspacemgr/read_procselfmaps.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_aspacemgr/read_procselfmaps.c 2005-06-02 03:52:53 U= TC (rev 3839) +++ trunk/coregrind/m_aspacemgr/read_procselfmaps.c 2005-06-03 03:08:39 U= TC (rev 3840) @@ -33,6 +33,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" =20 /* Size of a smallish table used to read /proc/self/map entries. */ #define M_PROCMAP_BUF 50000 Modified: trunk/coregrind/m_debuginfo/dwarf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_debuginfo/dwarf.c 2005-06-02 03:52:53 UTC (rev 3839= ) +++ trunk/coregrind/m_debuginfo/dwarf.c 2005-06-03 03:08:39 UTC (rev 3840= ) @@ -30,6 +30,7 @@ =20 #include "core.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "priv_symtab.h" =20 Modified: trunk/coregrind/m_debuginfo/stabs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_debuginfo/stabs.c 2005-06-02 03:52:53 UTC (rev 3839= ) +++ trunk/coregrind/m_debuginfo/stabs.c 2005-06-03 03:08:39 UTC (rev 3840= ) @@ -30,6 +30,7 @@ =20 #include "core.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "priv_symtab.h" =20 #include <a.out.h> /* stabs defns */ Modified: trunk/coregrind/m_debuginfo/symtab.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_debuginfo/symtab.c 2005-06-02 03:52:53 UTC (rev 383= 9) +++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-03 03:08:39 UTC (rev 384= 0) @@ -33,6 +33,7 @@ #include "pub_core_aspacemgr.h" #include "pub_core_demangle.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_profile.h" #include "pub_core_redir.h" Modified: trunk/coregrind/m_debuginfo/symtypes.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_debuginfo/symtypes.c 2005-06-02 03:52:53 UTC (rev 3= 839) +++ trunk/coregrind/m_debuginfo/symtypes.c 2005-06-03 03:08:39 UTC (rev 3= 840) @@ -32,6 +32,7 @@ #include "pub_core_debuginfo.h" #include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */ #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_tooliface.h" #include "priv_symtypes.h" =20 Modified: trunk/coregrind/m_demangle/cplus-dem.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_demangle/cplus-dem.c 2005-06-02 03:52:53 UTC (rev 3= 839) +++ trunk/coregrind/m_demangle/cplus-dem.c 2005-06-03 03:08:39 UTC (rev 3= 840) @@ -39,6 +39,7 @@ #include "safe-ctype.h" #include "core.h" #include "pub_core_libcbase.h" +#include "pub_tool_libcprint.h" =20 /*#include <sys/types.h> #include <string.h> Modified: trunk/coregrind/m_errormgr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_errormgr.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_errormgr.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -33,6 +33,7 @@ #include "pub_core_errormgr.h" #include "pub_core_execontext.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" // for VG_(start_debugger)() #include "pub_core_options.h" #include "pub_core_stacktrace.h" Modified: trunk/coregrind/m_execontext.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_execontext.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_execontext.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -30,6 +30,7 @@ =20 #include "core.h" #include "pub_core_execontext.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_profile.h" =20 Modified: trunk/coregrind/m_libcbase.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_libcbase.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_libcbase.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -28,7 +28,7 @@ The GNU General Public License is contained in the file COPYING. */ =20 -#include "tool.h" // XXX: temporary, for NULL, VG_(), Char, etc +#include "core.h" // XXX: temporary, for NULL, VG_(), Char, etc #include "pub_core_libcbase.h" =20 /* --------------------------------------------------------------------- Modified: trunk/coregrind/m_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_main.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_main.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -37,6 +37,7 @@ #include "pub_core_errormgr.h" #include "pub_core_execontext.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" #include "pub_core_options.h" #include "pub_core_profile.h" Modified: trunk/coregrind/m_mallocfree.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_mallocfree.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_mallocfree.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -33,6 +33,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_profile.h" #include "valgrind.h" Modified: trunk/coregrind/m_profile.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_profile.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_profile.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -29,6 +29,7 @@ */ =20 #include "core.h" +#include "pub_core_libcprint.h" #include "pub_core_profile.h" =20 /* get rid of these, if possible */ Modified: trunk/coregrind/m_redir.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_redir.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_redir.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -33,6 +33,7 @@ =20 #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_skiplist.h" #include "pub_core_options.h" #include "pub_core_redir.h" Modified: trunk/coregrind/m_replacemalloc/replacemalloc_core.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_replacemalloc/replacemalloc_core.c 2005-06-02 03:52= :53 UTC (rev 3839) +++ trunk/coregrind/m_replacemalloc/replacemalloc_core.c 2005-06-03 03:08= :39 UTC (rev 3840) @@ -30,6 +30,7 @@ =20 #include "core.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_replacemalloc.h" =20 Modified: trunk/coregrind/m_scheduler/scheduler.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_scheduler/scheduler.c 2005-06-02 03:52:53 UTC (rev = 3839) +++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-03 03:08:39 UTC (rev = 3840) @@ -64,6 +64,7 @@ #include "pub_core_dispatch.h" #include "pub_core_errormgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" #include "pub_core_options.h" #include "pub_core_profile.h" Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-06-02 03:52:53= UTC (rev 3839) +++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-06-03 03:08:39= UTC (rev 3840) @@ -32,6 +32,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_sigframe.h" #include "pub_core_signals.h" Modified: trunk/coregrind/m_sigframe/sigframe-x86-linux.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-06-02 03:52:53 U= TC (rev 3839) +++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-06-03 03:08:39 U= TC (rev 3840) @@ -32,6 +32,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" /* find_segment */ #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_sigframe.h" #include "pub_core_signals.h" Modified: trunk/coregrind/m_signals.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_signals.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_signals.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -84,6 +84,7 @@ #include "pub_core_aspacemgr.h" #include "pub_core_errormgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" #include "pub_core_options.h" #include "pub_core_signals.h" Modified: trunk/coregrind/m_skiplist.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_skiplist.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_skiplist.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -88,6 +88,7 @@ =20 #include "core.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_skiplist.h" =20 #include <stdlib.h> Modified: trunk/coregrind/m_stacktrace.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_stacktrace.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_stacktrace.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -31,6 +31,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_profile.h" #include "pub_core_stacktrace.h" Modified: trunk/coregrind/m_syscalls/syscalls-amd64-linux.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-06-02 03:52:53= UTC (rev 3839) +++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-06-03 03:08:39= UTC (rev 3840) @@ -32,6 +32,7 @@ #include "ume.h" /* for jmp_with_stack */ #include "pub_core_debuglog.h" #include "pub_core_aspacemgr.h" +#include "pub_core_libcprint.h" #include "pub_core_sigframe.h" #include "pub_core_syscalls.h" #include "pub_core_tooliface.h" Modified: trunk/coregrind/m_syscalls/syscalls-linux.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_syscalls/syscalls-linux.c 2005-06-02 03:52:53 UTC (= rev 3839) +++ trunk/coregrind/m_syscalls/syscalls-linux.c 2005-06-03 03:08:39 UTC (= rev 3840) @@ -30,6 +30,7 @@ =20 #include "core.h" #include "pub_core_aspacemgr.h" +#include "pub_core_libcprint.h" #include "pub_core_tooliface.h" #include "priv_syscalls.h" =20 Modified: trunk/coregrind/m_syscalls/syscalls-x86-linux.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-06-02 03:52:53 U= TC (rev 3839) +++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-06-03 03:08:39 U= TC (rev 3840) @@ -37,6 +37,7 @@ #include "ume.h" /* for jmp_with_stack */ #include "pub_core_debuglog.h" #include "pub_core_aspacemgr.h" +#include "pub_core_libcprint.h" #include "pub_core_sigframe.h" #include "pub_core_syscalls.h" #include "pub_core_tooliface.h" Modified: trunk/coregrind/m_syscalls/syscalls.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_syscalls/syscalls.c 2005-06-02 03:52:53 UTC (rev 38= 39) +++ trunk/coregrind/m_syscalls/syscalls.c 2005-06-03 03:08:39 UTC (rev 38= 40) @@ -32,6 +32,7 @@ #include "pub_core_debuglog.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" #include "pub_core_profile.h" #include "pub_core_stacktrace.h" Modified: trunk/coregrind/m_tooliface.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_tooliface.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_tooliface.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -31,6 +31,7 @@ =20 #include "core.h" #include "pub_core_tooliface.h" +#include "pub_core_libcprint.h" =20 // The core/tool dictionary of functions (initially zeroed, as we want i= t) VgToolInterface VG_(tdict); Modified: trunk/coregrind/m_translate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_translate.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_translate.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -32,6 +32,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" // for VG_(bbs_done) #include "pub_core_options.h" #include "pub_core_profile.h" Modified: trunk/coregrind/m_transtab.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_transtab.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/m_transtab.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -32,6 +32,7 @@ #include "core.h" #include "pub_core_debuginfo.h" #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_options.h" #include "pub_core_tooliface.h" // XXX: this module should not depend on m_translate! Added: trunk/coregrind/pub_core_libcprint.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/pub_core_libcprint.h 2005-06-02 03:52:53 UTC (rev 383= 9) +++ trunk/coregrind/pub_core_libcprint.h 2005-06-03 03:08:39 UTC (rev 384= 0) @@ -0,0 +1,49 @@ + +/*--------------------------------------------------------------------*/ +/*--- Printing libc stuff. pub_core_libcprint.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward + js...@ac... + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __PUB_CORE_LIBCPRINT_H +#define __PUB_CORE_LIBCPRINT_H + +//-------------------------------------------------------------------- +// PURPOSE: This module contains all the libc code that is related to +// higher-level (ie. higher than DebugLog) printing, eg. VG_(printf)(). +//-------------------------------------------------------------------- + +#include "pub_tool_libcprint.h" + +/* Tell the logging mechanism whether we are logging to a file + descriptor or a socket descriptor. */ +extern Bool VG_(logging_to_socket); + +#endif // __PUB_CORE_LIBCPRINT_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Deleted: trunk/coregrind/vg_messages.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/vg_messages.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/vg_messages.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -1,101 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- For sending error/informative messages. ---*/ -/*--- vg_messages.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2005 Julian Seward=20 - js...@ac... - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "core.h" -#include "valgrind.h" - -#include "pub_core_options.h" - -#include <time.h> -#include <sys/time.h> - -UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs = ) -{ - UInt count =3D 0; - Char c; - const Char* pfx_s; - static const Char pfx[] =3D ">>>>>>>>>>>>>>>>"; - - switch (kind) { - case Vg_UserMsg: c =3D '=3D'; break; - case Vg_DebugMsg: c =3D '-'; break; - case Vg_DebugExtraMsg: c =3D '+'; break; - case Vg_ClientMsg: c =3D '*'; break; - default: c =3D '?'; break; - } - - // The pfx trick prints one or more '>' characters in front of the - // messages when running Valgrind under Valgrind, one per level of - // self-hosting. - pfx_s =3D &pfx[sizeof(pfx)-1-RUNNING_ON_VALGRIND], - - // Print the message - count =3D 0; - - if (!VG_(clo_xml)) - count +=3D VG_(printf) ("%s%c%c", pfx_s, c,c); - - if (VG_(clo_time_stamp)) { - struct timeval tv; - struct tm tm; - =20 - if ( gettimeofday( &tv, NULL ) =3D=3D 0 && - localtime_r( &tv.tv_sec, &tm ) =3D=3D &tm ) - { - count +=3D - VG_(printf)( "%04d-%02d-%02d %02d:%02d:%02d.%03d ", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec / = 1000 ); - } - } - - if (!VG_(clo_xml)) - count +=3D VG_(printf) ("%d%c%c ", VG_(getpid)(), c,c); - - count +=3D VG_(vprintf)(format, vargs); - count +=3D VG_(printf) ("\n"); - return count; -} - -/* Send a simple single-part message. */ -UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... ) -{ - UInt count; - va_list vargs; - va_start(vargs,format); - count =3D VG_(vmessage) ( kind, format, vargs ); - va_end(vargs); - return count; -} - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ Modified: trunk/coregrind/vg_mylibc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/vg_mylibc.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/coregrind/vg_mylibc.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -34,6 +34,7 @@ #include "pub_core_aspacemgr.h" #include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */ #include "pub_core_libcbase.h" +#include "pub_core_libcprint.h" #include "pub_core_main.h" #include "pub_core_options.h" #include "pub_core_stacktrace.h" @@ -408,107 +409,6 @@ } =20 =20 -/* Tell the logging mechanism whether we are logging to a file - descriptor or a socket descriptor. */ -Bool VG_(logging_to_socket) =3D False; - -/* Do the low-level send of a message to the logging sink. */ -static void send_bytes_to_logging_sink ( Char* msg, Int nbytes ) -{ - if (!VG_(logging_to_socket)) { - VG_(write)( VG_(clo_log_fd), msg, nbytes ); - } else { - Int rc =3D VG_(write_socket)( VG_(clo_log_fd), msg, nbytes ); - if (rc =3D=3D -1) { - // For example, the listener process died. Switch back to stde= rr. - VG_(logging_to_socket) =3D False; - VG_(clo_log_fd) =3D 2; - VG_(write)( VG_(clo_log_fd), msg, nbytes ); - } - } -} - -typedef struct { - char buf[100]; - int n; -} printf_buf; - -// Adds a single char to the buffer. When the buffer gets sufficiently -// full, we write its contents to the logging sink. -static void add_to_myprintf_buf ( HChar c, void *p ) -{ - printf_buf *myprintf_buf =3D (printf_buf *)p; - =20 - if (myprintf_buf->n >=3D 100-10 /*paranoia*/ ) { - send_bytes_to_logging_sink( myprintf_buf->buf, myprintf_buf->n ); - myprintf_buf->n =3D 0; - } - myprintf_buf->buf[myprintf_buf->n++] =3D c; - myprintf_buf->buf[myprintf_buf->n] =3D 0; -} - -UInt VG_(vprintf) ( const HChar *format, va_list vargs ) -{ - UInt ret =3D 0; - printf_buf myprintf_buf =3D {"",0}; - - if (VG_(clo_log_fd) >=3D 0) { - ret =3D VG_(debugLog_vprintf)=20 - ( add_to_myprintf_buf, &myprintf_buf, format, vargs ); - - // Write out any chars left in the buffer. - if (myprintf_buf.n > 0) { - send_bytes_to_logging_sink( myprintf_buf.buf, myprintf_buf.n ); - } - } - return ret; -} - -UInt VG_(printf) ( const HChar *format, ... ) -{ - UInt ret; - va_list vargs; - - va_start(vargs, format); - ret =3D VG_(vprintf)(format, vargs); - va_end(vargs); - - return ret; -} - -/* A general replacement for sprintf(). */ -static void add_to_vg_sprintf_buf ( HChar c, void *p ) -{ - char **vg_sprintf_ptr =3D p; - *(*vg_sprintf_ptr)++ =3D c; -} - -UInt VG_(vsprintf) ( Char* buf, const HChar *format, va_list vargs ) -{ - Int ret; - Char *vg_sprintf_ptr =3D buf; - - ret =3D VG_(debugLog_vprintf)=20 - ( add_to_vg_sprintf_buf, &vg_sprintf_ptr, format, vargs ); - add_to_vg_sprintf_buf('\0', &vg_sprintf_ptr); - - vg_assert(VG_(strlen)(buf) =3D=3D ret); - - return ret; -} - -UInt VG_(sprintf) ( Char* buf, const HChar *format, ... ) -{ - UInt ret; - va_list vargs; - - va_start(vargs,format); - ret =3D VG_(vsprintf)(buf, format, vargs); - va_end(vargs); - - return ret; -} - /* --------------------------------------------------------------------- strdup() ------------------------------------------------------------------ */ Modified: trunk/helgrind/hg_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/helgrind/hg_main.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/helgrind/hg_main.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -33,6 +33,7 @@ #include "pub_tool_debuginfo.h" #include "pub_tool_hashtable.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" #include "pub_tool_profile.h" Modified: trunk/include/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/include/Makefile.am 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/include/Makefile.am 2005-06-03 03:08:39 UTC (rev 3840) @@ -9,6 +9,7 @@ pub_tool_execontext.h \ pub_tool_hashtable.h \ pub_tool_libcbase.h \ + pub_tool_libcprint.h \ pub_tool_mallocfree.h \ pub_tool_options.h \ pub_tool_profile.h \ Added: trunk/include/pub_tool_libcprint.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/include/pub_tool_libcprint.h 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/include/pub_tool_libcprint.h 2005-06-03 03:08:39 UTC (rev 3840) @@ -0,0 +1,71 @@ + +/*--------------------------------------------------------------------*/ +/*--- Printing libc stuff. pub_tool_libcprint.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward + js...@ac... + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __PUB_TOOL_LIBCPRINT_H +#define __PUB_TOOL_LIBCPRINT_H + +/* --------------------------------------------------------------------- + Basic printing + ------------------------------------------------------------------ */ + +/* Note that they all output to the file descriptor given by the + * --log-fd/--log-file/--log-socket argument, which defaults to 2 (stder= r). + * Hence no need for VG_(fprintf)(). + */ +extern UInt VG_(printf) ( const HChar *format, ... ); +extern UInt VG_(vprintf) ( const HChar *format, va_list vargs ); +/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */ +extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... ); +extern UInt VG_(vsprintf)( Char* buf, const HChar* format, va_list vargs= ); + +/* --------------------------------------------------------------------- + Messages for the user + ------------------------------------------------------------------ */ + +/* Print a message prefixed by "??<pid>?? "; '?' depends on the VgMsgKin= d. + Should be used for all user output. */ + +typedef + enum { Vg_UserMsg, /* '?' =3D=3D '=3D' */ + Vg_DebugMsg, /* '?' =3D=3D '-' */ + Vg_DebugExtraMsg, /* '?' =3D=3D '+' */ + Vg_ClientMsg /* '?' =3D=3D '*' */ + } + VgMsgKind; + +/* Send a single-part message. Appends a newline. */ +extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... )= ; +extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_li= st vargs ); + +#endif // __PUB_TOOL_LIBCPRINT_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: trunk/include/tool.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/include/tool.h 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/include/tool.h 2005-06-03 03:08:39 UTC (rev 3840) @@ -78,26 +78,6 @@ =20 =20 /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ -/*=3D=3D=3D Printing messages for the user = =3D=3D=3D*/ -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ - -/* Print a message prefixed by "??<pid>?? "; '?' depends on the VgMsgKin= d. - Should be used for all user output. */ - -typedef - enum { Vg_UserMsg, /* '?' =3D=3D '=3D' */ - Vg_DebugMsg, /* '?' =3D=3D '-' */ - Vg_DebugExtraMsg, /* '?' =3D=3D '+' */ - Vg_ClientMsg /* '?' =3D=3D '*' */ - } - VgMsgKind; - -/* Send a single-part message. Appends a newline. */ -extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... )= ; -extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_li= st vargs ); - - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /*=3D=3D=3D Useful stuff to call from generated code = =3D=3D=3D*/ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ =20 @@ -132,17 +112,7 @@ #endif =20 /* ------------------------------------------------------------------ */ -/* stdio.h - * - * Note that they all output to the file descriptor given by the - * --log-fd/--log-file/--log-socket argument, which defaults to 2 (stder= r). - * Hence no need for VG_(fprintf)(). - */ -extern UInt VG_(printf) ( const HChar *format, ... ); -extern UInt VG_(vprintf) ( const HChar *format, va_list vargs ); -/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */ -extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... ); -extern UInt VG_(vsprintf)( Char* buf, const HChar* format, va_list vargs= ); +/* stdio.h */ =20 extern Int VG_(rename) ( Char* old_name, Char* new_name ); =20 Modified: trunk/lackey/lk_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/lackey/lk_main.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/lackey/lk_main.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -31,6 +31,7 @@ =20 #include "tool.h" #include "pub_tool_tooliface.h" +#include "pub_tool_libcprint.h" =20 /* Nb: use ULongs because the numbers can get very big */ static ULong n_dlrr_calls =3D 0; Modified: trunk/massif/ms_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/massif/ms_main.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/massif/ms_main.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -38,6 +38,7 @@ #include "pub_tool_debuginfo.h" #include "pub_tool_hashtable.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" #include "pub_tool_profile.h" Modified: trunk/memcheck/mac_leakcheck.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/memcheck/mac_leakcheck.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/memcheck/mac_leakcheck.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -33,6 +33,7 @@ #include <setjmp.h> #include "mac_shared.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" =20 /* Define to debug the memory-leak-detector. */ #define VG_DEBUG_LEAKCHECK 0 Modified: trunk/memcheck/mac_malloc_wrappers.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/memcheck/mac_malloc_wrappers.c 2005-06-02 03:52:53 UTC (rev 383= 9) +++ trunk/memcheck/mac_malloc_wrappers.c 2005-06-03 03:08:39 UTC (rev 384= 0) @@ -32,6 +32,7 @@ =20 #include "mac_shared.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" =20 /*------------------------------------------------------------*/ /*--- Defns ---*/ Modified: trunk/memcheck/mac_shared.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/memcheck/mac_shared.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/memcheck/mac_shared.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -32,6 +32,7 @@ =20 #include "mac_shared.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" #include "memcheck.h" /* for VG_USERREQ__* */ =20 /*------------------------------------------------------------*/ Modified: trunk/memcheck/mc_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/memcheck/mc_main.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/memcheck/mc_main.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -39,6 +39,7 @@ #include "mc_include.h" #include "memcheck.h" /* for client requests */ #include "pub_tool_libcbase.h" +#include "pub_tool_libcprint.h" =20 =20 #define EXPECTED_TAKEN(cond) __builtin_expect((cond),1) Modified: trunk/memcheck/mc_translate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/memcheck/mc_translate.c 2005-06-02 03:52:53 UTC (rev 3839) +++ trunk/memcheck/mc_translate.c 2005-06-03 03:08:39 UTC (rev 3840) @@ -30,6 +30,7 @@ */ =20 #include "mc_include.h" +#include "pub_tool_libcprint.h" =20 =20 /*------------------------------------------------------------*/ |