Microsoft MVP성태의 닷넷 이야기
디버깅 기술: 72. Visual Studio 2013에서의 sos.dll 사용 제한 [링크 복사], [링크+제목 복사],
조회: 15684
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Visual Studio 2013에서의 sos.dll 사용 제한

분명히 예전에 Visual Studio에서 sos 확장을 로드하고 사용했었는데요.

Visual Studio의 .NET Disassembly 창의 call 호출에 사용되는 주소의 의미는?
; https://www.sysnet.pe.kr/2/0/1019

오랜만에 Visual Studio 2013에서 해봤더니, 오류의 연속입니다.

!load "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\SOS.dll"
End of expression expected

!load "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SOS.dll"
Unrecognized escape sequence

.load C:\windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll
Unexpected character '\'

.load C:\\windows\\Microsoft.NET\\Framework64\\v4.0.30319\\sos.dll
Unexpected character '\'

.load "C:\\windows\\Microsoft.NET\\Framework64\\v4.0.30319\\sos.dll"
Invalid expression term '.'

.load "C:\windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll"
Unrecognized escape sequence

혹시나 해서 찾아봤더니,

sos.dll usage in visual studio 2013
; http://stackoverflow.com/questions/24749213/sos-dll-usage-in-visual-studio-2013

What’s New for the Debugger in Visual Studio 2013
; https://msdn.microsoft.com/en-us/library/01xdt7cs.aspx

The SOS.dll (SOS Debugging Extension) that helps you debug managed programs in WinDbg, is not available from the Visual Studio IDE. See Debugging Managed Code Using the Windows Debugger


지원이 안된다고 하는군요. ^^ 좀 더 찾아보면,

SOS.dll (SOS Debugging Extension)
; https://docs.microsoft.com/ko-kr/dotnet/framework/tools/sos-dll-sos-debugging-extension

If you are using Visual Studio 2013, SOS.dll is supported in the Windows Debugger within Visual Studio, but not in the Immediate window of the Visual Studio debugger.


"Immediate window"에서는 지원하지 않지만, "Windows Debugger" 내에서는 된다고 나옵니다. 여기서 말하는 "in the Windows Debugger within Visual Studio" 환경이 무엇을 의미하는 걸까요? ^^ 이에 대한 힌트는 Visual Studio에 등록된 이슈에 보면 나옵니다.

".load sos" does not works - by Jegan Ravi
; https://connect.microsoft.com/VisualStudio/feedback/details/789971/-load-sos-does-not-works
Out current suggestion for SOS in VS is to use the WDK integration with VS. https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debuggers-in-the-debugging-tools-for-windows-package
We will work on updating our documentation.

Debugging Environments
; https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debuggers-in-the-debugging-tools-for-windows-package

Debugging Managed Code Using the Windows Debugger
; https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging-managed-code

Starting with Windows Driver Kit (WDK) 8.0, the driver development environment and the Windows debugger are integrated into Microsoft Visual Studio.

You can use the windows debuggers (WinDbg, CDB, and NTSD) to debug target applications that contain managed code. To debug managed code, you must load the SOS debugging extension (sos.dll) and a data access component (mscordacwks.dll).


그렇습니다. WDK (Windows Driver Kit)을 설치하면, Visual Studio가 있는 경우 Windows debugger의 기능이 Visual Studio에 통합됩니다. 여러분의 컴퓨터에 WDK가 설치되어 있는지 여부는 "FILE" / "Open" / "Crash Dump..." 메뉴를 찾아보면 쉽게 알 수 있습니다. 그 메뉴가 없으면 WDK가 설치되지 않은 것이고, 있으면 설치된 것입니다.

하지만, WDK가 설치되었다고 해서 우리가 사용하는 .NET 응용 프로그램의 디버깅에서 사용할 수 있는 것은 아닙니다. (위에서도 말했지만 "Immediate window"에서는 더 이상 지원하지 않기 때문입니다.) 대신, sos.dll을 로드할 수 있는 경우는 덤프 파일(.dmp)을 디버깅할 때입니다. 이런 경우 다음과 같이 "Debugger Immediate Window"라는 별도의 창에서 하단에 명령어를 입력하는 텍스트 상자를 통해 sos를 로드할 수 있습니다.

