View Issue Details

IDProjectCategoryView StatusLast Update
0038397FPCDocumentationpublic2021-03-23 12:42
ReporterBi0T1N Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0038397: Document NameThreadForDebugging support for Windows, Linux and Android
DescriptionThe TThread.NameThreadForDebugging function is not documented yet.
I think Sven also already merged it into fixes_3_2 branch
Additional Informationhttps://www.freepascal.org/daily/doc/rtl/classes/tthread.namethreadfordebugging.html
https://wiki.freepascal.org/FPC_New_Features_Trunk#Naming_of_Threads
TagsNo tags attached.
Fixed in Revision1814
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Bi0T1N

2021-01-24 22:12

reporter   ~0128577

Last edited: 2021-01-24 22:15

View 2 revisions

An example text:
Note that this requires operating system (OS) support and currently the following OS's are supported:
- Windows
  - on modern versions (Windows 10 version 1607, Windows Server 2016 or newer) it uses SetThreadDescription so that the threadname is always available
  - for older versions it raises a special exception so that the name is only available in a debugger with support for this
- Linux & Android
  - it calls the pthread function pthread_setname_np
  - the maximum length of a threadname is 15 characters, everything longer is cut

Bi0T1N

2021-02-20 14:53

reporter   ~0129036

The proposed changes can be found as a patch below.
NameThreadForDebugging_docu.patch (1,014 bytes)   
--- classes.xml	2021-02-20 14:41:38.987881200 +0100
+++ classes_new.xml	2021-02-20 14:49:57.562240000 +0100
@@ -15919,9 +15919,19 @@
 thread names are more easily recognizable than IDs.
 </p>
 <p>
-Note that this requires OS support. 
-Currently this is not implemented for any FPC platform and is supported for
-Delphi compatibility only.
+Note that this requires operating system (OS) support and currently only the following OS's are supported:
+<ul>
+<li>Windows</li>
+	<ul>
+	<li>on modern versions (Windows 10 version 1607, Windows Server 2016 or newer) it calls the SetThreadDescription function so that the threadname is always available</li>
+	<li>for older versions it raises a special exception so that the name is only available in a debugger with support for this</li>
+	</ul>
+<li>Linux & Android</li>
+	<ul>
+	<li>it calls the pthread function pthread_setname_np</li>
+	<li>the maximum length of a threadname is 15 characters, everything longer is cut</li>
+	</ul>
+</ul>
 </p>
 </descr>
 <seealso>

Michael Van Canneyt

2021-03-07 12:26

administrator   ~0129474

I changed the description so it says that this exists in windows/unix only.

Thanks for reporting!

Issue History

Date Modified Username Field Change
2021-01-24 22:04 Bi0T1N New Issue
2021-01-24 22:04 Bi0T1N Status new => assigned
2021-01-24 22:04 Bi0T1N Assigned To => Michael Van Canneyt
2021-01-24 22:12 Bi0T1N Note Added: 0128577
2021-01-24 22:15 Bi0T1N Note Edited: 0128577 View Revisions
2021-02-20 14:53 Bi0T1N Note Added: 0129036
2021-02-20 14:53 Bi0T1N File Added: NameThreadForDebugging_docu.patch
2021-03-07 12:26 Michael Van Canneyt Status assigned => resolved
2021-03-07 12:26 Michael Van Canneyt Resolution open => fixed
2021-03-07 12:26 Michael Van Canneyt Fixed in Version => 3.3.1
2021-03-07 12:26 Michael Van Canneyt Fixed in Revision => 1814
2021-03-07 12:26 Michael Van Canneyt FPCTarget => 3.2.2
2021-03-07 12:26 Michael Van Canneyt Note Added: 0129474
2021-03-23 12:42 Bi0T1N Status resolved => closed