Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windbg - automatically continue when child process created and .childdbg 1 enabled

Tags:

windbg

I'm using a startup script for windbg, and would like to debug child processes (.childdbg 1). However, once I enable it, i find that windbg automatically breaks when the child process is created. I'm not sure why this is occurring, but here's the script I'm using:

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'm invoking this via the following command:

windbg.exe -Q -c "$<c:\path\startup.ini" Foo.exe

Lastly, here's 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
like image 418
JohnW Avatar asked Feb 25 '23 19:02

JohnW


1 Answers

Use sxi ibp to ignore initial breakpoint events You may also want to ignore process exit sxi epr

like image 86
John Avatar answered Feb 27 '23 08:02

John