우리가 지금 당장에 의견의 차이를 해소시킬 수는 없다 하더라도 이 세상이 다양성을 누리도록 함께 노력할 수는 있을 것이다. ―존 F.케네디
* 원본링크 :
http://www.solosnake.fsnet.co.uk/main/fs.htm
http://www.solosnake.fsnet.co.uk/main/fs.htm
Debugging fullscreen applications #
Debugging fullscreen applications such as Games, especially when using DirectX, can be quite a pain. Two approaches are to write information to the screen, or to print to file. Neither are particularly helpful or user friendly. If using an MFC application you can also send debug information directly back to the debugger. Sometimes it would be nice to be able to step through your code, to see exactly why or where it is doing something it shouldn't be doing. Sometimes the bug many only manifest itself in the fullscreen version. DirectX allows exclusive access to the screen, and this is actually required to use its screen buffers. If you set a breakpoint in your application whilst it is running fullscreen, you can enter a world of pain...
Happily Microsoft's Visual Studio comes ready to solve your problems, so long as you have access to a network. It is possible to set up VS so as to debug an application which is running on a separate machine, connected over a network.
NOTE: This tutorial is primarily aimed at my fellow students at the University of Abertay Dundee who are developing fullscreen DirectX (or OpenGL) games. I will refer to their setup throughout the explanation, however there is nothing particular to their network involved, and I have done this at home with two PCs on a LAN often.
TO MY FELLOW STUDENTS: Please only use this when necessary, and in group projects, as it (obviously) requires twice as many PCs, and resources are limited!
설치 및 실행법 #
필요사항: 두개의 네트워크로 연결된 PC들, 양쪽다 VC가 설치되어있어야하며, TCP/IP 프로토콜로 접속이 가능해야한다.
- 양쪽 PC 모두 같은 사용자 이름으로 로그온한다. 버그 있는 코드를 보면서 디버깅 할 PC를 "마스터"라고 하고, 풀스크린으로 실행결과를 볼 PC를 "슬레이브"라고 하기로 한다.
- 마스터 PC에서 VC를 기동한다.
- 슬레이브 PC에 디렉토리를 하나 만들고 "Slave" 라고 이름짓는다. 이것은 VC에서 디버깅할 컴파일된 결과실행화일이 놓일 곳이다.
- 슬레이브 PC에서 MSVCMON.exe를 실행시킨다. (아이콘이 과 같이 생겼다. 일반적으로 C:\Program files\Microsoft Visual Studio\Common\MSDev98\Bin에 위치해있다.)

- 양쪽 PC의 IP주소를 알아낸다. (또는 컴퓨터 이름을 알아도 좋다. 프롬프트 모드상에서 'arp -a'해도 되고 직접 설정사항을 봐도 좋다.)
- 마스터 PC에서 디버깅할 프로젝트를 연다.
- 네트워크 디버깅 전에 실행중간에 멈추는 일이 없는지, 풀스크린으로 잘 동작하는지 확인한다.
- 기본적으로 모든 프로젝트들은 두 가지의 릴리즈 버젼을 가지고 있다. ('Debug'와 'Release') 세번째 릴리즈를 추가하자. 'Build'메뉴의 'Configurations...'를 선택한다. 'Add'를 클릭한다. 'Fullscreen'이라고 이름을 입력하고, 'copy the settings from'은 Debug 버젼으로 선택한다. 'OK'를 클릭하고 'Close'를 선택한다. 새로운 릴리즈가 생성되었으므로 현재 릴리즈 상태를 새로 생성한 'fullscreen'으로 정한다. ('Build'->'Set Active Configuration...'메뉴에서 바꾸면 된다)
- 슬레이브 PC에서 MSVCMON.exe을 실행한다. 대화상자가 나오면 'Settings...'를 클릭하고 그림과 같이 마스터 PC의 이름이나 IP주소를 적는다.

- 'OK'를 클릭하면, 마스터에서 접속하기를 기다리는 상태가 된다.

- 마스터 PC에서 'Build'->'Debugger Remote Connection...'메뉴를 선택한다. 'Network (TCP/IP)'를 선택하고 'Settings'를 클릭한다. 슬레이브 PC의 이름이나 IP 주소를 넣는다. 'OK'를 클릭한다.
- 이제 'Project'->'Settings'메뉴를 선택한다. 다음과 같이 수정할 프로젝트를 선택한다.

- 여기서 두가지 요소를 바꿀 필요가 있다. 첫번째는 슬레이브 PC상에서 실행되는 실행화일의 실제 위치를 지정한다. 실행화일을 적는 곳은 아래 화면을 참조해라. 주의해야할 것은 네트워크 경로까지도 포함한 전체 경로를 지정해야한다는 것이다. 이것을 알아내기 위해서는, 탐색기를 사용하여 앞서 만들었던 슬레이브 PC의 Slave 디렉토리를 찾는다. 아래 화면에 나타나있는 'Output file name'항목에 경로를 copy/paste한다. 컴퓨터 명까지 포함한 전체 경로라는 점에 주의한다.

- 두번째 할 일은 먼저한 것보다는 좀 쉽다. 'Debug' 탭을 클릭하고, 앞단계에서 설정한 'Output file name'에 있는 풀 경로 실행화일명을 'Executable for debug session'항목에 복사한다.
- 이제 네트워크를 경유해서 실행될 준비가 되었다. 빌드를 하면 슬레이브 PC에서 원격으로 실행이 될 것이다. 아이콘이나 'Rebuild All' 메뉴를 선택해서 실행화일을 슬레이브 PC상에 생기도록 만든다. 슬레이브 PC의 'Slave' 폴더를 보면 화일이 생겨있을 것이다. 그것을 직접 실행하진 말아라!

- 이제 마스터 PC에서 평상시에 디버깅하던데로 실행해본다. F5키를 누르고 중단점을 걸어서 디버깅해본다.
Personally I have found the ability to debug across a network extremely useful for when I am tinkering about with DirectX in exclusive fullscreen mode. I hope you will find this tutorial useful If you have any problems due to any inaccuracy that you know about on this page, please contact me at solosnake@hotmail.com If you have problems with your particular PC/Network/LAN/code, please don't contact me!








