Debugger fails to start but gdb works fine [message #1101589] |
Wed, 04 September 2013 17:10 |
Andrew Falanga Messages: 2 Registered: September 2013 |
Junior Member |
|
|
Hi,
Quite new to using Eclipse for C/C++ development and especially debugging. My teams project is now supported on Linux (formerly Windows only). I'm investigating Eclipse for debugging. While familiarizing myself with the tools I've run into a rather weird problem for which I'm not sure how to proceed.
In order to become familiar with the Eclipse debugger, and editor, I started Kepler and made the "Hello World" project to try few things. I have the following source for EclipseTest.cpp:
#include <iostream>
#include <vector>
#include <string>
// mainly seeing how the debugger handles nested stl types
int main() {
std::cout << "!!!Hello World!!!" << std::endl; // prints !!!Hello World!!!
std::vector<int> intv;
std::vector<std::string> strings;
std::vector<std::vector<std::string> > manyStrings;
intv.push_back(44);
strings.push_back("The first string");
strings.push_back("The second string");
//manyStrings.push_back(std::vector<std::string>());
//manyStrings.back().push_back("This string is in the first vector");
//manyStrings.push_back(std::vector<std::string>());
//manyStrings.back().push_back("This string is in the second vector");
//std::cout << manyStrings[0].back() << std::endl;
//std::cout << manyStrings[1].back() << std::endl;
return 0;
}
With the code as above, I can start the debugger just fine in Eclipse. However, if I uncomment the commented lines inside of main(), the debugger starts up and promptly stops complaining, "<terminated, exit value -1> gdb". This happens before even breaking at main().
Considering the simplicity of the code, this seemed strange. I went to the command line and started gdb manually, adding the directory for my sources to the search paths, and stepped my way through the code just fine. I can also run the program from the command line with no problems. However, the debugger is choking. Can anyone explain why? What am I doing wrong?
If it's important, I'm using Eclipse Kepler on CentOS 6.2 32-bit. I downloaded the Eclipse tarball which had the CDT perspective.
Thanks for any help,
Andy
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03843 seconds