Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!wuarchive!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.sys.amiga.programmer Subject: Re: Debugging C++ Message-ID: Date: 6 May 91 17:57:32 GMT References: <42022@cup.portal.com> Sender: davidm@cimshop.UUCP Organization: Consilium Inc., Mountain View, California Lines: 47 In-reply-to: Lee_Robert_Willis@cup.portal.com's message of 5 May 91 20:40:35 GMT >>>>> On 5 May 91 20:40:35 GMT, Lee_Robert_Willis@cup.portal.com said: Lee> re: Comeau C++ and debugging: Lee> Why would one need a name-demangler if the debugger shows C++ source code? Lee> Do you see my confusion? Based solely on whats posted here on the net, Lee> (which is all the information I currently have) I am forced to conclude Lee> that using CPR to debug C++ is going to give me (at best) some sort of Lee> bastard hybrid environment, where the display shows C++ sometimes, and Lee> name-mangled C at others. I think I'm beginning to get the idea of what Greg is saying, but I don't have C++ yet, so I can't confirm it (I also don't have SAS/C). Basically, what you said in this paragraph is correct, but, because of the closeness of C and C++, it may not be as bad as you think. Basically, I'll bet that the compiler uses what are in the '#line' directives to determine the name and line number of the source file it is currently processing. This is how the standard C compiler with a C preprocessor as a separate step works. C++ just does the same thing that CPP does. CPR would, therefore, know where it is at anytime in debugging an executable, but, if you ask it about a variable's value, it would still interpret the name by C conventions. Since you are looking at C++ names (not C names), you have to do a little interpretting for CPR. This really is not any different than working on YACC and LEX code. Lee> If you post some source code and compiled executables, I can see for Lee> myself. Try creating a fairly large text file (it doesn't matter what's in it) and then build a C file that has '#line' directives in it that point to the text file. Compile the C file with debugging on and run it through CPR to see what it looks like. I'll bet that CPR shows the text file. The difference between this and C++ is that C++ would be a lot closer to C than the text file, so stepping through the program would make more sense. Remember, this is what's available now. If I interpret Greg correctly, things could only improve. It depends on what you are after, though. An integrated environment would make building Amiga programs easier, but they might be specific to a compiler. A C++ to C translator could make moving your program from system to system easier because you wouldn't need a C++ compiler everywhere (provided you build your C++ correctly). -- ==================================================================== David Masterson Consilium, Inc. (415) 691-6311 640 Clyde Ct. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"