[ECOS] GDB and Symbol Debug need help
pb.jack
pb.jack@powerbase.com.tw
Fri Jul 2 04:31:00 GMT 2004
Hi,
I'm newbie or eCos, my toolchain is win2k+eCos+GDB+Multi-ICE, I can have
my test program running on the target board now, however, I can't view
the symbol value from the GDB, I suspect there are something wrong in my
compile and link setup, can somebody take a look at my makefile?
---------------------------------------------------------
Build.bat
set path=c:\cygwin\tools\arm\H-i686-pc-cygwin\bin;c:\cygwin\bin;%PATH%
set root=d:
rem make -f makefile ram.elf
make -f makefile run.bin
copy /y run.bin \downfiles\run.bin
pause
----------------------------------------------------------
makefile
#=======================================================================
======
# Link makefile
#=======================================================================
======
# Author : Gary Chen
# Date : 11/06/2001
# Description: To generate a .ELF file
#=======================================================================
======
#export ROOT :=
export ECOS_INC := $(ROOT)/ecos/ram_build/install/include
export ECOS_RUN_LIB := $(ROOT)/ecos/ram_build/install/lib
export ECOS_GDB_LIB := $(ROOT)/ecos/ram_build/gdb/install/lib
export LIBPATH = $(ROOT)/ecos/project/lib
export SRCPATH :=$(ROOT)/ecos/project/src
export OBJPATH :=$(ROOT)/ecos/project/obj
export COMMAND_PREFIX := arm-elf-
export CC := $(COMMAND_PREFIX)gcc
export LD := $(COMMAND_PREFIX)ld
export OBJCOPY := $(COMMAND_PREFIX)objcopy
export AR := $(COMMAND_PREFIX)ar
export MAKE := make
export ADDLIB := $(ROOT)/ecos/project/bin/addlib
export ADDIMGHD := $(ROOT)/ecos/project/bin/addimghd
export CHMOD := chmod
CFLAGS := -mcpu=arm7tdmi -mno-short-load-words -Wall -Wno-implicit
-Wno-uninitialized -Wno-undef -Wno-unknown-pragmas -Wno-unused
-Wpointer-arith -Wstrict-prototypes -Winline -Wundef
-Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections
-fno-rtti -fno-exceptions -fvtable-gc -finit-priority
-Wno-strict-prototypes
LDFLAGS := -mcpu=arm7tdmi -mno-short-load-words -g -nostdlib
-Wl,--gc-sections -Wl,-static
#LDFLAGS = -X -N
ECOS_RUN_MODULE := $(ECOS_RUN_LIB)/target.ld
ECOS_GDB_MODULE := $(ECOS_GDB_LIB)/target.ld
#-----------------------------------------------------------------------
------
LIBFILES := libsys.a libconsole.a
ECOSRUNLIB = $(ECOS_RUN_LIB)/libtarget.a
ECOSGDBLIB = $(ECOS_GDB_LIB)/libtarget.a
#-----------------------------------------------------------------------
------
SOURCES := $(foreach dir,$(LIBFILES), $(LIBPATH)/$(dir))
.PHONY: run.elf clean
run.elf: makefile
$(CHMOD) -f 777 $(ECOS_RUN_MODULE)
$(ADDLIB) $(ECOS_RUN_MODULE) $(LIBFILES)
$(MAKE) -r -C $(ROOT)/ecos/project/src/sys libsys.a.stamp
$(MAKE) -r -C $(ROOT)/ecos/project/src/console libconsole.a.stamp
$(CC) $(LDFLAGS) -g -o $@ -L$(ECOS_RUN_LIB) -L$(LIBPATH)
-T$(ECOS_RUN_MODULE)
@echo "<finish to build "$@">"
run.bin: run.elf
# $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
# $(OBJCOPY) -O srec $< $(@:.bin=.srec)
# $(OBJCOPY) -O srec --change-address=0x0 $< $(@:.bin=.ppcbug)
# $(OBJCOPY) -O srec --change-address=0x0100000 $< $(@:.bin=.ppcbug)
$(OBJCOPY) -O binary $< $@
@echo "<finish to build "$@">"
clean:
$(MAKE) -r -C $(ROOT)/ecos/project/src/sys $@
$(MAKE) -r -C $(ROOT)/ecos/project/src/console $@
@rm -f $(LIBPATH)/libsys.a
@rm -f $(LIBPATH)/libconsole.a
@echo "<end of clean>"
Thank advance
Jack
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list