Author Topic: Problems (debugging) with standard C++ files  (Read 3341 times)

jaqq

  • Guest
Problems (debugging) with standard C++ files
« on: January 14, 2009, 02:58:44 am »
Hello.

I tried posting a similar question in another forum. Since I got no answer, I removed the earlier post and applied a few changes (for completeness). Here it is.

Apparently, Code Blocks doesn't understand that standard include files like vector and list are C++ files. I tried to configure that but I need I file mask. The problem is that such standard includes don't have extensions. I could use several file masks like *vector, *list, etc (using simply the whole name as the mask doesn't work). But of course this is boring. Is there a better solution?

Another related problem is that I can't debug into such files. In the standard library implementation I'm using the push_back method is implemented directly inside file vector. When I debug into push_back I can see from the debugger console (inside Code Blocks) that the debugger goes to the correct line. However, the editor doesn't open file vector and position the line in accordance to the debugger. I have already tried inserting the include directory in the search paths for the debugger. No success... When eventually processing goes to an ordinary .c, .cpp, .h files the debugger and the editor work together (matching lines in the files) again.

Just in case it's useful, I'm on GCC. But I'm not using the native standard library implementation. I'm using the Apache C++ Standard Library.

Thanks.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problems (debugging) with standard C++ files
« Reply #1 on: January 16, 2009, 08:16:02 am »
Please give a small test program that I can test for you.
By the way, I'm using the standard c++ library bundled with mingw. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Problems (debugging) with standard C++ files
« Reply #2 on: January 16, 2009, 09:32:38 am »
Just being curios: Why (except you develop a STL library yourself) would one ever want to debug into STL code?! :shock:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

jaqq

  • Guest
Re: Problems (debugging) with standard C++ files
« Reply #3 on: January 17, 2009, 07:39:48 pm »
Ollydbg, you don't really need a sample. Just call push_back and that's it. I can't debug inside it because as I said the debugger doesn't sync with the (no extension) source file. If push_back is implemented in a .h file of the standard library implementation that ships with mingw you probably won't be able to reproduce the problem. However, you might be able to reproduce it trying to debug inside a file with no extension.

MorteMacFly, your comment makes total sense. I'm not developing an STL version. However, I'm doing some work inside it. ;)