From c72417803f67a7a990a07b30bc8c39b99feb9614 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 3 Aug 2004 17:26:39 +0000 Subject: [PATCH] Moved *definitions* of VALGRIND_INTERNAL_PRINTF and VALGRIND_INTERNAL_PRINTF_BACKTRACE from vg_include.h to vg_messages.c. The *declarations* stayed. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2559 --- coregrind/vg_include.h | 32 +++++--------------------------- coregrind/vg_messages.c | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h index ff6735bf9e..f7e1657fae 100644 --- a/coregrind/vg_include.h +++ b/coregrind/vg_include.h @@ -519,33 +519,6 @@ struct vg_mallocfunc_info { Bool clo_trace_malloc; }; -__attribute__((weak)) -int -VALGRIND_INTERNAL_PRINTF(char *format, ...) -{ - unsigned int _qzz_res = 0; - va_list vargs; - va_start(vargs, format); - VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__INTERNAL_PRINTF, - (unsigned int)format, (unsigned int)vargs, 0, 0); - va_end(vargs); - return _qzz_res; -} - -__attribute__((weak)) -int -VALGRIND_INTERNAL_PRINTF_BACKTRACE(char *format, ...) -{ - unsigned int _qzz_res = 0; - va_list vargs; - va_start(vargs, format); - VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__INTERNAL_PRINTF_BACKTRACE, - (unsigned int)format, (unsigned int)vargs, 0, 0); - va_end(vargs); - return _qzz_res; -} - - /* --------------------------------------------------------------------- Constants pertaining to the simulated CPU state, VG_(baseBlock), which need to go here to avoid ugly circularities. @@ -1109,6 +1082,11 @@ extern void VG_(env_remove_valgrind_env_stuff) ( Char** env ); use. */ extern void VG_(send_bytes_to_logging_sink) ( Char* msg, Int nbytes ); +// Functions for printing from code within Valgrind, but which runs on the +// sim'd CPU. +int VALGRIND_INTERNAL_PRINTF ( char *format, ... ); +int VALGRIND_INTERNAL_PRINTF_BACKTRACE ( char *format, ... ); + /* --------------------------------------------------------------------- Exports of vg_demangle.c diff --git a/coregrind/vg_messages.c b/coregrind/vg_messages.c index 5c0fd892d0..948cdca1dc 100644 --- a/coregrind/vg_messages.c +++ b/coregrind/vg_messages.c @@ -126,6 +126,29 @@ void VG_(send_bytes_to_logging_sink) ( Char* msg, Int nbytes ) } } +int VALGRIND_INTERNAL_PRINTF(char *format, ...) +{ + unsigned int _qzz_res = 0; + va_list vargs; + va_start(vargs, format); + VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__INTERNAL_PRINTF, + (unsigned int)format, (unsigned int)vargs, 0, 0); + va_end(vargs); + return _qzz_res; +} + +int VALGRIND_INTERNAL_PRINTF_BACKTRACE(char *format, ...) +{ + unsigned int _qzz_res = 0; + va_list vargs; + va_start(vargs, format); + VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__INTERNAL_PRINTF_BACKTRACE, + (unsigned int)format, (unsigned int)vargs, 0, 0); + va_end(vargs); + return _qzz_res; +} + + /*--------------------------------------------------------------------*/ /*--- end vg_messages.c ---*/ /*--------------------------------------------------------------------*/ -- 2.47.2