[<<][arm][>>][..]
Thu Jun 23 14:39:51 CEST 2011

arm.run

#!/bin/bash


# --- config
GDB=arm-eabi-gdb-7.2
OPENOCD_HOST=openocd
OPENOCD_PORT=3333

# --- code

[ -z "$1" ] && echo "usage: $0 <arm.elf>" && exit 1
ELF=$1

# ELF=/home/tom/dbb_trailer/build/out/arm/test-blockmanager

# LOAD_COMMAND=load

CMD=`mktemp`
cat<<EOF >>$CMD

# Load file for debugging symbols
file $ELF

# Connect to OpenOCD
target remote $OPENOCD_HOST:$OPENOCD_PORT

# Flash the file if requested.
echo Flashing...\n
$LOAD_COMMAND

# Reset target
monitor slow_reset init

# Give a couple of harmless instruction step commands starting from
# the boot vector.  The first stepi is a workaround for this:
#
#   stepi ignored. GDB will now fetch the register state from the target.
#
# which is a GDB bug workaround in OpenOCD, preventing the app from
# starting on a "continue".  The subsequent ones are a workaround for
# an old sync problem that seems to have disappeared.
stepi
stepi
stepi

# Run until the test is done
thbreak cyg_test_exit
continue

# Cleanup & exit
shell rm $CMD
quit
EOF

exec $GDB --command=$CMD




[Reply][About]
[<<][arm][>>][..]