|
From: TongKe X. <tk...@gr...> - 2008-05-05 02:23:08
|
Being greed here now ... how can I get this returned as a const char* or
have it write it to a buffer I pass it?
(Don't see any obvious way from the implement of
VALGRIND_PRINTF_BACKTRACE).
--TongKe
On Mon, 5 May 2008, Julian Seward wrote:
> On Monday 05 May 2008 02:08, TongKe Xue wrote:
>> Hi!
>>
>> Is it possible,
>>
>> in my C/C++ code (which compies to a.out)
>> to call some function foo()
>>
>> so that when I run: valgrind ./a.out,
>> whenever execution hits foo()
>>
>> a backtrace / stack frames are printed out (like the print outs for
>> invalid read/writes).
>
> #include <valgrind/valgrind.h>
>
> ...
>
> VALGRIND_PRINTF_BACKTRACE("The answer is %d\n", 42);
>
> J
>
|