Debug Monitor Output
-
Hi all, Just wondered if there was a portable way to send strings to the debugger's output pane. For this reason I don't want to use OutputDebugString(). I'd ideally like a way to use freopen(), or such like, to switch stdout to the output pane of the .NET IDE. I could then only do this for windows debugging app's and leave the normal stdout for linux because the debugger picks it up. I'd even welcome a way of integrating an stdout viewer in the output window as a seperate tab. Any ideas on how to do this would be very welcome. Thanks, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader
-
Hi all, Just wondered if there was a portable way to send strings to the debugger's output pane. For this reason I don't want to use OutputDebugString(). I'd ideally like a way to use freopen(), or such like, to switch stdout to the output pane of the .NET IDE. I could then only do this for windows debugging app's and leave the normal stdout for linux because the debugger picks it up. I'd even welcome a way of integrating an stdout viewer in the output window as a seperate tab. Any ideas on how to do this would be very welcome. Thanks, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader
Alan Chambers wrote: I'd ideally like a way to use freopen(), or such like, to switch stdout to the output pane of the .NET IDE. Debug strings don't work that way, they don't go to a file handle. The IDE calls
WaitForDebugEvent()
to know when a debug string is output, and it then shows the string in its own window. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Laugh it up, fuzzball. -
Alan Chambers wrote: I'd ideally like a way to use freopen(), or such like, to switch stdout to the output pane of the .NET IDE. Debug strings don't work that way, they don't go to a file handle. The IDE calls
WaitForDebugEvent()
to know when a debug string is output, and it then shows the string in its own window. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Laugh it up, fuzzball.Thanks for your response Michael. I was guessing VS was doing something narky like this. kDevelop under linux has an stdout and stderr listener in its debug output pane, so any printf() calls can be traced very easily. Its the same with ProDG for playstation development, the TTY window picks up stdout strings. This is the main reason I want to use the stdout method, because its very portable across different platform development. It seems to me that VS is just a bit crap not being able to listen to this output stream, especially since if you do console window programming you can use either cout << OR printf to send a string to stdout and it gets displayed on the console window, but if you do proper windows programming it just does nothing??? Thats just rubbish. Perhaps I should write my own listener window pane, thats the easy bit, but is there any way of integrating it with visual studio then? I'm sure there is cos ProDG is integrated, I'm just wondering how though? Any ideas Michael? "When I left you I was but the learner, now I am the master" - Darth Vader
-
Thanks for your response Michael. I was guessing VS was doing something narky like this. kDevelop under linux has an stdout and stderr listener in its debug output pane, so any printf() calls can be traced very easily. Its the same with ProDG for playstation development, the TTY window picks up stdout strings. This is the main reason I want to use the stdout method, because its very portable across different platform development. It seems to me that VS is just a bit crap not being able to listen to this output stream, especially since if you do console window programming you can use either cout << OR printf to send a string to stdout and it gets displayed on the console window, but if you do proper windows programming it just does nothing??? Thats just rubbish. Perhaps I should write my own listener window pane, thats the easy bit, but is there any way of integrating it with visual studio then? I'm sure there is cos ProDG is integrated, I'm just wondering how though? Any ideas Michael? "When I left you I was but the learner, now I am the master" - Darth Vader
My first thought was to write something like tee, call it debugtee. Take its stdin and echo it to cout and output it with
OutputDebugString()
. Then when you run your app, use a command line ofyourapp.exe | debugtee
Then you'll see stdout from yourapp.exe in the console window and the debug window in VC. BTW if you really want VC to have a stdout listener feature, submit the idea to MS using their wish list. :) --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy -
My first thought was to write something like tee, call it debugtee. Take its stdin and echo it to cout and output it with
OutputDebugString()
. Then when you run your app, use a command line ofyourapp.exe | debugtee
Then you'll see stdout from yourapp.exe in the console window and the debug window in VC. BTW if you really want VC to have a stdout listener feature, submit the idea to MS using their wish list. :) --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- BuffyI'll post it on their wish list :) Thats a pretty good idea actually, cheers Michael. BTW: Thats exactly what I have at the minute :) except I put #ifdef _WIN32 tags around the OutputDebugString() stuff so it doesn't affect my linux compilations. Thanks again, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader