www.ShoppingPodder.com

Leading Computer Shopping,
News and information


Part of the Identityscape.com network...

getxfactor.com jmoodmusic.com smartbusinesschoices.com mintdepot.com lowfaresalways.com evangelicalview.com shoppingpodder.com soproudlywehail.com webnews.ws currenthumor.com

 

 

not enough code space to debug
   Shopping Podder - the Best of Computer Postings! Forum Index -> Computer Architecture - Embedded  
View previous topic :: View next topic  
Author Message
Bill
Guest






PostPosted: Fri Nov 14, 2008 7:01 pm    Post subject: not enough code space to debug Reply with quote

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
Back to top
Peter Dickerson
Guest






PostPosted: Fri Nov 14, 2008 7:54 pm    Post subject: Re: not enough code space to debug Reply with quote

"Bill" <a@a.a> wrote in message
news:ejtqh4lmrcc9b5j7qo5ouv7kluis4iouj8@4ax.com...
Quote:
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
Back to top
Andrew Jackson
Guest






PostPosted: Sat Nov 15, 2008 2:58 am    Post subject: Re: not enough code space to debug Reply with quote

Bill

Quote:
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
Back to top
Bill
Guest






PostPosted: Sat Nov 15, 2008 5:05 pm    Post subject: Re: not enough code space to debug Reply with quote

I found exactly what I needed. In this environment, the option is
called "Enable Unused Symbol Removal" (I need to set it to Yes) under
"Build Options" of the properties of your solution. I have
significantly more free code space now. Using the sept-by-step
debugger, I see that some functions of several classes don't take now
space in the chip because now I don't see dots (to the left of their
lines) where I can put breakpoints.

At the lower level (at the calls to GCC), it must be doing what you
guys said. Thank you.
Back to top
Display posts from previous:   
   Shopping Podder - the Best of Computer Postings! Forum Index -> Computer Architecture - Embedded  
Page 1 of 1
All times are GMT

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum