bug-ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ddd parses all program output


From: Zobell, Stephen M.
Subject: ddd parses all program output
Date: Thu, 17 Nov 2005 15:25:51 -0500

It appears that ddd has to parse all the output from the debugged program. I presume it is looking for output from gdb. This causes two major problems:
  1. ddd can have extreme CPU load if the debugged program has a large amount of output to stdout. In one case I have a bash script that also looks at the output, and I find ddd uses at least 4 times the CPU as my script. The script only looks for exact matches, but uses a bash "while" loop which I expect to be slow. I have seen ddd use the whole CPU on a fast machine.
  2. ddd can mistake the debugged program output for gdb output, and can become confused. In one case, the program was outputting text that started with "1:" and ddd interpreted this as an update to display #1 in the data window and wrote the text there. When this happens, I also do not get the "Program exited normally." at the end that I usually get.
I think it is too easy to stumble on printf statements that cause ddd to misbehave, and people should not have to change their program to accommodate the debugger (in some cases I do not even have control of the offending software).
 
My suggested fix is to request a change to gdb where there is an optional command line argument to gdb that sets a string that gdb will prefix to all output from gdb. This string will default to "" (it will not effect anyone who does not use this feature). ddd can set the string at gdb startup to "#GDB#" or something unique and unlikely to be used by anyone. So, gdb will say "#GDB#1:..." instead of "1:...". This will speed ddd up because it only has to parse lines that start with that string, and will also greatly reduce the chances that program output can be mistaken for gdb output.
 
I am running ddd version 3.3.10 on a Red Hat Enterprise 3 server (linux version 2.4.21-32.0.1.ELsmp).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]