mcu-debug / rtos-views

RTOS views for microcontrollers
MIT License
24 stars 11 forks source link

embOS IsRunning variable must be cleaned #51

Open GAllevato opened 2 weeks ago

GAllevato commented 2 weeks ago

Dear maintainers,

it seems like some embOS versions have additional characters in their isRunning variable, e.g.

isRunning = "1 \001"

instead of

isRunning = "1".

Therefore, the check in

rtos-views/src/rtos/rtos-embos.ts

Line 192: if (undefined !== isRunning && !isNaN(isRunning) && 0 !== parseInt(isRunning)) {

fails.

I suggest cleaning the variable in Line 186:

if (Object.hasOwn(this.OSGlobalVal, 'IsRunning')) { isRunning = this.OSGlobalVal['IsRunning']?.val; isRunning = isRunning.replace(/'\[0-9]+'/, '').trim(); } else { ....

Kind regards

PhilippHaefele commented 2 weeks ago

@GAllevato Thanks for reporting the issue and your suggested code. Can you please state your versions like VSCode, Extension & embOS, so I'm able to debug this?