Pope B.Lei
Pope B.Lei

Reputation: 31

How to connect gdb debug chain for RISCV spike in jetbrains CLion?

RISCV behavior model SPIKE, support debugging through rbb port. So we can debug it by gdb.

In the following picture, I setup SPIKE rbb_port at :18700, openocd connect to spike and service at :3973, gdb connect to openocd via :3973.

                                  :3973             :18700

It likes this: riscv64-unkonwn-elf-gdb --------> openocd --------> rbb of SPIKE

gdb connect to spike

You can found we use a specified gdb.

**I think i can debug elf file on SPIKE after mounting these tools (riscv64-unkonwn-elf-gdb) into jetbrains CLion. **

I tried some configuration in CLion, But not work.

I tried two configuraion

  1. Remote debug. This looks like debug remote target via some data path.

remote debug config

  1. OpecOCD download. This looks like meet my request, but i can specify my openocd file to do any more.

OpenOCD config OpenOCD result

OpenOCD location

I manual specify a formal openocd path, It make sense. setting openocd successful

====================== BUT =====================================

Clion need tcl_port do some thing. Is any one know this isuue?

CLion run error info

CLion debug error info

dobule check, gdb do not need tcl_port from openocd.

Upvotes: 0

Views: 403

Answers (1)

Pope B.Lei
Pope B.Lei

Reputation: 31

Solution: Creating an "Embedded GDB Server" run/debug configuration (https://www.jetbrains.com/help/clion/embedded-gdb-server.html#gdbserver-config) and recreate in it everything in the command line.

Upvotes: 0

Related Questions