0

I've looked up video tutorials on this that seems to focus just on how to debug a single file.

I'm running a simulation code that probably goes through 100s different python and C++ source files. There's a particular spot in a python function that I want to set a breakpoint for. I have set the breakpoint.

I usually run the simulation code with

python3 path/to/sim/directory path/to/input

How can I use this command with the debugger in VSC?

24n8
  • 1,898
  • 1
  • 12
  • 25
  • Please read this https://stackoverflow.com/questions/50899347/how-do-i-debug-a-cli-with-vscode – exan Dec 20 '22 at 01:58

1 Answers1

0

You can read document for more information.

First select the Run view in the sidebar:

enter image description here

If you don't yet have any configurations defined, you'll see a button to Run and Debug and a link to create a configuration (launch.json) file:

enter image description here

To generate a file with Python configurations, do the following steps:

Select the create a launch.json file link (outlined in the image above) or use the Run > Open configurations menu command.

A configuration menu will open from the Command Palette allowing you to choose the type of debug configuration you want for the opened file. For now, in the Select a debug configuration menu that appears, select Python File.

enter image description here

Then you can use debug mode to run python file.

enter image description here

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13