Debugger stops program when stepping from the opening brace line to the first line of the function.

Morten Volden mvolden2 at gmail.com
Thu Dec 29 21:42:04 UTC 2011


Hi All

I have been experiencing some problems with the debugger.

I have a piece of code that looks something like this:

#include <iostream>

#include <string>
#include <fstream>

class TestParse
{
public:
    void parseConfigFile(std::string const& filename)
    {
        std::ifstream is(filename.c_str());

        std::string line;
        while(std::getline(is, line))
        {
            if(line.empty() || line[0] == '#')
            {
                std::cout << "Empty line or comment" << std::endl;
                continue;
            }
            if(line[0] == '[')
            {
                std::cout << "Section" << std::endl;
                continue;
            }
            std::cout << "Parameters" << std::endl;
        }
    }
};


int main(int argc, char **argv)
{
    TestParse test;

    test.parseConfigFile(argv[1]);
    return 0;
}

When I step into the 'parseConfigFile' function the debugger stops the
program stops as soon as I step from the opening brace line to the first
line
of the  function.

Running the program in GDB works as expected.

The output of the 'Show internal commands' in the GDB window is here:

http://pastebin.com/4GhwmmB0

A courious thing: It indicates that a break point is attempted set in a
file that belongs to another project (That project was not even loaded
during debug session)

Any idea what is going on here?

--
- When the split is pulled, mr. Grenade is no longer our friend
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20111229/ec751ccb/attachment.html>


More information about the KDevelop-devel mailing list