| View previous topic :: View next topic |
| Author |
Message |
Roddy Pratt Guest
|
Posted: Sun Aug 22, 2004 10:14 am Post subject: Feature request: Thread Names in Debugger |
|
|
Win32 kernel doesn't hold names for threads. This makes multi-threaded
debugging extremely painful, as you have to flail about trying to work out-
and remember - which thread ID is which.
A very simple 'manual' way could be to provide a call like
AssociateThreadName(ThreadID, Name), which would construct a table which the
debugger could then use to lookup thread names.
Maybe a Diamondback feature, pleeease?
- Roddy
|
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Sun Aug 22, 2004 1:16 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
| Quote: | Win32 kernel doesn't hold names for threads. This makes multi-threaded
debugging extremely painful, as you have to flail about trying to work
out-
and remember - which thread ID is which.
|
I would like this too. It would be even better it Microsoft allowed general
cataloging of system objects by name, as is already available for some
specific objects. Why Billy decided that only some objects could have names
is beyond me.
Rgds,
Martin
|
|
| Back to top |
|
 |
Captain Jake Guest
|
Posted: Sun Aug 22, 2004 1:30 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
"Roddy Pratt" <roddy (AT) rascular (DOT) spamspamspam.com> wrote
| Quote: | A very simple 'manual' way could be to provide a call like
AssociateThreadName(ThreadID, Name), which would construct a table which
the
debugger could then use to lookup thread names.
Maybe a Diamondback feature, pleeease?
|
You can get thread naming now in regular Win32 Delphi. I forget which
component/class I saw that can do this, but off the top of my head I seem to
think it is the TIdThread class in Indy 10. Either that or the thread stuff
in JVCL 3.
--
Read Jake's Blog at http://blogs.slcdug.org/jjacobson/
Or Get the RSS Feed at http://blogs.slcdug.org/jjacobson/Rss.aspx
Everything contained in this post that is not quoted from others, is merely
an opinion. It may be a well-informed opinion motivated by an uncanny grasp
of facts and amazingly well-formulated theories, but it remains opinion
nevertheless. I speak for nobody but myself, and even then I may get it
wrong from time to time.
|
|
| Back to top |
|
 |
