Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
1.01k stars 240 forks source link

vscode problem 1.32.3 #140

Closed perlindgren closed 4 years ago

perlindgren commented 5 years ago

Hi Marus

When debugging a Rust application on stm32f103 (bluepill), I now get the following errors.

Cannot read property 'getTreeNode' of null

Error: e is not iterable Error: Cannot read property 'Symbol(Symbol.iterator)' of undefined Error: Cannot read property 'Symbol(Symbol.iterator)' of undefined Error: Cannot read property 'Symbol(Symbol.iterator)' of undefined

Vscode was recently updated to :' code -version 1.32.3 a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4 x64

(as packaged by arch linux).

My build task: { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "type": "shell", "label": "cargo build --example hello --release", "command": "cargo build --example hello --release", "problemMatcher": [ "$rustc" ], "group": { "kind": "build", "isDefault": true } }, ] }

and launch:

{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "cortex-debug", "request": "launch", "servertype": "openocd", "name": "hello", "preLaunchTask": "cargo build --example hello --release", "executable": "./target/thumbv7m-none-eabi/release/examples/hello", "configFiles": [ "interface/stlink.cfg", "target/stm32f1x.cfg" ], "postLaunchCommands": [ "monitor arm semihosting enable" ], "cwd": "${workspaceRoot}" }, ] }

It kind of works mut the Notifications keep popping up, and I have experienced some sporadic crashes, but its hard to replicate, so not sure the reason.

Best regards, Per

Marus commented 5 years ago

What version of the cortex-debug extension are you using?

timboldt commented 5 years ago

Try compiling in debug mode (without --release).

ninjasource commented 5 years ago

Hi Per,

Due to resource constraints on the bluepill I was forced to build in release mode. I thought I had lost my ability to debug as a result but discovered that I could re-enable debugging by adding following code to my cargo.toml file:

[profile.release]
debug = true

Then compile with "cargo build --release" as Tim mentioned above. This works for me; I hope that helps. Vscode with the Cortex-Debug plugin still seems to be the only turnkey option for remotely debugging Arm devices. Thanks for a great plugin Marcus!

The only other option for a "visual" debug experience is remote GDB debugging with CLion which only kind-of half works and is tricky to setup.

timboldt commented 5 years ago

My solution was to compile in debug mode with some optimization, e.g.

[profile.dev]
opt-level = 1

opt-level=1 doesn't seem to mess things up too much. I've seen other people use opt-level = s as well.

ninjasource commented 5 years ago

Thanks, this worked for me in debug mode (opt-level=1 was too large):

[profile.dev]
opt-level = 's'