Forum: Compiler & IDEs DWarf mit GCC3.4.0 funktioniert nicht


von jga (Gast)


Angehängte Dateien:

Lesenswert?

Hallo,

Habe mir die GCCTools installiert (mit avr-gcc 3.4.0.) und habe danach
mein makefile angepasst und compiliert. Soweit alles OK, aber beim
erzeugen der DWarf-Option (command Line) bekam ich eine Fehlermeldung,
dass mein uC, im speziellen meine SFR's(ich habe im Programm Ports
angesprochen), nicht unterstützt bzw. nicht erkannt wurde. Komisch,
wenn ich die WinAVR-Version (avr-gcc 3.3.2, glaube ich) benutze, dann
werden diese Ports (bzw. die SFR) erkannt.

Siehe auch die Command Line Screens(attached).

LG
jga

von jga (Gast)


Lesenswert?

Hallo nochmal,

Ach, ja hab was vergessen.

Könnt Ihr mir hier weiterhelfen. Danke

lg
jga

von Jörg Wunsch (Gast)


Lesenswert?

Warum nimmst Du nicht das neueste WinAVR?  Dessen GCC kann DWARF-2.

Achte auch drauf, daß Du vom AVR-Studio-ELF/DWARF-Parser die aktuelle
Version bekommst, ich kann mich an eine Aussage von Torleif Sandness
erinnern, daß es dafür noch einen Bugfix-Update gab.

von jga (Gast)


Lesenswert?

hallo jörg,

ich verwende die aktuellste winavr(20040720). Ich hab das makefile
angepasst, dies habe ich mit dem Mfile Tool gemacht. Nun kompiliert und
gelinkt. Alles OK, wie du im Anhang (Screens, compiling.gif) siehst.

Aber danach habe ich versucht über das command avr-debugdump -a
<source>.o mir die erweiterten debuginfos generieren zu lassen.
Dabei erhielt ich eine Fehlermeldung, siehe Anhang(Screens,
debugdump.gif).

Anbei habe ich mein sourcefile und das angepasste makefile
dabei(Screens, gcctest1 und makefile).

was ist da falsch?

lg
jürgen

von jga (Gast)


Angehängte Dateien:

Lesenswert?

irgendwie hat das mit dem upload nicht geklappt.

also nochmal.

von Jörg Wunsch (Gast)


Lesenswert?

Sorry, ZIP-Files mit Bildern für Fehlermeldungen packe ich mir nicht
erst aus.  Wenn Du Hilfe haben möchtest, dann leite bitte die
Fehlermeldungen mit normaler Ausgabeumlenkung in eine Datei um und
zitiere den relevanten Teil.  Zur Erinnerung: Ausgabeumlenung
funktioniert mit

kommando > fehlerdatei 2>&1

-- nicht nur in der Unix-Shell, sondern auch im cmd.exe.  Falls Du
noch ein MS-DOS mit command.com benutzt, sorry, Pech gehabt, entweder
auf ein zeitgemäßes Betriebssystem upgraden oder Du mußt es halt
abschreiben.

Ansonsten: es ist derzeit (leider) normal, daß die GNU binutils mit
DWARF-2 selbst nicht zurechtkommen, d. h. mittels avr-objcopy oder
avr-objdump wirst Du keine DWARF-2-Informationen verarbeiten können.
Da das Herstellen des erweiterten Listings (Disassembler +
eingebetteter C-Code) letztlich auf den Debug-Informationen beruht,
funktioniert das naturgemäß nicht.  Wenn Du unbedingt so ein Listing
brauchst (hmm, ich selbst hab's nie wirklich gebraucht), mußt Du
eigens dafür auf ELF+stabs als Debuginformation umstellen.

von jga (Gast)


Lesenswert?

Hallo Jörg,

ich verwende cmd.exe.

nun was meinst du was das beste wäre hinsichtlich debuggen?

ich möchte lediglich auf meinem 8515'er (stk200) das möglichste
herausholen an debuggen mit der aktuellsten winavr-version.

nachdem ein insystem debugging tool doch etwas kostet möchte ich daher
auf die möglichkeiten des winavr-pakets zurückgreifen.

varianten:
-debuggen mittels erzeugtem extcoff-file?(inwieweit sinnvoll)
-inwieweit ist simulavr+gdb sinnvoll?
..?

wo läuft denn dann die dwarf-debug methode?
ich bekomme andererseits die debugdump-einstellung im makefile
nicht richtig hin, denn beim aufruf von make all wird mein
debugdump-eintrag übersprungen? (siehe makefile unten)

##################################################################
# MCU name
MCU = at90s8515

# Output format. (can be srec, ihex, binary)
FORMAT = ihex

# Target file name (without extension).
TARGET = gcctest1


# List C source files here. (C dependencies are automatically
generated.)
SRC = $(TARGET).c


# List Assembler source files here.
# Make them always end in a capital .S.  Files ending in a lowercase
.s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =



# Optimization level, can be [0, 1, 2, 3, s].
OPT = s

# Debugging format.
DEBUG = dwarf-2

# List any extra directories to look for include files here.
EXTRAINCDIRS =


