Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Debug Monitor Output

Debug Monitor Output

Scheduled Pinned Locked Moved Visual Studio
debuggingcsharpvisual-studiolinuxtutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alan Chambers
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • A Alan Chambers

      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

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      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.

      A 1 Reply Last reply
      0
      • M Michael Dunn

        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.

        A Offline
        A Offline
        Alan Chambers
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • A Alan Chambers

          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

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          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 of yourapp.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

          A 1 Reply Last reply
          0
          • M Michael Dunn

            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 of yourapp.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

            A Offline
            A Offline
            Alan Chambers
            wrote on last edited by
            #5

            I'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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups