존슨 M. 하트의 Windows 시스템 프로그래밍 4 판을 공부하고 있습니다. 다음은 windbg에서 저를 곤란하게 만든 한 가지 예제의 소스 코드입니다. 아래 스 니펫은 명령 줄에서 각 파일에 대한 스레드를 만듭니다. 내가 알아 차 렸던 것은 스레드가 ~ 또는 ~~ [TID]를 사용하여 윈드백에 보이지 않는다는 것입니다. 그러나 procexp와 procmon은 스레드를 보여줍니다.Microsoft C 라이브러리 _beginthreadex
왜 스레드가 windbg에서 보이지 않습니까? 그들이 있다고 가정한다면 어떻게 볼 수 있습니까? ###! _ beginthreadex 함수에 중단 점을 설정했습니다. 중단 점이 트리거되지만 함수를 단계별로 실행하면 스레드가 표시되지 않습니다.
for (iThrd = 0; iThrd < argc - 2; iThrd++) {
/* Set: targv[1] to the pattern
targv[2] to the input file
targv[3] to the output file. */
_tcscpy (gArg[iThrd].targv[1], argv[1]); /* Pattern. */
_tcscpy (gArg[iThrd].targv[2], argv[iThrd + 2]); /* Search file. */
if (GetTempFileName /* Temp file name */
(".", "Gre", 0, gArg[iThrd].targv[3]) == 0)
ReportError (_T ("Temp file failure."), 3, TRUE);
/* Output file. */
gArg[iThrd].argc = 4;
/* Create a thread to execute the command line. */
tHandle[iThrd] = (HANDLE)_beginthreadex (
NULL, 0, ThGrep, &gArg[iThrd], 0, NULL);
if (tHandle[iThrd] == 0)
ReportError (_T ("ThreadCreate failed."), 4, TRUE);
}
이 스레드가 단명하고 있습니까? ProcExp의 Difference Highlight Duration에 따라 ProcExp에서 완료 후 최대 9 초 동안 볼 수 있습니다. –