# Compiler flag to set the C Standard level.
# c89   - "ANSI" C
# gnu89 - c89 plus GCC extensions
# c99   - ISO C99 standard (not yet fully implemented)
# gnu99 - c99 plus GCC extensions
CSTANDARD = -std=gnu99

# Place -D or -U options here
CDEFS =

# Place -I options here
CINCS =


# Compiler flags.
CFLAGS = -g$(DEBUG)
CFLAGS += $(CDEFS) $(CINCS)
CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct
-fshort-enums
CFLAGS += -Wall -Wstrict-prototypes
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)



# Assembler flags.
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs



#Additional libraries.

# Minimalistic printf version
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min

# Floating point printf version (requires MATH_LIB = -lm below)
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt

PRINTF_LIB =

# Minimalistic scanf version
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min

# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt

SCANF_LIB =

MATH_LIB = -lm

# External memory options
defsym=__heap_end=0x80ffff

EXTMEMOPTS =

# Linker flags.
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)




# Programming support using avrdude. Settings and variables.
AVRDUDE_PROGRAMMER = stk200

# com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = com1    # programmer connected to serial device

AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep


# Uncomment the following if you want avrdude's erase cycle counter.
#AVRDUDE_ERASE_COUNTER = -y

# Uncomment the following if you do not wish a verification to be
# performed after programming the device.
#AVRDUDE_NO_VERIFY = -V

# Increase verbosity level.  Please use this when submitting bug
#AVRDUDE_VERBOSE = -v -v

AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)


# Define directories, if needed.
DIRAVR = c:/programme/atmel/avr tools/avrgcc
DIRAVRBIN = $(DIRAVR)/bin
DIRAVRUTILS = $(DIRAVR)/utils/bin
DIRINC = .
DIRLIB = $(DIRAVR)/avr/lib


# Define programs and commands.
SHELL = sh
CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
#########Add#############
DEBUGDUMP = avr-debugdump
#########################
SIZE = avr-size
NM = avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
COPY = cp




# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = --------  end  --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
###############Add####################################
MSG_EXTENDED_DEBUGINFO = Creating Extended Debuginformation:
#######################################################
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:




# Define all object files.
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)

# Define all listing files.
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)


# Compiler flags to generate dependency files.
GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,.dep/$(@F).d


# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)


# Default target.
all: begin gccversion sizebefore build sizeafter finished end

build: elf hex eep lss sym

elf: $(TARGET).elf
hex: $(TARGET).hex
eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym



# Eye candy.
begin:
  @echo
  @echo $(MSG_BEGIN)

finished:
  @echo $(MSG_ERRORS_NONE)

end:
  @echo $(MSG_END)
  @echo


# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) -A $(TARGET).elf
sizebefore:
  @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE);
$(ELFSIZE); echo; fi

sizeafter:
  @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER);
$(ELFSIZE); echo; fi

# Display compiler version information.
gccversion :
  @$(CC) --version

# Program the device.
program: $(TARGET).hex $(TARGET).eep
  $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
$(AVRDUDE_WRITE_EEPROM)

# Convert ELF to COFF for use in debugging / simulating in AVR Studio
or VMLAB.
COFFCONVERT=$(OBJCOPY) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000


coff: $(TARGET).elf
  @echo
  @echo $(MSG_COFF) $(TARGET).cof
  $(COFFCONVERT) -O coff-avr $< $(TARGET).cof

extcoff: $(TARGET).elf
  @echo
  @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
  $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof

# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
  @echo
  @echo $(MSG_FLASH) $@
  $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@

%.eep: %.elf
  @echo
  @echo $(MSG_EEPROM) $@
  -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
  --change-section-lma .eeprom=0 -O $(FORMAT) $< $@

# Create extended listing file from ELF output file.
%.lss: %.elf
  @echo
  @echo $(MSG_EXTENDED_LISTING) $@
  $(OBJDUMP) -h -S $< > $@

###############Add###################
# Create extended debug file from ELF output file.
%.dwarf: %.elf
  @echo
  @echo $(MSG_EXTENDED_DEBUGINFO) $@
  $(DEBUGDUMP) -a $< > $@
######################################

# Create a symbol table from ELF output file.
%.sym: %.elf
  @echo
  @echo $(MSG_SYMBOL_TABLE) $@
  $(NM) -n $< > $@



# Link: create ELF output file from object files.
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
  @echo
  @echo $(MSG_LINKING) $@
  $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)


# Compile: create object files from C source files.
%.o : %.c
  @echo
  @echo $(MSG_COMPILING) $<
  $(CC) -c $(ALL_CFLAGS) $< -o $@


# Compile: create assembler files from C source files.
%.s : %.c
  $(CC) -S $(ALL_CFLAGS) $< -o $@


# Assemble: create object files from assembler source files.
%.o : %.S
  @echo
  @echo $(MSG_ASSEMBLING) $<
  $(CC) -c $(ALL_ASFLAGS) $< -o $@
##################################################################


vielleicht kannst du mir diesbezüglich tipps geben was das beste hier
wäre?

jga

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.