avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] Making GDB automatically set its target?


From: Ned Konz
Subject: Re: [avr-chat] Making GDB automatically set its target?
Date: Sat, 11 Feb 2006 21:14:11 -0800


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
address@hidden






reply via email to

[Prev in Thread] Current Thread [Next in Thread]