3

I'm trying to debug a C++ application with Eclipse.

Used program versions:

  • Eclipse: 4.4 Luna SR2 on Debian Linux (Jessie)
  • GDB: 7.7.1
  • GCC: 4.9.2

My intention is to understand what's happening inside a stream and to learn about the internals of the stringbuf class:

#include <iostream>
#include <stdio.h>
#include <sstream>

int main()
{
    printf("Hello C world!\n");

    std::cout << "Hello C++ world!" << std::endl;

    std::ostringstream my_ostringstream;
    std::stringbuf* my_p_stringbuf;

    my_p_stringbuf = my_ostringstream.rdbuf();
    std::cout << my_p_stringbuf->sbumpc();
}

What I try is to step into every single line of the code in main.

The (to me surprising) result is that the only line eclipse actually tries to step into is the call to printf, which issues a warning: Can't find a source file at "/build/glibc-Y1PEyp/glibc-2.19/libio/ioputs.c" That's fine for me, as eclipse and gdb tell me they are looking for a file and it's missing.

But stepping into any other line doesn't work, eclipse steps over all the other calls without issuing a warning.

How can I step into the call for std::cout operator << and the other function calls?

1
  • I too am having the same problem... Shame nobody has answered... Sep 11, 2015 at 23:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.