Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Comp.Arch.Embedded | not enough code space to debug

There are 4 messages in this thread.

You are currently looking at messages 0 to 4.

not enough code space to debug - Bill - 2008-11-14 08:01:00

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

______________________________
Join the blogging team on EmbeddedRelated.com and earn rewards!



Re: not enough code space to debug - Peter Dickerson - 2008-11-14 08:54:00

"Bill" <a@a.a> wrote in message 
news:e...@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 


______________________________
Join the blogging team on EmbeddedRelated.com and earn rewards!

Re: not enough code space to debug - Andrew Jackson - 2008-11-14 15:58:00

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
______________________________
Join the blogging team on EmbeddedRelated.com and earn rewards!

Re: not enough code space to debug - Bill - 2008-11-15 06:05:00

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.
______________________________
Join the blogging team on EmbeddedRelated.com and earn rewards!