Skip to content

Debugger with VSCode

Jeong YunWon edited this page Aug 2, 2022 · 3 revisions

With LLDB plugin, we can use VSCode debugger GUI with a rust software.

Interaction mode

image

RustPython project repository includes pre-defined debugger settings. In this guideline, we mostly will use the first one. By default, it will run an interpreter with interaction mode. This is useful when we want to test a small snippet; or when interpreter even doesn't start.

image

Run a single file

For the most of cases, we want to repeat the test a few more times. Open settings and edit args field to your test file.

image

Run a CPython unit test

Here is a tip. Because we must run RustPython in debug mode, it will be slow. Cutting down the running time will be more pleasant if possible. Rather than using test command, running a test file will be a little bit better.

Suppose we want to run,

cargo run Lib/test/test_dict.py -k test_literal_constructor -v

Then the settings will be like:

image

Sometimes it is not possible. Then running test command is easier option.

cargo run -- -m test test_json -v

image

IMPORTANT TIP

Don't forget to set break point. Sometimes panic is not very useful. If you are new to debugger, please search for "VSCode breakpoint" for details. If you are already familiar with debuggers, click left side of line numbers to set breakpoints. Simple tip: Simply, click line