I have an application that is sensitive to the directory it gets invoked from — it loads some files using relative paths.
When I start the program through a debugger, how can I control what the initial current directory will be?
I'd prefer to avoid adding special code to the debugged program to make it call chdir
; my instinct is that the debugger should provide some way to specify that externally, since it's inherently an external setting anyway.
The debugger I'm using is TotalView, but I'm open to answers for other Linux debuggers since it could help me find a comparable setting in TV. I can specify environment variables when I invoke the program, so on a lark, I tried setting PWD
, but no luck.