When attaching the debugger to a running process (Debug > Start Debugging > Attach to Running Application), the string containing the path to the process executable is incorrect whenever there is whitespace in the path.
For example, if the executable was found at
/Applications/My\ App.app/Contents/MacOS/My\ App
then the variable dExecutable would be evaluated
dExecutable = "/Applications/My"
and the debugging session would fail.