vs2013_sos_1.png

위의 화면이 바로, 문서에서 말한 "in the Windows Debugger within Visual Studio" 환경입니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/17/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... [76]  77  78  79  80  81  82  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
11729정성태10/9/201814246Windows: 150. 윈도우에서 ARP Cache 목록 확인 및 삭제하는 방법
11728정성태10/9/201812993사물인터넷: 50. Audio Jack 커넥터의 IR 적외선 송신기 [1]
11727정성태10/8/201813711오류 유형: 491. Visual Studio의 리눅스 SSH 원격 연결 - "Connectivity Failure. Please make sure host name and port number are correct."
11726정성태10/7/201815984사물인터넷: 49. 라즈베리 파이를 이용해 원격 컴퓨터의 전원 스위치 제어파일 다운로드1
11724정성태10/5/201814670개발 환경 구성: 407. 유니코드와 한글 - "Hangul Compatibility Jamo"파일 다운로드1
11723정성태10/4/201811295개발 환경 구성: 406. "Docker for Windows" 컨테이너 내의 .NET Core 응용 프로그램에서 직렬 포트(Serial Port, COM Port) 사용 방법
11722정성태10/4/201813078.NET Framework: 798. C# - Hyper-V 가상 머신의 직렬 포트와 연결된 Named Pipe 간의 통신파일 다운로드1
11721정성태10/4/201813853.NET Framework: 797. Linux 환경의 .NET Core 응용 프로그램에서 직렬 포트(Serial Port, COM Port) 사용 방법파일 다운로드1
11720정성태10/4/201814984개발 환경 구성: 405. Hyper-V 가상 머신에서 직렬 포트(Serial Port, COM Port) 사용
11719정성태10/4/201816082.NET Framework: 796. C# - 인증서를 윈도우에 설치하는 방법
11718정성태10/4/201811382개발 환경 구성: 404. (opkg가 설치된) Synology NAS(DS216+II)에 cmake 설치
11717정성태10/3/201813493사물인터넷: 48. 넷두이노의 C# 네트워크 프로그램 [1]
11716정성태10/3/201814299사물인터넷: 47. Raspberry PI Zero (W)에 FTDI 장치 연결 후 C/C++로 DTR 제어파일 다운로드1
11715정성태10/3/201813831사물인터넷: 46. Raspberry PI Zero (W)에 docker 설치
11714정성태10/2/201812603사물인터넷: 45. Raspberry PI에 ping을 hostname으로 하는 방법
11713정성태10/2/201815278개발 환경 구성: 403. Synology NAS(DS216+II)에 docker 설치 후 .NET Core 2.1 응용 프로그램 실행하는 방법
11712정성태10/2/201819814.NET Framework: 795. C# - 폰트 목록을 한글이 아닌 영문으로 구하는 방법 [3]
11711정성태10/2/201815589오류 유형: 490. 윈도우 라이선스 키 입력 오류 0xc004f050, 0xc004e028
11710정성태10/2/201814012.NET Framework: 794. C# - 같은 모양, 다른 값의 한글 자음을 비교하는 호환 분해 [5]
11709정성태9/30/201812241개발 환경 구성: 402. .NET Core 콘솔 응용 프로그램을 docker로 실행/디버깅하는 방법 [1]
11708정성태9/30/201814471개발 환경 구성: 401. .NET Core 콘솔 응용 프로그램을 배포(publish) 시 docker image 자동 생성 [2]파일 다운로드1
11707정성태9/30/201816227오류 유형: 489. ASP.NET Core를 docker에서 실행 시 "Failed with a critical error." 오류 발생 [1]
11706정성태9/29/201813136개발 환경 구성: 400. Synology NAS(DS216+II)에서 실행한 gcc의 Segmentation fault [2]
11705정성태9/29/201813925개발 환경 구성: 399. Synology NAS(DS216+II)에 gcc 컴파일러 설치
11704정성태9/29/201816997기타: 73. Synology NAS 신호음(beep) 끄기 [1]파일 다운로드1
11703정성태9/27/201812973개발 환경 구성: 398. Blazor 환경 구성 후 빌드 속도가 너무 느리다면? [2]
... [76]  77  78  79  80  81  82  83  84  85  86  87  88  89  90  ...