Removing Debug Code from CodeWarrior with HC12

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Removing Debug Code from CodeWarrior with HC12

Jump to solution
2,821 Views
gabrielsiqueira
Contributor I
I am trying to remove all debug code from my build. I am using CodeWarrior 5.7.0 with MC9S12E64.
When I set the option "Output/ don't generate debug information" in the compiler options.
The linker gives me the message "File star12.c.o should contain DWARF information".

I am also setting the option "Output/ ELF/DWARF:strip simbolic information", and there is no problem with it but I am not sure if this is enought  to remove all debug code.

I am having space problems and I am trying to remove all the unused code that I can.
I'll apreciate any suggestion.

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,219 Views
CompilerGuru
NXP Employee
NXP Employee
Just to be sure, your space problem is on the HD on your PC, and not that you run out of space in the target app on the N64?

I would not disable the debug info generation because of disk space, I don't think that this is worth the effort. The only reason I see for not generating DWARF debug information is to distribute a static library. Anyway, as you noted, the startup code does require the debug information during the link stage.

If you are not using C++, you can delete the lib\hc12c\lib\cpp* files in the library, for me the take 80 MB,
and I hardly ever use them. lib\hc12c\hc12_lib.mcp can be used to rebuild them.
Also if you are really low on disk, the _Data folders on currently not used projects can be deleted, their content is recreated when you build the next time the corresponding project.

Daniel

View solution in original post

0 Kudos
Reply
4 Replies
1,220 Views
CompilerGuru
NXP Employee
NXP Employee
Just to be sure, your space problem is on the HD on your PC, and not that you run out of space in the target app on the N64?

I would not disable the debug info generation because of disk space, I don't think that this is worth the effort. The only reason I see for not generating DWARF debug information is to distribute a static library. Anyway, as you noted, the startup code does require the debug information during the link stage.

If you are not using C++, you can delete the lib\hc12c\lib\cpp* files in the library, for me the take 80 MB,
and I hardly ever use them. lib\hc12c\hc12_lib.mcp can be used to rebuild them.
Also if you are really low on disk, the _Data folders on currently not used projects can be deleted, their content is recreated when you build the next time the corresponding project.

Daniel
0 Kudos
Reply
1,219 Views
gabrielsiqueira
Contributor I
I am running out of space in the 64k flash target.
0 Kudos
Reply
1,219 Views
CompilerGuru
NXP Employee
NXP Employee
Debug information is not put into the flash, so that option wont help you then.

The first thing I would look at is the map file, check all the larger objects if they are reasonable, if they
can be optimized, if constants are in flash, if all the 64k are used completely.
Daniel

1,219 Views
bigmac
Specialist III
Hello,
 
Are you using floating point variables & libraries?  You will save considerable code space if these can be avoided.  The use of library functions, such as printf(), sprintf() also require considerable code size, particularly if they also have to accommodate floating point parameters.
 
Regards,
Mac
 


Message Edited by bigmac on 2008-09-30 04:48 PM
0 Kudos
Reply