Click to See Complete Forum and Search --> : Can one trace threads in an app?


Dead_Nid
March 13th, 2006, 05:50 PM
Hello everyone! Chances are that this topic has been treated in the past, perhaps in this forum, but as long as I can't find relevant information, I had to start this thread. So. I am interested in tracing various programming aspects of the DAWs (digital audio workstation) from Steinberg (Cubase and Nuendo). I am not trying to crack the software...even if I did, I certainly don't have the knowledge to do so. I just want to study the internal structure of these apps and monitor anything that is possible in order to check performance issues. Coming to the point, is there some powerful tool to trace and find information about each programming thread that the process has? What I mean by 'trace' is to find out what each thread does in the program. These apps have a lot of threads (nearly 30) and many different tasks to operate using many different windows (dialogs). For example, one of them is the Mixer window. How could I find if there is a dedicated thread for this window and more info about that thread?

Any info (or links) about studying an .exe will do no harm at all. Thank you all and best regards! Nid

Dead_Nid
March 14th, 2006, 09:11 PM
errrr...either my question is very newbie, dumb or just hard to answer...sorry guys I am not some code guru out there, just have basic knowledge of C/C++. To make this clearer, I'm looking for a way (IF POSSIBLE) to identify threads inside a multithreaded app and what each does. As you guessed I am looking for the "easy way" but the "hard one" is also very welcome. Thanx again.Cheers!

wildfrog
March 14th, 2006, 09:31 PM
There are no easy ways (at least not in this scenario).

The hard way is to break into your application using a debugger (Visual Studio for instance). Then the active threads should show up. Now, using pen and paper (and late nights as well as vacations and sick leaves) you'll have to dechiffer thousand, if not millions, of lines with assembly instructions. This code is far from the language the application was originally written in. This code is optimized and obfuscated until it fit the target processor (a machine); and the more optimized it is, the more difficult it is to understand (for a human).

But, if you're willing to try you should start out with a dissassembler and/or a debugger.

- petter

Dead_Nid
March 14th, 2006, 09:48 PM
Oh...I see. The apps I am interested in must be optimized to the bone. I was hoping that there was an easy way,maybe some software tool made for this purpose but as it turns up I should forget this stupid idea of mine. Thanx a lot wildfrog! Take care -Nid

kirants
March 15th, 2006, 12:25 PM
Now, using pen and paper (and late nights as well as vacations and sick leaves)
Not to forget an uninterrupted supply of caffeine :)

tiger_hwang
March 20th, 2006, 06:18 AM
With win API function CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD,...) you can get the snapshot of system, find the result with Tead32First() and Thread32Next() and match it with process ID of your application.

In OS like XP, you may get the thread handle, open it and do other operation like GetExitCodeThread() or GetThreadTimes() and so on.