I have implemented cosim.dll.
I used AddMemWasReadCallback() to add some callback to monitor specific address.
When my callback hit I wanted to use the ReadThreadRegister() to get the program counter (TH_REG_PC).
The ReadThreadRegister() needs a thread ID.
To do so I have used the GetCurrentHWThreadNum() to extract the thread ID.
Unfortunately the function always returns 0 as the thread ID
even though I know for sure that the thread ID is 1.
I thought it was Windows issue so I have ported the code to Linux cosim.so
just to see that I'm getting the same wrong results.