jrfonseca / drmingw

Postmortem debugging tools for MinGW.
GNU Lesser General Public License v2.1
273 stars 53 forks source link

Thread ID and VC++ SetThreadName support #33

Closed strixcode closed 7 years ago

strixcode commented 7 years ago

This fork:

jrfonseca commented 7 years ago

Ignores so called VC++ SetThreadName exception, this is not an actual error so it should not cause crash report generation

https://docs.microsoft.com/en-gb/visualstudio/debugger/how-to-set-a-thread-name-in-native-code shows that one should wrap the RaiseException inside a __try { ... } __except {}. And if you does not wrap, the program will abort abnormally, even when ExcHndl is not used, so it does seem an error, and ExcHndl should not ignore it.

If you need confirmation, just try building and running https://github.com/jrfonseca/drmingw/blob/master/tests/apps/set_thread_name.c

BTW, for the record, on Windows 10 there's a better mechanism for this -- https://randomascii.wordpress.com/2015/10/26/thread-naming-in-windows-time-for-something-better/ -- thought it's not yet supported by DrMingw/ExcHndl