J-Link plugin thread aware debugging (issues on Windows)
- Dominant language
- C
- Stars
- 4k
- Forks
- 1.7k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 237
Description
Hello,
when trying to use the J-Link plugin to do thread aware debugging the JLinkGDBServer crashes/shows errors.
I compiled the plugin from master and an older version that goes along the sources I use.
master: 447a0bce958b9fca11c5505c6b6ebcd2a961d125
To compile, the MSYS2 mingw64 shell is used. I had no luck using the Makefile.host, so I ran it standalone.
Original entry
```
$(Q) $(HOSTCC) $(HOSTCFLAGS) -shared -fPIC jlink-nuttx.c -o jlink-nuttx$(HOSTDYNEXT)
```
Standalone compilation used
```
gcc -shared -fPIC jlink-nuttx.c -o jlink-nuttx.dll
```
SEGGER J-Link version used
```
SEGGER J-Link GDB Server V7.88 Command Line Version
JLinkARM.dll V7.88 (DLL compiled Apr 28 2023 08:36:41)
```
NuttX compile option used
```
CONFIG_DEBUG_TCBINFO=y
```
Target
```
STM32H743ZI
```
Output
MSYS2 MINGW64 (older sources)
```
Loading RTOS plugin: C:/jlink-nuttx.dll...
RTOS plugin (API v1.0) loaded successfully
RTOS plugin: Loaded
Received symbol: g_pidhash (0x240027C8)
Received symbol: g_npidhash (0x240027CC)
Received symbol: g_tcbinfo (0x080CDAB8)
Received symbol: g_readytorun (0x24002788)
All mandatory symbols successfully loaded.
ERROR: error in get_idx_from_pid return -1
Reading common registers:
```
MSYS2 MINGW64 (master)
```
Loading RTOS plugin: C:/jlink-nuttx.dll...
RTOS plugin (API v1.1) loaded successfully
RTOS plugin: Loaded
Received symbol: g_pidhash (0x240027C8)
Received symbol: g_npidhash (0x240027CC)
Received symbol: g_tcbinfo (0x080CDAB8)
Received symbol: g_readytorun (0x24002788)
All mandatory symbols successfully loaded.
WARNING: Failed to read memory @ address 0x010000FC
ERROR: error in read tcbinfo_s reg_offs ret 0
npidhash change from 0 to 128!
ERROR: error in get_idx_from_pid return -2
```
Just to test a mingw32 build. But it doesn't match the SEGGER 64-bit tooling.
```
MSYS2 MINGW32
Loading RTOS plugin: C:/jlink-nuttx.dll...
RTOS plugin load failed (Error 193, %1 is not a valid Win32 application.).
```
Contributor guide
Assessment
This issue has not been assessed yet.