Palle Meinert Guest
|
Posted: Sun Aug 22, 2004 3:33 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
| Quote: | Win32 kernel doesn't hold names for threads. This makes multi-threaded
debugging extremely painful, as you have to flail about trying to work
out-
and remember - which thread ID is which.
|
In BCB, selecting the "Thread Object" from the repository will ask whether
to name the thread, and I think Delphi will be no different (at least prior
to .
/Palle
|
|
| Back to top |
|
 |
Andre Kaufmann Guest
|
Posted: Sun Aug 22, 2004 6:27 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
"Roddy Pratt" <roddy (AT) rascular (DOT) spamspamspam.com> wrote
| Quote: | Win32 kernel doesn't hold names for threads. This makes multi-threaded
|
Not quite correct.
For example most C++ debuggers will set the thread name to the name of
the function the thread has been started by.
So there is a possibility to set the thread name already.
In Win32 there isnīt a simple API and the thread name has to be set
indirectly by using an undocumented Win32 exception to modify
the thread info.
For .NET threads you may simply call SetThreadName.
Andre
|
|
| Back to top |
|
 |
Marc Rohloff [TeamB] Guest
|
Posted: Sun Aug 22, 2004 10:09 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
On Sun, 22 Aug 2004 11:14:37 +0100, Roddy Pratt wrote:
| Quote: | A very simple 'manual' way could be to provide a call like
AssociateThreadName(ThreadID, Name), which would construct a table which the
debugger could then use to lookup thread names.
Maybe a Diamondback feature, pleeease?
|
Probably a bit late for that but why don't you log it in
QualityCentral (qc.borland.com)
--
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
|
|
| Back to top |
|
 |
Peter Zolja Guest
|
Posted: Sun Aug 22, 2004 10:43 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
| Quote: | A very simple 'manual' way could be to provide a call like
AssociateThreadName(ThreadID, Name), which would construct a table which
the
debugger could then use to lookup thread names.
|
If you use the wizard to create a Thread Object it will let you specify a
name for the thread, a name that shows up in the debugger - it adds code
that "associates" a name with a thread. Isn't this what you want?
|
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Sun Aug 22, 2004 11:03 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
| Quote: | If you use the wizard to create a Thread Object it will let you specify a
name for the thread, a name that shows up in the debugger - it adds code
that "associates" a name with a thread. Isn't this what you want?
|
Mhh - I haven't used that wizard for a long time. What happens if you use
it to create a maned thread unit & then create 10 threads?
Rgds,
Martin
|
|
| Back to top |
|
 |
Peter Zolja Guest
|
Posted: Mon Aug 23, 2004 1:42 am Post subject: Re: Feature request: Thread Names in Debugger |
|
|
| Quote: | Mhh - I haven't used that wizard for a long time. What happens if you use
it to create a maned thread unit & then create 10 threads?
|
By default it creates the code that allows you to assign a name for the
thread. The default behavior is pretty "static", but with a few changes you
can make it more flexible. For example:
Change the header to this:
type
TMyThread = class(TThread)
private
FMyName: string;
procedure SetName;
protected
procedure Execute; override;
public
property CustomName:string read FMyName write FMyName;
end;
and then change one line in SetName:
//ThreadNameInfo.FName := 'Abc';
ThreadNameInfo.FName := PAnsiChar(FMyName);
so, now you can assign a name for the thread at runtime; and each instance
can have a different custom name. If you want to be able to change the name
of the thread once you started the thread, you may have to change how you
write to FMyName -- just keep in mind that the SetName procedure will change
the name of the thread that ran the procedure, so just calling
ThreadInstance.CustomName := 'new name' for a different thread may not give
you what you expect...
|
|
| Back to top |
|
 |
TOndrej Guest
|
Posted: Mon Aug 23, 2004 7:35 am Post subject: Re: Feature request: Thread Names in Debugger |
|
|
| Quote: | Win32 kernel doesn't hold names for threads. This makes multi-threaded
debugging extremely painful, as you have to flail about trying to work out-
and remember - which thread ID is which.
|
http://cc.borland.com/ccweb.exe/listing?id=16302
HTH
TOndrej
|
|
| Back to top |
|
 |
Colin Wilson Guest
|
Posted: Mon Aug 23, 2004 11:05 am Post subject: Re: Feature request: Thread Names in Debugger |
|
|
Roddy Pratt wrote:
| Quote: | Win32 kernel doesn't hold names for threads. This makes
multi-threaded debugging extremely painful, as you have to flail
about trying to work out- and remember - which thread ID is which.
A very simple 'manual' way could be to provide a call like
AssociateThreadName(ThreadID, Name), which would construct a table
which the debugger could then use to lookup thread names.
Maybe a Diamondback feature, pleeease?
- Roddy
|
Madshi's Mad Exception Handling stuff gives you this. Mind you, it
would be a nice feature for D9 itself.
--
Colin - using XanaNews HTTP Transport
e-mail :colin (AT) wilsonc (DOT) demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm
Posted with XanaNews 1.16.4.2
|
|
| Back to top |
|
 |
Roddy Pratt Guest
|
Posted: Mon Aug 23, 2004 11:09 am Post subject: Re: Feature request: Thread Names in Debugger |
|
|
"TOndrej" <tondrej (AT) plonk (DOT) net> wrote
It does -Thanks!
As my threads are not TThread descendants, this is likely the best answer.
I'll see if I can make it fly with BCB5...
- Roddy
|
|
| Back to top |
|
 |
Andre Kaufmann Guest
|
|
| Back to top |
|
 |
Roddy Pratt Guest
|
Posted: Wed Sep 08, 2004 7:16 pm Post subject: Re: Feature request: Thread Names in Debugger |
|
|
"Andre Kaufmann" <##andre_no_spam_.kaufmann_ (AT) t-online (DOT) de##> wrote in message
But not for BCB5. I guess the integrated debugger doesn't support that
"RaiseException" thing.
Well, at least I've got one good reason to upgrade!
- Roddy
|
|
| Back to top |
|
 |
|