jlink-zephyr icon indicating copy to clipboard operation
jlink-zephyr copied to clipboard

Broken thread priority sign

Open diggit opened this issue 1 month ago • 1 comments

Hi, Zephyr uses negative priority values for cooperative threads, like system WQ. GDB sees those as interpreted as u8

info threads
  Id   Target Id                                     Frame 
  2    Thread 536900552 (main NOT STARTED PRIO 0)    __ISB () at ...
  3    Thread 536900288 (idle UNKNOWN PRIO 15)       0x00040306 in arch_cpu_idle () at ...
  4    Thread 536899928 (MPSL Work PENDING PRIO 246) arch_swap (key=key@entry=0x0) at ...
* 5    Thread 536900816 (sysworkq RUNNING PRIO 255)  shall_fail () ...
  6    Thread 536881856 (BT LW WQ PENDING PRIO 10)   arch_swap ...

255 for WQ instead of it's real value of -1 etc.

I am not really familiar with jlink RTOS api, but I think on the line 567 the format specifier should be hhd instead of hhu for signed 8 bit integer (i8).

If jlink accepts only non negative priorities and this is intended behavior, it should be noted somewhere.

diggit avatar Oct 11 '25 10:10 diggit

Now I see, whole printed string gets into GDB and other tools and yes, hhd format specifier fixes displayed value.

diggit avatar Oct 11 '25 11:10 diggit