CLion, GDB, Tests, and Path Mappings

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 debugging - GDBServer not starting or listening on port when run inside of Docker - Stack Overflow.

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/