microsoft / vscode-embedded-tools

Official issue tracking repository for Microsoft's Embedded Tools VS Code extension.
MIT License
43 stars 3 forks source link

RTOS view thread name only shows a single character #76

Open cosmikwolf opened 2 months ago

cosmikwolf commented 2 months ago

RTOS view thread name only shows a single character

Type: Bug Report

Describe the bug

To Reproduce

Expected behavior I expect to see the thread names. they are visible when debugging with Segger Ozone

Code sample and logs

Screenshots

image

Additional context seems like this might be related to https://github.com/microsoft/vscode-embedded-tools/issues/23 ?

SeanMollet commented 2 months ago

I'm getting this too. Have to start naming my threads a-z. :) Same system setup and versions as the original poster.

Some quick digging, it looks like cortex debug sees the CHAR *tx_thread_name in tx_api.h and treats it like a pointer to a single character. Which kind of makes sense, but it's a C-string and I can't believe cortex debug doesn't handle those.

SeanMollet commented 2 months ago

I remembered a similar issue I'd encountered before debugging C/C++ with vscode. If the GDB isn't built with python support, pretty printing can't be enabled. I believe pretty printing is required in order for GDB to parse the entirety of C-strings.

By default arm-none-eabi-gcc's gdb isn't built with python support.

I'm going to dig around, I've got another gdb somewhere here that supports it.

SeanMollet commented 2 months ago

Yep.. that was it. Tried with a multiarch-gdb and it worked. To fix it without having to build your own gdb, Install the arm-none-eabi-gdb from brew, overwrite the link from the one included with the arm cask and you'll be good to go.

https://formulae.brew.sh/formula/arm-none-eabi-gdb

Screenshot 2024-09-16 at 8 00 06 PM

SeanMollet commented 2 months ago

You can check if your gdb has python with this command: arm-none-eabi-gdb --ex "python import os" --batch 2>&1 | grep Python

If it prints nothing, you have python and it's working. Else, it will print an error.

rokobertcm commented 1 month ago

I'm check gdb with

arm-none-eabi-gdb --ex "python import os" --batch 2>&1 | grep Python

And got no error. But still only one char in thread name. I'm using MacOS 14.7 on MacBook Pro M3, VSCode 1.94.0 and Embedded Tools 0.8.0.

SeanMollet commented 1 month ago

@rokobertcm Make sure you're using that gdb. In launch.json:

        "gdbPath": "/opt/homebrew/bin/arm-none-eabi-gdb"
rokobertcm commented 1 month ago

Yes it works. My mistake. Thanks!

Best regards, Robert Konc