This happened to me more than once and led to the fact that many lost watches chased a ghost. As usual, when I debug some really complex time-related code, I start adding tons of calls to OutputDebugString (), so I can get a good idea of the sequence of related operations. The problem is that the Delphi 6 IDE seems to be able to handle this situation for so long. I will use the specific example that I just went through to avoid common ones (as far as possible).
I spent several days debugging my cross-threading semaphore code, as well as the DirectShow timestamp code, which caused some very annoying problems. After fixing every error that I could think of, I still had a problem with Skype , which my application sends audio to.
After about 10 seconds between my conversations and my hearing, my voice came out of Skype on the second PC, which I used for testing, at the far end of the call, it began to grow. After about 20-30 seconds, the delay began to increase exponentially, and at that moment a code was launched that checks if the critical section is too long.
Fortunately, it wasn't too late, and having done this earlier, I decided to stop relentlessly monitoring and disable most of OutputDebugString (). Fortunately, most of them were wrapped in a conditional compiler, so it was easy to do. At the moment I did this, the problems disappeared, and it turned out that my code was working fine.
So, it looks like the Delphi 6 IDE is starting to really be afraid when the amount of OutputDebugstring () traffic exceeds a certain threshold. Perhaps this is just the task of adding lines to the event log debug panel, which contains all the OutputDebugString () reports. I don’t know, but I saw similar problems in my applications when TMemo or a similar control starts to contain too many lines.
What have you done to prevent this? Is there a way to clear the event log through some method call, or at least a way to limit its size? Also, what methods do you use with conditional definitions, IDE plugins, or something else to handle this situation?
debugging logging delphi outputdebugstring
Robert Oschler
source share