Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!harrier.ukc.ac.uk!mr3 From: mr3@ukc.ac.uk (M.Rizzo) Newsgroups: comp.sys.amiga.programmer Subject: Re: REVIEW: Comeau C++ compiler Keywords: programming, language, C++, compiler Message-ID: <7511@harrier.ukc.ac.uk> Date: 5 May 91 20:56:17 GMT References: <37228@ditka.Chicago.COM> <7482@harrier.ukc.ac.uk> <38213@ditka.Chicago.COM> Reply-To: mr3@ukc.ac.uk (M.Rizzo) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 47 In article <38213@ditka.Chicago.COM> comeau@csanta.attmail.com (Greg Comeau) writes: >In article <7482@harrier.ukc.ac.uk> mr3@ukc.ac.uk (M.Rizzo) writes: >>With older versions of GNU gdb there was a small utility g++filt ... > >Comeau C++ comes with a utility we call c++filt, c++filt.CC, or >comofilt depending upon the port (don't ask we why haven't standardized >the name please) that supports just such a demangling capability. Great stuff Greg! Why haven't you standardized the ... OOPS ! Sorry :-) A few days back I mentioned GNU gdb problems with g++. Here's one of them - it can't cast pointers properly with multiple inheritance (which may require that the value of the pointer be changed as defined in ARM pg 221). The following example demonstrates the problem class A { int a; }; class B { int b; }; class C : public A, public B { }; main() { C* pc = new C; B* pb = pc; // Implicit conversion here - add delta(B) } (gdb) br 10 Reading in symbols for demo.C...done. Breakpoint 1 at 0x22e4: file demo.C, line 10. (gdb) run Starting program: /usr/nfs/nutmeg/d1/users/mr3/a.out Bpt 1, main () (demo.C line 10) 10 } (gdb) print pc ::1 = (struct C *) 0x6d50 (gdb) print pb ::2 = (B *) 0x6d54 | Implicit cast causes 4 bytes to be added (gdb) print (B *) pc ::3 = (B *) 0x6d50 | Wrong ! Should be 0x6d54 as in ::2 above Although I haven't used CodeProbe much (and the last time I used it was ages ago) it should have the same problem debugging C++ code. >- Greg Michael Rizzo