• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Template Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Template Problems


  • Subject: Re: Template Problems
  • From: Mike Jackson <email@hidden>
  • Date: Thu, 4 Aug 2005 16:52:06 -0400

And it just gets even better... Using Eclipse 3.1 and the latest CDT Tools integration build from Jul 29 will allow me to set and actually stop at breakpoints set inside the template function.

Anyone have any comments?

Mike Jackson
On Aug 4, 2005, at 2:25 PM, Mike Jackson wrote:

I went back through all my projects and set the debug symbols to "ALL". Still no luck stopping at a breakpoint.

Mike
On Aug 4, 2005, at 1:54 PM, Mike Jackson wrote:


I tried the following in a "test" project: In main.cpp

#include <iostream>

template <class T> class Printer  {
public:
  static void print(const T&t) {
    std::cout << t << std::endl;
}
};

int main (int argc, char * const argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
  Printer<int>::print(10);
  Printer<double>::print(10.5);
    return 0;
}


The debugger will stop in the template just fine. In my case, the template code is in _another_ project that is referenced by the current project, and the template code is in a .h file. Don't know if this makes a difference or not. I am still too new to C++/Xcode to know. I did double check that Optimization is OFF in all the projects, although I will double check that.


Mike Jackson

On Aug 4, 2005, at 10:28 AM, Andreas Grosam wrote:




On 04.08.2005, at 15:38, Wade Girard wrote:




First this to do is to verify that you are generating debug symbols, the second is to verify that optimizing is OFF. Note that setting it to none -o0 is not off.



according the doc, -O0 optimization is indeed off and is the default. But -O isn't off, did you mean this?

My experience is, that there are (still) a lot of troubles with the debugger especially with templates - not only regarding synchronizing with the source.

What may confuse source synchronizing (even with -O0):
Long comments at arbitrary positions in the file
Macros, multi line
templates
static inline functions
breakpoints in member initializer lists



Although it is better than it was in XCode 1.5, this *may* happen frquently - not always and it is not always reproducible. I have no workaround for this problem.
If it happens, i try several other things to solve my original problem - typically loosing a lot of time and getting disappointed and annoyed.


When having templates, I also recommend to close the assembly window, since there might occure more troubles: if this happens, the debugger just refuses to work at all. Furthermore, it is a bit faster, so one step only takes 2 seconds instead of 3.


Andreas





The only way that I know of to do this is to use a xcconfig file and have/add the following two lines


GCC_DEBUGGING_SYMBOLS = full
GCC_OPTIMIZATION_LEVEL =

On Aug 4, 2005, at 7:47 AM, Mike Jackson wrote:




I'll try again.
  The debugger is ignoring breakpoints set inside a template
function. How do I get the debugger to actually stop at those
breakpoints?

Stats: Xcode 2.1. OS X 10.4.2. PB 1.67/1.5GB RAM

Thanks for any Help
---
Mike Jackson
mike _at_ bluequartz dot net


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40kpgraphics.
com


This email sent to email@hidden




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40onlinehome.de


This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bluequartz.net


This email sent to email@hidden



--- Mike Jackson mike _at_ bluequartz dot net


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bluequartz.net


This email sent to email@hidden




--- Mike Jackson mike _at_ bluequartz dot net


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bluequartz.net


This email sent to email@hidden



--- Mike Jackson mike _at_ bluequartz dot net


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Template Problems (From: Mike Jackson <email@hidden>)
 >Re: Template Problems (From: Wade Girard <email@hidden>)
 >Re: Template Problems (From: Andreas Grosam <email@hidden>)
 >Re: Template Problems (From: Mike Jackson <email@hidden>)
 >Re: Template Problems (From: Mike Jackson <email@hidden>)

  • Prev by Date: Re: CodeWarrior-style inline assembly help...
  • Next by Date: Re: CodeWarrior-style inline assembly help...
  • Previous by thread: Re: Template Problems
  • Next by thread: dynamic_cast between modules
  • Index(es):
    • Date
    • Thread