Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » gdb problems C++ with std::list
gdb problems C++ with std::list [message #1847548] Mon, 01 November 2021 08:49 Go to next message
Andreas Volz is currently offline Andreas VolzFriend
Messages: 1
Registered: November 2021
Junior Member
Hi,

I changed some days ago my debugging environment on Linux to Eclipse and was pretty happy.

Than in one application I got a gdb freeze always when jumping into a function. I was pretty helpless and started to search the problem in the environment. But after hours of searching I've a minimal test code that freezes gdb when jumping into testfunc(). The debug cursor jumps into the very first line of testfunc() and freezes there.

I need then to kill gdb to get Eclipse back in a working state. If i change the std::list to a std::vector I could debug into testfunc without any problems.

Did I make a so a stupid error that I don't see it? And if I run gdb in a text console I could step through this application without any issues.

void testfunc()
{
	cout << "1" << endl;
	cout << "2" << endl;
	cout << "3" << endl;

	list<int> cascFiles;
}

int main(int argc, const char **argv)
{
  testfunc();

  cout << "application end" << endl;

  return 0;
}


regards
Andreas
Re: gdb problems C++ with std::list [message #1847575 is a reply to message #1847548] Mon, 01 November 2021 16:19 Go to previous message
David VavraFriend
Messages: 1430
Registered: October 2012
Senior Member
STL containers with indefinite length (list, sets, etc.) have this problem before they are initialized.
CDT is trying to collect the contents but gets lost due to bad pointers.
The only solution I've found is to either only stop after the container has been initialized
or avoid using anything that will try to view its content (such as the Variables tab) before initialization.
I use the Expressions tab to view other variables when this occurs.
Previous Topic:"terminated" message
Next Topic:cannot create projects "No project types available"
Goto Forum:
  


Current Time: Tue Sep 27 17:27:19 GMT 2022

Powered by FUDForum. Page generated in 0.01904 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top