dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

not enough code space to debug - Arch

This is a discussion on not enough code space to debug - Arch ; Hi, I'm using Rowley Associates CrossStudio for ARM v1.7 build 4 (which relies on GCC C++ compiler) to develop a C++ program for an LPC2103. My problem is that I'm running out of code space (flash), mainly because some of ...


Home > Database Forum > Other Technologies > Arch > not enough code space to debug

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2008, 09:01 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default not enough code space to debug

Hi,

I'm using Rowley Associates CrossStudio for ARM v1.7 build 4 (which
relies on GCC C++ compiler) to develop a C++ program for an LPC2103.
My problem is that I'm running out of code space (flash), mainly
because some of the .cpp files I wrote have many class definitions,
even though some of those classes are never instantiated from my
application. I need to debug, so I need to keep all code optimizations
off. Is there any way, keeping optimizations off, to tell the linker
NOT to include the code for those classes that are never used by my
application?

Thank you.
Bill

Reply With Quote
  #2  
Old 11-14-2008, 09:54 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: not enough code space to debug

"Bill" wrote in message
news:ejtqh4lmrcc9b5j7qo5ouv7kluis4iouj8@4ax.com...
> Hi,
>
> I'm using Rowley Associates CrossStudio for ARM v1.7 build 4 (which
> relies on GCC C++ compiler) to develop a C++ program for an LPC2103.
> My problem is that I'm running out of code space (flash), mainly
> because some of the .cpp files I wrote have many class definitions,
> even though some of those classes are never instantiated from my
> application. I need to debug, so I need to keep all code optimizations
> off. Is there any way, keeping optimizations off, to tell the linker
> NOT to include the code for those classes that are never used by my
> application?


Firstly you would be better off to put each class in a separate file so that
other humans can find them then completely unreference files won't
contribute to code size.
Secondly make sure you don't use exception handling or run-time type info
(RTTI) because the take a lot of space. See -fno-rtti -fno-exceptions.
Thirdly the compiler and linker can conspire to remove unused, which might
not be everything you consider unused, but the object files need to be
prepared. See -ffunction-sections -fdata-sections for the compiler
and -Wl,--gc-sections for linker.

Peter


Reply With Quote
  #3  
Old 11-14-2008, 04:58 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: not enough code space to debug

Bill

> I'm using Rowley Associates CrossStudio for ARM v1.7 build 4 (which
> relies on GCC C++ compiler) to develop a C++ program for an LPC2103.
> My problem is that I'm running out of code space (flash), mainly
> because some of the .cpp files I wrote have many class definitions,
> even though some of those classes are never instantiated from my
> application. I need to debug, so I need to keep all code optimizations
> off. Is there any way, keeping optimizations off, to tell the linker
> NOT to include the code for those classes that are never used by my
> application?


You need to do a "garbage collected build" using gcc options:

-ffunction-sections
-fdata-sections

and ld options:

--gc-sections

Andrew
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 06:52 PM.