The --dwarf2 option is for RVCT. You are not using RVCT - you will need to find the equivalent command-line option for your toolchain. I think WinARM is GCC-based. Looking around, the option you want might be "-gdwarf-2", but I'd advise you to look in the documentation and check. Hope this helps.
I have tried by including "--dwarf2" to the compiler option but it did not work. I am getting an compile error message "cc1.exe: error: unrecognized command line option "-fdwarf2"" . I compiled this using "WinARM". Please help me to solve this.