I am using a startup script for windbg and would like to debug child processes (.childdbg 1). However, as soon as I turned it on, I found that windbg automatically breaks when creating a child process. I am not sure why this is happening, but here I use the script:
sxe -c ".echo ********** CLR 1st Chance Exception **********;!pe -nested;.echo ----------- CLRStack ----------;!clrstack;g" clr sxe -c ".echo Child Process Created;g" cpr sxe -c ".echo Child Process Exited;g" epr .load psscor2.dll .childdbg 1
I invoke this with the following command:
windbg.exe -Q -c "$<c:\path\startup.ini" Foo.exe
Finally, here is the output in windbg:
(1d14.191c): Break instruction exception - code 80000003 (first chance) eax=00000000 ebx=00000000 ecx=0022f86c edx=778670b4 esi=fffffffe edi=00000000 eip=778c04f6 esp=0022f888 ebp=0022f8b4 iopl=0 nv up ei pl zr na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 ntdll!LdrpDoDebuggerBreak+0x2c: 778c04f6 cc int 3
Johnw source share