iarsystems / iar-vsc-debug

Visual Studio Code extension for the IAR C-SPY debugger
19 stars 1 forks source link

Resuming from breakpoints broken with FreeRTOS #34

Open cosberg-rzl opened 8 months ago

cosberg-rzl commented 8 months ago

Describe the bug: Setting breakpoints seems to (mostly) work, however resuming from them doesn't appear to work at all. The editor freezes for a bit, then re-enters the same breakpoint you were just at. This happens for "step over", "step into", and "continue". The app is essentially stuck in this state until you reset it externally. While stuck here, most other features seem to generally work. There's an error in the debug console that appears whenever you try to continue from this state: Error: Unknown or ambiguous symbol. _tx_thread_created_ptr

To Reproduce: Probably difficult without our project (which we of course can't provide). The steps are pretty simple though, just setting a breakpoint is enough.

Environment:

Additional context: You're still stuck even if you remove all breakpoints from here, and we're specifically using the "attach to running target" mode with a custom launch.json as the extension doesn't seem able to pick up our settings correctly on its own.

jlonnberg commented 8 months ago

@cosberg-rzl Thanks for the report. We've added the full support for attach to running target in EWARM 9.40, which is primarily related to the leave-target-running command to avoid an unwanted stop when a debug session ends.

cosberg-rzl commented 8 months ago

Which driver, e.g., I-Jet or JLink, are you using for the project? Can you provide use the launch.json?

It's an I-Jet. Here's my launch.json, with some sensitive paths edited out: https://hastebin.skyra.pw/abemadiqes.swift

Moreover, are you running with the leave-target-running option set during the first session to avoid terminating the target?

Yep, as far as I know. It does seem to correctly attach at least.

Does the same thing work in the Embedded Workbench?

Yeah, we don't have any problems in the IAR IDE with any of the debugging options.

jlonnberg commented 8 months ago

So, I cannot see anything strange here. Can you please share the debug session output for a session where the problem occurs? Moreover, can you start the session with the option "--drv_communication_log=./cspycomm.log" added and send us the log-file?