Connect to an existing (running) GDB target

已回答

I want to debug a Zynq7000 using CLion. I'm able to build the executable from CLion and I'm also able to debug it using the standard GDB. For this, I first do some Xilinx-specific nonsense using their tools. Then I can debug via

$ arm-none-eabi-gdb  <path to executable>
 (gdb) target remote localhost:3000
 (gdb) load

etc. and it works with breakpoints and everything. 

Since CLion also uses GDB internally, I expect it's possible to have the CLion UI to the GDB session. But how?

I looked at the “Remote GDB Server configuration” but I don't want to start a server, since the server is already running.

I also tried the “remote debug” configuration. It says: “Debugger connected to tcp:localhost:3000”, and in the menu `Debugger/DGB` I see a line number and function name that match my program. But now what?  It just does nothing beyond that point. How do I get it to show that position in the code? Make a break point? Write a custom GDB command and have it transmitted?

0

Hello!

I also tried the “remote debug” configuration. It says: “Debugger connected to tcp:localhost:3000”, and in the menu `Debugger/DGB` I see a line number and function name that match my program. But now what?

First, you need to place a breakpoint in your code in CLion, and then start a debug session - https://www.jetbrains.com/help/clion/remote-debug.html#start-remote-debug.

0

Thanks for the response and sorry for the long break! In any case, this does not work for me. Setting a breakpoint before starting the “remote debug” does not change the behavior.

I get the message “Debugger connected to tcp:localhost:3000” and I'm able to pause/stop the session, which does actually affect the hardware. However, if I pause the session (using the “Pause Program” button in the debugger tab), it says “Debugger was unable to disassemble function containing address …: Cannot access memory at address”. Again, using the standard `arm-none-eabi-gdb` works fine.

0

请先登录再写评论。