On Feb 11, 2006, at 5:20 PM, Rick Mann wrote:

I'd like to configure avr-gdb to connect to avarice on launch, without me explicitly having to type "target remote localhost:4242" each time. Is this possible?

Yes. Look at the Makefile template that's widely used with avr-libc.
I've modified it for my own needs, but it's informative anyway.
It creates a command script file for GDB and starts GDB with that script.

Here's a snippet from one I'm using right now that ought to give you some ideas...

# GDB Init Filename.
GDBINIT_FILE = __avr_gdbinit

JTAG_DEV = /dev/cu.usbserial0

DEBUG_UI = gdb
DEBUG_BACKEND = avarice

DEBUG_PORT = 4242
DEBUG_HOST = localhost

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

# Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set
#     a breakpoint at main().
gdb-config:
        @$(REMOVE) $(GDBINIT_FILE)
        @echo define reset >> $(GDBINIT_FILE)
        @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
        @echo end >> $(GDBINIT_FILE)
        @echo file $(TARGET).elf >> $(GDBINIT_FILE)
@echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $ (GDBINIT_FILE)
ifeq ($(DEBUG_BACKEND),simulavr)
        @echo load  >> $(GDBINIT_FILE)
endif
        @echo break main >> $(GDBINIT_FILE)

# check to see if avarice is still running (probably Mac OS X specific)
avarice:
        @ps -x | cut -c27- | grep -q '^avarice ' || \
avarice -I -D --mkII --jtag $(JTAG_DEV) --erase --program -- file $(TARGET).elf $(DEBUG_HOST): $(DEBUG_PORT)

debug: gdb-config $(TARGET).elf avarice
        avr-gdb --command=$(GDBINIT_FILE)


--
Ned Konz
[EMAIL PROTECTED]




_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to