Redirecting debugger console output?

Hello

Is it possible to redirect the debugger output to a callback function rather than a standard windows console ??

I would like to display the debug information in my own window rather than the standard windows console.

regards
david

Hi,

we use OutputDebugString() which should do just what you ask for if you use TObject::Error() / Warning() / Debug(). To suppress the output in the terminal set gErrorIgnoreLevel e.g. to kError. See e.g. codeproject.com/KB/winsdk/Ou … tring.aspx on how to capture the text passed to OutputDebugString() from your program.

Cheers, Axel.

Or look for tee at this site:
unxutils.sourceforge.net/
Tee comes from unix/linux land and is a default console application.
It splits one stream into two.
Use it like this:

However, you need to make shure that the programm you run throught tee, sends output -> stops execution/flushes the stream -> sends output again (this could also be achieved by requesting user input after printf). This is needed becouse the piped data only reaches the second output after the main stream was flushed or the programm exits.

This is a example content of a debug session, stored in xxx.log:

[code]Setting environment for using Microsoft Visual Studio 2008 x86 tools.

C:\Users\Lis\Documents\work\CDataFile_src_cint7ver>cint.exe -IC:\cint\main -IC:\cint\inc -IC:\cint\include -IC:\cint\stl -S DataFile.cpp main.cpp

-S : Step over function/loop mode

CALL main()

main.cpp

4 main(int argc, char *argv) {
5 std::string curFile = “”;FILE:main.cpp LINE:5 cint.exe>
!!!Calling compiled function string()
arg1 = (char
0xb1af38)""

FILE:main.cpp LINE:5 cint.exe> [/code]
And the console holds:

[code]
C:\Users\Lis\Documents\work\CDataFile_src_cint7ver>C:\cint\cint.bat -S DataFile.
cpp main.cpp 2>&1 | C:\UnxUtils\usr\local\wbin\tee.exe CintDebug.log
Setting environment for using Microsoft Visual Studio 2008 x86 tools.

C:\Users\Lis\Documents\work\CDataFile_src_cint7ver>cint.exe -IC:\cint\main -IC:
cint\inc -IC:\cint\include -IC:\cint\stl -S DataFile.cpp main.cpp

-S : Step over function/loop mode

CALL main()

main.cpp

4 main(int argc, char **argv) {
5 std::string curFile = “”;[/code]

In your case you should pipe to a external programm insead of redirecting to a file.
This works like this:

Another alternative is freopen.
cplusplus.com/reference/clib … o/freopen/
support.microsoft.com/kb/58667

And something about streams:
cs.hmc.edu/~geoff/classes/hm … es/io.html

On windows you can also use rtconsole, which fixes the flush problem:
codeproject.com/KB/threads/RTconsole.aspx