This is a slightly simplified version of a patch submitted by Michael Müller. There are two major changes relative to that patch:
* The process name is taken from the initial argv, rather than the "normalized" argv. In practice this means that the executable name may or may not have its .exe extension, and the user of WINEDEBUG will have to guess. Unfortunately using the normalized argv requires dbg_init() to be called later, which would be somewhat unfortunate.
* The original patch had support for a syntax "-process.exe:+channel" that would allow channels to be toggled for all process *except* one. Since the same can be done almost as easily with "+channel,process.exe:-channel", I decided this extra logic was unnecessary.
This proved useful when trying to debug the issue in 4552; I was able to do
WINEDEBUG=+pid,+seh,+msvcrt,wineboot.exe:+heap
whereas enabling +heap for all processes made the log too slow and large.
With that said, in retrospect it would also have been easy to simply hack something specific and temporary into parse_options(), so if this patch set is deemed unnecessary I won't care too much.