Forum > General

Is there any way to name my threads for debugging?

(1/14) > >>

avra:
I have tried to do it Delphi way but unfortunately this is not possible yet. According to http://www.freepascal.org/docs-html/rtl/classes/tthread.namethreadfordebugging.html it seams that NameThreadForDebugging() "is not implemented for any FPC platform and is supported for Delphi compatibility only". Is there any other way to name my threads so that I can see their names in debugger? Right now I just care for Win32.

balazsszekely:
Perhaps this: http://stackoverflow.com/a/9090608

skalogryz:
I'm wondering if something like this could be achieved via using "threadvars" with using a variable (of shortstring type?) to stored the name and inspecting the value of the variable during the debugging. Should be a cross-platform solution :)

avra:

--- Quote from: GetMem on May 25, 2016, 12:11:20 pm ---Perhaps this: http://stackoverflow.com/a/9090608
--- End quote ---
Unfortunately not. MS_VC_EXCEPTION is raised and app ends, but thread name is not updated in threads debug window. Just tested on WinXP SP3 with CT 5.7.

marcov:
Try recompiling FPC with -dTEST_WIN32_SEH

Navigation

[0] Message Index

[#] Next page

Go to full version