Skip to content
Pavel S. Smirnov edited this page Nov 23, 2016 · 4 revisions

GDB Build and install

Prerequisites

libexpat, python2.7-dev

Configure

Setup environment variable:

export RISCV=/home/tools32i/riscv32i

Go to work directory and invoke configuration script:

<path to configure>/configure --prefix=$RISCV --target=riscv32-unknown-elf --enable-targets=riscv32-unknown-elf

Then build

make

and then install to /home/tools32i/riscv32i/bin

make install

Debug with openocd and riscv32-unknown-elf-gdb

Run openocd (example):

src/openocd -f tcl/interface/ftdi/olimex-arm-usb-ocd-h.cfg -f tcl/target/syntacore_riscv32i.cfg

In other console run gdb:

riscv32-unknown-elf-gdb ./Debug/hello_riscv

Connect with openocd

target remote localhost:3333

Halt to access target

monitor halt

Load program

load

Setup breakpoints, etc. Run program:

c

Press CTRL-C To break execution

GDB command monitor ... pass arguments directly to openocd