Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse/MinGW/CDT/GDB and problems with debugging

I have some C++ code and try to debug it. main.cpp:

#include <iostream>
using namespace std;

int main() {
    graph<int> a;
    a.add(1);
    a.addEdge(1,2);
    std::vector<int> answ = a.getAdjacent(1);
    for (unsigned int i = 0; i < answ.size(); i++)
    std::cout<<answ[i]<<std::endl;
    return 0;
}

I have a breakpoint on "graph a;". But when I start debugging, I get:

The target endianness is set automatically (currently little endian)
No source file named C:\Users\home\workspace\graphcpp\main.cpp.
[New Thread 3552.0xdc8]

What's the problem?

like image 504
michaeluskov Avatar asked Nov 08 '13 16:11

michaeluskov


1 Answers

This seems to be a relatively frequent reoccurring issue when using eclipse +cdt with gdb. Changing the default launcher from GDB (DSF) Create Process to Standard Create Process seems to solve the issue most of the time.

You can find this option under Preferences->Run/Debug->Launching->Default Launchers:

Default Launchers

Also make sure you are compiling with -g debug info enabled.

like image 114
greatwolf Avatar answered Oct 07 '22 11:10

greatwolf