Page 1 of 1

madTraceProcess from the command-line

Posted: Tue Jul 31, 2018 8:41 am
by StephaneGrobety
Hello,

In order to attempt to find a particularly tricky error (race condition between long-running threads), I would like to be able to get a trace of the program at regular interval.

I have checked the source code of madTraceProcess and I might be able to modify it to accept new command-line arguments for performing in an automated fashion but, unfortunately I'm missing the necessary "madRemote" unit to recompile it (this unit also seems to contain some of the important structures used by madTraceProcess).

What I'm attempting to do is add a command-line parameter providing the name of the executable to trace and the name of a trace file to save the report to. The program should then extract the trace, save it and exit.

Re: madTraceProcess from the command-line

Posted: Tue Jul 31, 2018 4:53 pm
by madshi
madRemote can do some things that the OS blocks. But in most cases you can simply replace the madRemote APIs with pure win32 APIs. E.g. instead of madRemote's CreateRemoteThreadEx() you can simply use CreateRemoteThread(). It should be possible to recompile madTraceProcess with most of its functionality, without madRemote.