Microsoft MVP성태의 닷넷 이야기
디버깅 기술: 177. windbg - (ASP.NET 환경에서 유용한) netext 확장 [링크 복사], [링크+제목 복사],
조회: 21512
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

(시리즈 글이 5개 있습니다.)
디버깅 기술: 45. Windbg 확장 DLL 만들기 (1) - 스레드를 강제 종료시키는 명령어
; https://www.sysnet.pe.kr/2/0/1198

디버깅 기술: 46. Windbg 확장 DLL 만들기 (2) - Debugger Extension API 사용
; https://www.sysnet.pe.kr/2/0/1200

디버깅 기술: 118. windbg - 닷넷 개발자를 위한 MEX Debugging Extension 소개
; https://www.sysnet.pe.kr/2/0/11644

디버깅 기술: 160. Windbg 확장 DLL 만들기 (3) - C#으로 만드는 방법
; https://www.sysnet.pe.kr/2/0/12119

디버깅 기술: 177. windbg - (ASP.NET 환경에서 유용한) netext 확장
; https://www.sysnet.pe.kr/2/0/12462




windbg - (ASP.NET 환경에서 유용한) netext 확장

기존에도 MEX 확장으로,

windbg - 닷넷 개발자를 위한 MEX Debugging Extension 소개
; https://www.sysnet.pe.kr/2/0/11644

sos.dll에 비해 꽤 유용한 명령어들을 제공하긴 했지만 netext는,

rodneyviana/netext
; https://github.com/rodneyviana/netext/tree/master/Binaries

ASP.ENT 환경에 좀 더 특화된 명령어들을 제공합니다. 가령, web.config에 대한 설정을 알고 싶을때 "wconfig" 명령어를 이용하면 다음과 같이 machine.config부터 시작해 계층적으로 값들을 모두 열거해 줍니다.

0:000> !wconfig
<--
Key: configProtectedData
Definition Config Path: machine
Filename: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
Line: 0n143
 -->

...[생략]..

<--
Key: system.web/fullTrustAssemblies
Definition Config Path: machine/webroot
Filename: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
Line: 0n24
 -->

...[생략]..

<httpHandlers>
          <add xamlRootElementType="System.ServiceModel.Activities.WorkflowService, System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" httpHandlerType="System.ServiceModel.Activities.Activation.ServiceModelActivitiesActivationHandlerAsync, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add xamlRootElementType="System.Activities.Activity, System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" httpHandlerType="System.ServiceModel.Activities.Activation.ServiceModelActivitiesActivationHandlerAsync, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </httpHandlers>

<--
Key: system.web/machineKey
Definition Config Path: machine/webroot/2/myservice
Filename: D:\wwwroot\myservice\web.config
Line: 0n30
 -->

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
...[생략]...
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.1.3.0" newVersion="3.1.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

...[생략]..

그 외에도 제가 기존에 pykd로 만들어둔 스크립트 명령어에 대해,

windbg/sos - Hashtable의 buckets 배열 내용을 모두 덤프하는 방법 (do_hashtable.py)
; https://www.sysnet.pe.kr/2/0/12084

windbg/sos - Dictionary의 entries 배열 내용을 모두 덤프하는 방법 (do_hashtable.py)
; https://www.sysnet.pe.kr/2/0/12087

개별 명령어로도 제공하고 있습니다.

!whash [...addr_of_hashtable_instance...]

!wdict [...addr_of_dictionary_instance...]

멋지죠? ^^




netext의 readme.txt를 보면,

netext/Binaries/readme.txt
; https://github.com/rodneyviana/netext/blob/master/Binaries/readme.txt

재미있는 명령어가 눈에 들어옵니다.

.cmdtree d:\wext\netext.tl

netext.tl은 텍스트 파일인데,

windbg ANSI Command Tree 1.0 
title {"netext cheat sheet"} 
body
{"General"}
 {"Load"} {".load netext"}
 {"Index"} {"!windex"}
 {"Create Objects Tree"} {"!windex -tree"}
 {"Stack Objects"} {"~*e!wstack"}
 {"Enumerate types"} {"!windex -enumtypes"}
 {"Dump Rooted Objects"} {"!wgchandles"}
 {"Get Heap Info Only"} {"!wheap -detailsonly"}
