我的应用有一个启动b.exe并与之通信的程序。顺序是:
我想打破b.exe接口方法调用。目前,我这样做:
.childdbg 1
我设法做到了,但10秒的超时有时会过去。有没有更好的方法呢?
答案 0 :(得分:4)
阅读我的问题,我找到了答案 - 让初始断点设置真正的断点:
.childdbg 1
sxe -c "bm b!*MyMethod*;g" ibp
sxd epr
答案 1 :(得分:1)
:\>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>