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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. nebulous TRACE output

nebulous TRACE output

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
7 Posts 4 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.
  • M Offline
    M Offline
    moredip
    wrote on last edited by
    #1

    Has anyone else noticed some output from TRACE seems to occasionally be dropped before it appears in the debug window? Am I paranoid? Am I covering my own programming inadequacies by blaming M$? TIA, Pete

    S R S 4 Replies Last reply
    0
    • M moredip

      Has anyone else noticed some output from TRACE seems to occasionally be dropped before it appears in the debug window? Am I paranoid? Am I covering my own programming inadequacies by blaming M$? TIA, Pete

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      donno about that, but i've been bitten already by the size limit of presearved text in the output window; it just won't hold generated C source for a 4MB transparency LUT :(( Black rooms are calling; To men in leather coats. White labs are cooking up the silver ghost.

      Smashing Pumpkins, Glass and the Ghost Children

      1 Reply Last reply
      0
      • M moredip

        Has anyone else noticed some output from TRACE seems to occasionally be dropped before it appears in the debug window? Am I paranoid? Am I covering my own programming inadequacies by blaming M$? TIA, Pete

        R Offline
        R Offline
        Roger Allen
        wrote on last edited by
        #3

        The input buffer size for the TRACE output window is a limited size (after all its a pipe between the processes). If your debug output TRACE volume is high and the thread reading the buffer in the VC editor does not run often enough, you can lose TRACE information from the window. So your not paranoid, if this is what is happening to you. Roger Allen Sonork 100.10016 If I'm not breathing, I'm either dead or holding my breath. A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?

        M 1 Reply Last reply
        0
        • R Roger Allen

          The input buffer size for the TRACE output window is a limited size (after all its a pipe between the processes). If your debug output TRACE volume is high and the thread reading the buffer in the VC editor does not run often enough, you can lose TRACE information from the window. So your not paranoid, if this is what is happening to you. Roger Allen Sonork 100.10016 If I'm not breathing, I'm either dead or holding my breath. A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?

          M Offline
          M Offline
          moredip
          wrote on last edited by
          #4

          That sounds like what is happening. I'm writing LOADS of memory allocation info to the debug output to try and track down mem leaks. I guess the only solution would be to put a little pause in my AllocHook() after every TRACE(). Thanks Roger.

          1 Reply Last reply
          0
          • M moredip

            Has anyone else noticed some output from TRACE seems to occasionally be dropped before it appears in the debug window? Am I paranoid? Am I covering my own programming inadequacies by blaming M$? TIA, Pete

            S Offline
            S Offline
            Stephen C Steel
            wrote on last edited by
            #5

            No, you are probably getting bitten by a Visual Studio bug. Visual Studio filters the output of the OutPutDebugString() function, which the TRACE macro ultimately calls, before showing it in the output window in order to remove the application name (which otherwise gets added). However, the filtering is not too smart (at least with version 6.0), and it messes up the display of TRACE messages that includes both an open parenthesis "(" and a colon ":" in that order.

            When I add the following lines to my code

            TRACE (_T("Text before colon: Text after colon\n"));
            TRACE (_T("Text with parenthesis() before colon: Text after colon\n"));
            TRACE (_T("Text with open parenthesis( before colon: Text after colon\n"));
            TRACE (_T("Text with close parenthesis) before colon: Text after colon\n"));
            TRACE (_T("Text with (text inside parenthesis) before colon: Text after colon\n"));

            the Visual Studio output window displays

            Text before colon: Text after colon
            Text with parenthesis() before colon
            Text with open parenthesis( before colon
            Text with close parenthesis) before colon: Text after colon
            Text with (text inside parenthesis) before colon

            Intrestingly, if I select this text text in the output window and paste it into notepad, I get

            Text before colon: Text after colon
            Text with parenthesis() before colonText with open parenthesis( before colonText with close parenthesis) before colon: Text after colon
            Text with (text inside parenthesis) before colon

            Stephen C. Steel Kerr Vayne Systems Ltd.

            1 Reply Last reply
            0
            • M moredip

              Has anyone else noticed some output from TRACE seems to occasionally be dropped before it appears in the debug window? Am I paranoid? Am I covering my own programming inadequacies by blaming M$? TIA, Pete

              S Offline
              S Offline
              Stephen C Steel
              wrote on last edited by
              #6

              No, you aren't being paranoid - there is a bug in Visual Studio version 6.0. The TRACE macro ultimately uses OutputDebugString(), and along the way the application name gets prepended to the output. Visual studio has a filter that attempts to strip the application name before showing the text in the output window, but it is buggy.

              If I add the following code to my application

              TRACE (_T("Text before colon: Text after colon\n"));
              TRACE (_T("Text with parenthesis() before colon: Text after colon\n"));
              TRACE (_T("Text with open parenthesis( before colon: Text after colon\n"));
              TRACE (_T("Text with close parenthesis) before colon: Text after colon\n"));
              TRACE (_T("Text with (text inside parenthesis) before colon: Text after colon\n"));

              then the Visual Studio output window displays

              Text before colon: Text after colon
              Text with parenthesis() before colon
              Text with open parenthesis( before colon
              Text with close parenthesis) before colon: Text after colon
              Text with (text inside parenthesis) before colon

              Interestingly, if I select the text in the output window and paste it to notepad, I get

              Text before colon: Text after colon
              Text with parenthesis() before colonText with open parenthesis( before colonText with close parenthesis) before colon: Text after colon
              Text with (text inside parenthesis) before colon

              Stephen C. Steel Kerr Vayne Systems Ltd.

              M 1 Reply Last reply
              0
              • S Stephen C Steel

                No, you aren't being paranoid - there is a bug in Visual Studio version 6.0. The TRACE macro ultimately uses OutputDebugString(), and along the way the application name gets prepended to the output. Visual studio has a filter that attempts to strip the application name before showing the text in the output window, but it is buggy.

                If I add the following code to my application

                TRACE (_T("Text before colon: Text after colon\n"));
                TRACE (_T("Text with parenthesis() before colon: Text after colon\n"));
                TRACE (_T("Text with open parenthesis( before colon: Text after colon\n"));
                TRACE (_T("Text with close parenthesis) before colon: Text after colon\n"));
                TRACE (_T("Text with (text inside parenthesis) before colon: Text after colon\n"));

                then the Visual Studio output window displays

                Text before colon: Text after colon
                Text with parenthesis() before colon
                Text with open parenthesis( before colon
                Text with close parenthesis) before colon: Text after colon
                Text with (text inside parenthesis) before colon

                Interestingly, if I select the text in the output window and paste it to notepad, I get

                Text before colon: Text after colon
                Text with parenthesis() before colonText with open parenthesis( before colonText with close parenthesis) before colon: Text after colon
                Text with (text inside parenthesis) before colon

                Stephen C. Steel Kerr Vayne Systems Ltd.

                M Offline
                M Offline
                moredip
                wrote on last edited by
                #7

                I don't think this is the issue in my case, as I'm not using paretheses. But thanks anyway, it's always useful to know stuff like that! Pete

                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