avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] AVR-Insight and c++


From: Patrizio Zelotti
Subject: Re: [avr-gcc-list] AVR-Insight and c++
Date: Wed, 5 May 2004 22:41:47 +0200

On 3 May 2004 at 06:04, Eric Weddington wrote:

>>On 1 May 2004 at 21:14, Patrizio Zelotti wrote:
>>
>> Hi to all, 
>> 
>> First I would like to thanks all the people that are working on WinAVR; it 
>> is really a good tool. 
>> 
>> I'm using last WinAVR release ( WinAVR-20040404 ) and I use Avr-Insight and 
>> Avarice to debug code. 
>> 
>> Until now I've used C code and it all works ok.
>> 
>> Now I start using C++; I can compile C++ code, and debug it; the function 
>> names that appear in the debugger AVR-Insight on the function name list are 
>> modified; this is normal done by C++ compiler (name mangling if I remember), 
>> but on a different debugger on a different CPU that I use, the function 
>> names are listed as class::function name. 
>> 
>> Is possible to do the same on Avr-Insight ? 
>> 
>
>I'm not really sure. But I thought I would mention that I just saw a posting 
>on the gdb list that 
>version 6.1 has a new demangler for C++. *Maybe* this might have something to 
>do with it, I 
>don't know. Perhaps Ted Roth could comment on this. FYI, the next WinAVR 
>release should 
>include Insight (GDB) version 6.1, but I don't know when this release will be.
>
>Eric

Hi,
finally I discovered the problem : it was a fault in my makefile.
I wrote this makefile after I read a tutorial on make on an italian
Linux magazine; then I joined it with the previous makefile I used (from early
2.95 avr-gcc distribution).
Merging together the tutorial and the old makefile, the line

#EXT = cpp
EXT = c

%o: %$(EXT)
 $(CC) -c $(CFLAGS) $< -o $@

was missed.

With C source files, all is ok even if this line is missed.
When I changed the source extension from .c to .cpp (or .cc), make was
not able to compile; after some tries, I changed the compiler called
in the makefile from avr-gcc to avr-g++ leaving the source file
extension .c and writing in C++. The compiler did all ok, but gdb
considered C source files and not C++ files.
I have added the line missed, and now AVR-Insight shows the function names as
class::function.

I have attached the makefile I use : it is not commented, but changing
the LANGUAGE definition, can compile C and C++ projects with WinAVR.
Also, make find automatically the source files of the current directory.

Regards,
Patrizio Zelotti


reply via email to

[Prev in Thread] Current Thread [Next in Thread]