bug-ddd
[Top][All Lists]
Advanced

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

DDD bug regarding temporary breakpoints


From: Matheus Ribeiro
Subject: DDD bug regarding temporary breakpoints
Date: Wed, 27 Apr 2011 13:45:15 -0300

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:

        int at_index = answer.index(" at ");
        int br_index = answer.index("Break");
        if ( (at_index > 0) && (br_index < 0) )

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:

        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) )

This will avoid many weird messages like: cannot find file /usr/local/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.

Thanks
Matheus


reply via email to

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