2007~2011/Windows Platform2010. 12. 27. 12:36
특정 프로세스가 이미 실행 중이 상태가 아닌 시작되는 시점부터 Windbg 에 해당 프로세스를 Attach 하여 디버깅을 할 수 있는 방법이 있을까요? 레지스트리 파일 실행 옵션을 살짝 변경하면 가능합니다. 아래와 같이 정리하였습니다.


[시나리오]
notepad.exe 가 실행될 때, windbg 로 디버깅 시작하는 방법


[설정방법]
1. 아래 레지스트리 경로로 이동
 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options



2. 키 생성 : notepad.exe

3. 문자열 값 생성
 가. 이름 : Debugger
 나. 데이터 : C:\Program Files (x86)\Debugging Tools for Windows (x86)\windbg.exe (디버거 경로)





[실행결과]
notepad.exe 를 실행할 경우 아래와 같이 windbg 에 attach 되어 디버깅을 시작할 수 있습니다.


 

참고
Dllhost.exe 가 실행될 때 TTT Attach 하는 방법
C:\Debugger> TTTracer.exe -dumpfull -out c:\temp\ -onlaunch "%windir%\system32\dllhost.exe"


[참고자료]
How to debug Windows services
http://support.microsoft.com/kb/824344/en-us


작성자 : Lai Go / 작성일자 : 2010.12.28

Posted by Lai Go