I am calling an executable through a Python subprocess and would like to be able to debug the C++ code behind the exe. The C++ code and Python code are open in two Visual Studio instances. I have tried attaching the C++ to the Python Visual Studio so that the break points get hit when I run the Python subprocess code, but that doesn't seem to work. Any ideas how to do this?
Asked
Active
Viewed 154 times
0
-
1You can attach the debugger to the running process, but I would probably just try to launch the program in the debugger with the same input as comes from python. – cmd Jun 27 '14 at 15:47
-
Attaching the debugger to the C++ is the best thing to do, but give us some context - does it crash straight away so you don't get a chance? What's going wrong? Does the C++ run OK when you manually run it from a command line? – doctorlove Jun 27 '14 at 15:49
-
The C++ is working fine from command line but not through Python subprocess. The process gets started but fails immediately with an error that seems odd, that's why I would like to debug it. Would I have to attach VS to the Python code or the command window that appears when I run the Python code? – Anne Jun 27 '14 at 15:53
-
How do you know it gets started? What error do you get? Can you post the python code? Can you make python start something else, e.g. just notepad? – doctorlove Jun 27 '14 at 16:05