Reputation: 7551
My app has a.exe which launches b.exe and communicates with it. The sequence is:
I want to break in b.exe interface method call. Currently, I do it like this:
.childdbg 1
I managed to do it, but the 10-second timeout sometimes passes. Is there a better way to do it?
Upvotes: 1
Views: 1213
Reputation: 9007
:\>type childproc.cpp
#include<stdio.h>
#include<windows.h>
void main (void)
{
LPTSTR path2child = "c:\\windows\\system32\\calc.exe\0";
PROCESS_INFORMATION pi = {0};
STARTUPINFO si = {0};
si.cb = sizeof(STARTUPINFO);
printf("Creating a Child Process %s\n",path2child);
CreateProcess(NULL,path2child,NULL,NULL,false,0,NULL,NULL,&si,&pi);
printf("waiting for the child to %p to exit\n",pi.hProcess);
WaitForSingleObject(pi.hProcess,INFINITE);
printf("closing handles and exiting");
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
:\>cat childbrk.txt
sxe -c"bp calc!WinMain;g" cpr;g
$$ set createprocess exception handler to execute commands and continue (go)
:\>cdb -o -c "$$>a< childbrk.txt;g" childproc.exe
Microsoft (R) Windows Debugger Version 10.0.10586.567 X86
CommandLine: childproc.exe
Breakpoint 0 hit
eip=00071635
calc!WinMain:
00071635 8bff mov edi,edi
1:001>
Upvotes: 1
Reputation: 7551
Reading my question, I found the answer - let the initial breakpoint set the real breakpoint:
.childdbg 1
sxe -c "bm b!*MyMethod*;g" ibp
sxd epr
Upvotes: 5