...[생략]...
{"Security/WIF"}
 {"Expired/Valid Tokens"} {"!wfrom -nospace -nofield -type System.ServiceModel.Security.Tokens.SecurityContextSecurityToken select $addr()," ",  id," ",$tickstodatetime(keyExpirationTime.dateData)," ",$if(keyExpirationTime.dateData > $now(), "Valid", "Expired")"}

이를 cmdtree로 실행하면 windbg 화면에서 다음과 같은 별도의 창이 뜨고,

windbg_cmdtree_1.png

나열된 명령어를 마우스로 두번 클릭하는 것만으로 쉽게 실행하는 것이 가능합니다. 그러고 보면 windbg가 은근히 확장에 대한 배려를 곳곳에 심어놓은 것에 감탄하게 됩니다. ^^




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







[최초 등록일: ]
[최종 수정일: 12/27/2020]

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

비밀번호

댓글 작성자
 




... 166  167  168  169  170  171  172  173  174  175  176  177  [178]  179  180  ...
NoWriterDateCnt.TitleFile(s)
587정성태6/10/200828650VS.NET IDE: 56. C#에서 아쉬운 __DATE__, __TIME__ 매크로 [2]
586정성태6/4/200826270오류 유형: 56. WPF 디자이너 - The string was not recognized as a valid DateTime [2]
585정성태6/4/200834574.NET Framework: 101. WPF - ActiveX 컨트롤 호스팅하는 방법 [2]
582정성태5/16/200826343오류 유형: 55. Windowless ActiveX controls are not supported
580정성태4/24/200825414VC++: 34. 64비트 윈도우즈에서의 이벤트 후킹
579정성태4/24/200825233VC++: 33. 변환 후의 RGS 파일 내용을 얻는 방법
577정성태4/16/200826164.NET Framework: 100. XML Serializer를 이용한 값 복사 [5]
575정성태4/7/200823335오류 유형: 54. TFS Source Control - 명령을 사용할 수 없음 [2]
574정성태3/31/200821451오류 유형: 53. TFS 연결 오류 - The workspace [...] exists on computer [...]
573정성태3/25/200825478Windows: 31. TS Web Access와 UAC [1]
570정성태3/17/200824627오류 유형: 52. TFS 연결 오류 - TF31001 [2]
569정성태3/16/200825769Team Foundation Server: 24. TFS 2008로 마이그레이션 (2) [2]
566정성태2/28/200826907.NET Framework: 99. AppDomain.GetEntryAssembly()를 우회하는 방법파일 다운로드1
564정성태2/16/200826545Windows: 30. TS Web Access + Vista SP1 [2]
563정성태2/16/200825911오류 유형: 51. Vista(UAC) + 웹 프로젝트 디버깅: System.UnauthorizedAccessException
562정성태2/12/200830174Windows: 29. Windows Server 2008 설치 [4]
561정성태1/10/200823865오류 유형: 50. IE 7 + 잘못된 HTC 파일 경로 = File not found [5]
559정성태1/1/200828680Windows: 28. Vista에서 끌어다 놓기로 GAC 등록하는 방법 [2]
558정성태1/1/200845869개발 환경 구성: 33. 32bit/64bit OLE DB Provider [1]
557정성태12/22/200724208개발 환경 구성: 32. WSCF와 VS.NET 2008
556정성태12/16/200722282기타: 22. 인기 순위 정리 : 조회수 1000 회 이상
555정성태12/16/200725262기타: 21. 인기 순위 정리 : 조회수 500 ~ 999회 글 목록
554정성태12/16/200729654기타: 20. 인기 순위 정리 : 조회수 250 ~ 499회 글 목록
553정성태12/16/200730039기타: 19. 인기 순위 정리 : 조회수 100 ~ 249회 글 목록
552정성태12/16/200723646기타: 18. 인기 순위 정리 : 조회수 000 ~ 099 회 글 목록
550정성태12/16/200722859Team Foundation Server: 23. TFS 2005에서 TFS 2008로 마이그레이션 [2]
... 166  167  168  169  170  171  172  173  174  175  176  177  [178]  179  180  ...