2016. 11. 10. 16:36

How to remove project dependency in Visual Studio

Issue : When removing a dependency of a project, I got a message "The dependency was added by the project system and cannot be removed


Solution

  1. Right click project, select Properties.
  2. Select Framework and References under Common Properties
  3. Select the references thats not needed.
  4. Click on Remove Reference.


2015. 3. 12. 10:12

Show a list of include files in visual studio

Configuration Properties -> C/C++ -> Advanced -> Show  includes (YES)

Confirm what header file is included

ex) error C2039: 'int8_t' : is not a member of '`global namespace''


2013. 11. 7. 13:37

run Hyper-V on VMWare

1. install Windows 8 on VMWare

2. check "Virtualize Intel VT-x/EPT or AMD-V/RVI" item ( VMware setting / Processors  )

3. add hypervisor.cpuid.v0 = "FALSE" item in .vmx


2011. 3. 30. 13:24

debug diagnostic

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en

위 링크에서 download 받을 수 있다.

골치 아픈 memory leak 문제가 있었는데, 여러가지 tool 을 사용해 보았다.
하지만 딱히 hint 를 얻지 못한 상태에서 위 tool을 사용하였는데 해결의 실마리를 얻었다.

비단 memory leak 뿐 아니라 postmortem 
 debugging 등 다양한 기능을 제공한다.

detect memory leak 

Leakdiag 와 비교 시 장점은  Report 하는 데이터가 많으며 속도가 빠르다. 특히 LeakDiag는 symbol을 callstack에 매칭하는 작업이 엄청 시간이 걸리는데 반해 이 tool은 그다지 시간 소요가 없다.

  1. 해당 process 선택 하고 context menu 에서 Monitor For Leaks를 선택한다.( 특정 dll을 해당 process로 inject 을 한다.)

     
 2. memory leak 일 발생되는 동작을 반복한다.
 3. 작업이 완료 되면 해당 process를 선택하고 context menu 에서 Create Fumm Userdump 를 선택하여 dump 파일을 생성한다. 
 4. symbol 위치를 설정한다.  Tools -> Options And Settings... (기본적으로 ms symbol 은 설정되는 것 같다. 해당 software의 symbol을 Symbol Search Path For Analysis 에 추가하면 된다.

  5. Advanced Analysis Tab 으로 이동한다.  
Available Analysis Scripts 에서 Memory Pressure Analyzers 를 선택한다.
하단의 Add Data Files 버튼을 클릭하여 아까 생성한 dump 파일을 선택한다.
Start Analysis 버튼을 클릭하면 결과 보고서가 생성된다.


 
2009. 8. 19. 14:58

Symbol server

. symstore.exe : debugging Tools for windows 에 포함이 된 모듈로 symbol server 를 구축하는 기능을 담당
  • 생성: symstore add /f  c:\release\files /s c:\symstore.pub /t test /r /z pub
  • /f - 바이너리 폴더 위치
  • /s - symbol 저장소 위치
  • /t  - product name
  • /r - recursive scan
  • /z - pub symbol or private symbol [ /z pub 로 지정된 경우 private symbol은 symbol server에 저장이 되지 않는다.]

  • 삭제: symstore del /i 000000001 /s c:\symstore.pub
  • /i - transaction id

. _NT_SYMBOL_PATH  or !sympath 로 설정하여 사용 ( HTTP server를 이용하여 web 경로로 접근 가능 )

.pdbcopy.exe : debugging Tools for windows 에 포함이 된 모듈로 private symbol 파일에서 private 정보를 제거하여 public symbol 로 만들어주는 기능 제공


2009. 6. 30. 13:31

debug

1. 프로그램 실행 시 자동으로 debugger 에 attach 하기
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\note.exe 

위 항목 IFEO(Image File Execution Options)레지스트리로 프로그램 실행에 영향을 주는 항목들이 저장이 된다.

"Debugger"="C:\....\windbg.exe" 

위 항목이 있으면 해당 프로세스(notepad.exe)가 실행 시 windbg가 attach 된다.

gflags /p /enable notepad.exe /debug "c:\...\windbg.exe"
gflags /p /disable notepad.exe

위 기능은 IFEO registry에 정보를 넣고 삭제하는 역활을 한다.

2. child process debugging

windbg -o cmd.exe /c notepad.exe

-o option을 사용하면 자식 프로세서에도 attach된다.

3. Set The NTSD as Postmortem Debugger
2009. 6. 26. 11:46

visual studio

1. assembly code 생성 : Project -> Properties -> C/C++ -> Output Files -> Assembler Output

2. macro - 첨부파일 Gadget.vb 
  • AddDescription - 자동으로 주석 형식( 날짜 - 이름) 제공
  • CommentOut - Comment 로 변경
  • UnCommentOut - Comment 해제
  • ToggleBetweenSourceAndHeader - source file 과 header file을 변경