Eclipse/MinGW/CDT/GDB and problems with debugging

12,156

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.

Share:
12,156
michaeluskov
Author by

michaeluskov

Updated on July 19, 2022

Comments

  • michaeluskov
    michaeluskov almost 2 years

    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?

  • DCurro
    DCurro almost 10 years
    I don't have a Standard Create Process; just the first displayed option, and Legacy Create Process.
  • Tzafrir
    Tzafrir over 9 years
    standard was renamed to legacy. bugs.eclipse.org/bugs/show_bug.cgi?id=426586
  • ransh
    ransh over 9 years
    Thanks that solved the issue for me, but I wander why Dsf does not function correctly
  • Elod
    Elod about 9 years
    I have a project from Makefile with existing code and I have the same problem, but I can't find this menu option? Is it in the Makefile this setup or am I missing something?
  • greatwolf
    greatwolf about 9 years
    @Elod Which version are you using and do you mean you cannot find 'Preferences'
  • Elod
    Elod about 9 years
    I'm using Eclipse Version: 3.8.1 and the Run/Debug Settings has no drop-down option (only one window, with my launch configurations). The debugging stops at a line: if (this->nextState != NULL) delete this->nextState;. No error massage and if I execute if step, than application stops: The target endianness is set automatically (currently little endian) <terminated, exit value: 0>gdb
  • greatwolf
    greatwolf about 9 years
    @Elod Perhaps give Luna SR2 release a try -- it comes packaged with CDT 8.6.0. I just checked it out and the setup is the same except its renamed to Legacy Create Process as tzafrir pointed out. Make sure you have [Debug] selected in the 'Launch Type/Mode' otherwise 'Preferred Launcher' will be empty.