Wed 27 Apr 2011 05:10:06 PM UTC, original submission:
There is a bug in DDD when setting temporary breakpoints (which is also used by other commands, like set execution point). The answer received from GDB is something like
Breakpoint X at ADDRESS: file FILENAME, line LINE. << for breakpoints
Temporary breakpoint X at ADDRESS: file FILENAME, line LINE. << for tbreaks
In PosBuffer.C, there is a function which parses gdb answers and acquires information from it: gdb_filter. This function tries several cases, one of them is the UP and DOWN command outputs, with this if statement:
<code>
int at_index = answer.index(" at ");
int br_index = answer.index("Break");
if ( (at_index > 0) && (br_index < 0) )
</code>
As can be see, it looks for an "at" string at sentence not started by Break. But his comparison is bugged for temporary breakpoints, the correct code is:
<code>
int at_index = answer.index(" at ");
int br_index = answer.index("Break");
int tbr_index = answer.index("Temporary break");
if ( (at_index > 0) && (br_index < 0) && (tbr_index < 0) )
</code>
This will avoid many weird messages like: cannot find file /usr/src/0x12345 for example. Also it will avoid many unecessary info sources by ddd trying to find this weird file. If anyone wants a patch, let me know.
|