raddebugger icon indicating copy to clipboard operation
raddebugger copied to clipboard

Working Directory Target option sometimes gets erased after re-launching raddbg

Open jakubtomsu opened this issue 5 months ago • 3 comments

I have a regular target set up in raddbg for launching my game, but it recently started erasing my working directory option after re-launch. This is annoying because it looks like the game crashed so it took a while to figure out the first time haha.

I have no idea why this is happening and can't see any pattern, it just sometimes slightly corrupts the config. But also I think if the executable is specified as full path raddbg should use the base path as the working directory.

I'm on the 0.9.20 ALPHA release.

jakubtomsu avatar Jul 11 '25 18:07 jakubtomsu

This may have been caused by something I just fixed in 45d1f8e58b9fff15af4587ef802691d3802bec03. Would you mind giving it another try?

ryanfleury avatar Jul 23 '25 23:07 ryanfleury

I just tried it with a build of the latest commit. The issue is still partially there, but I accidentally stumbled upon a fix on my side.

this was my old target config which is still broken:

target:
{
  enabled: 1
  executable: "buildsys.exe"
  label: hot
  arguments: "hotreload-run"
  debug_subprocesses: 1
  working_directory: ""
}

Which in raddbg shows up as this:

Image

Now, if I set the working directory to D:/projects/blockfps/ and close raddbg, the config field is still working_directory: "".

However if I directly set the working directory in the config file to ../blockfps (which is the root path of my project relative to raddbg install directory), and launch raddbg again, it magically works.

So the issue is fixed for me at the moment, however there is still something weird going on. So I suppose I can leave this issue open.

jakubtomsu avatar Jul 24 '25 19:07 jakubtomsu

I am also running into this on 6543dad.

From my perspective the issue looks like this: In the debugger UI I set the working directory to be a different directory to the target executable, I use an absolute path. Then when I start debugging everything is fine. However when I save the project file, restart the debugger, open the project file again, the working directory field is empty in the UI so I have to set it again. The project file on disk has an empty string for "working_directory".

I have not read the code but I think this might be happening because the debugger interprets an empty working directory path to mean the same directory as the target executable? But I think it may also try to convert absolute paths into paths relative to the project file when it saves. In my case I set the working directory to the same directory that the project file is in, this would result in an empty path.

yyamdev avatar Aug 02 '25 11:08 yyamdev