CLion, GDB, Tests, and Path Mappings

#1

I have managed to get rust compiling, running, and even debugging in a remote docker container through CLion. You can see some of my jorney at https://stackoverflow.com/questions/53871765/gdbserver-not-starting-or-listening-on-port-when-run-inside-of-docker/53874697#53874697.

I can set breakpoints in main and everything works as expected.

Now, I’m trying to tackle debugging a test. I can run tests fine through the cli. But, when I try to debug through a test, I enter the Dissembly Mode and break at Assembly Code. A quick search told me that is a problem with path mappings. That makes sense to me.

What I am doing is starting the GDBServer with the command cargo test. That starts up, pauses, and listens fine. Then, I try to debug and that also starts fine, but breaks in assembly code.

So, I guess my question is, does anyone know what the path mappings should be if you are debugging tests using gdbserver? I’ve tried with integration tests and unit tests. I’ve tried various directories on both sides.

My GDB Command: gdbserver localhost:7777 cargo test
My Run Configuration:

  • GDB: Bundled
  • ‘target remote’ args: tcp:localhost:7777 (docker ports properly exposed)
  • No symbol file (have tried using some from target/ with no luck
  • Path mappings (project dir -> project dir)

Any thoughts/

0 Likes