수안이의 컴퓨터 연구실

  • Mainpage
  • About Me
  • Tags
  • Metapage
  • Notice
  • Location
  • Keywords
  • Guestbook
  • Admin
  • Write an Article
  • Total | 1620950
  • Today | 330
  • Yesterday | 482

6 Articles, Search for 'Debugging'

  1. 2008/05/01 Javascript Tutorials, References
  2. 2007/08/16 WinDbg 사용법
  3. 2007/03/21 ATL 디버깅 정보 출력하기
  4. 2007/01/22 Microsoft .NET Framework SDK 디버거 설명서
  5. 2007/01/22 Set Next Statement를 이용하여 디버깅하기
  6. 2007/01/22 ATL 디버깅 정보 출력하기
Web/Javascript2008/05/01 01:20

Javascript Tutorials, References

Site : http://webdeveloper.econsultant.com/

Articles on understanding Javascript.

  1. Andys Introductory JavaScript Tutorials : starting tutorials.
  2. Basic JavaScript : : Learn basics and write your first script.
  3. JavaScript Primer : Learn basics at JavaScriptKit
  4. Introduction to JavaScript : tutorials at W3Schools
  5. JavaScript 101 - Part 1 : Intro article by Kevin Yank
  6. JavaScript 101 - Part 2 : Intro article by Kevin Yank
  7. JavaScript 101 - Part 3 : article on client-side form validation
  8. Learning JavaScript for Beginners : Learn basics at JavaScriptMall
  9. Introductory Guide to regular expressions : tutorial is written by Karen Gayda
  10. JavaScript tutorial - Event information : at HowToCreate
  11. Traditional event registration model : at QuirksMode
  12. Advanced event registration models : at QuirksMode
  13. HTC Reference (MSDN) : mechanism to implement components in script as Dynamic HTML (DHTML) behaviors.
  14. JavaScript Object-Oriented Programming Part 1 : at SitePoint
  15. JavaScript Object-Oriented Programming Part 2 : at SitePoint

Software / services for debugging / testing Javascript.

  1. Debugging JavaScript programs : A quick reference guide that helps you find errors, even without the aid of a debugging utility.
  2. FireBug JavaScript Debugger : FireBug lets you explore the far corners of the DOM by keyboard or mouse.
  3. JavaScript Assertion Unit Framework : unit testing framework.
  4. Javascript Debugging : Javascript Debugging article at Mozilla.
  5. JsUnit : JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript.
  6. JsUnit v1.2 : JsUnit is a simple framework to write repeatable tests in JavaScript.
  7. Learning the JavaScript debugger Venkman : visual guide to Venkman.
  8. Log4Ajax : AJAX and Log4j for traditional logging.
  9. Venkman JavaScript Debugger : Venkman is the code name for Mozilla’s JavaScript Debugger.
  10. CodeTrimmer : Script compresses JavaScript documents by removing excess comments, whitespace, newlines, and redundant script

Editors / plugins for Javascript.

  1. JSEditor plugin for Eclipse : JSEditor is a plug-in for the Eclipse IDE that provides basic JavaScript editing functions such as syntax hi-lighting and content outlining.
  2. JSEclipse plugin for Eclipse : JSEclipse is the best and most popular Javascript plugin for the Eclipse environment.
  3. MyEclipse JS Editor/Debugger : MyEclipse is a comprehesive and affordable Integrated Development Environment based on the Eclipse platform.
  4. NetBeans JavaScript Editor : JavaScript support to NetBeans IDE 5.0.
  5. Oracle jDeveloper : Oracle JDeveloper is a free integrated development environment with end-to-end support for modeling, developing, debugging, optimizing, and deploying Java applications and Web services.
  6. Sun Java Studio Creator : Java Studio Creator 2 is built on NetBeans 4.1, and includes features like a new set of JavaServer Faces components, support for building JSR-168 portlets, easy access to databases, a streamlined application model.

Forums to discuss Javascript problems.

  1. CodingForums: JavaScript programming : JavaScript programming at CodingForums
  2. Google Groups: comp.lang.javascript : JavaScript language forum on GoogleGroups

Libraries to implement Javascript.

  1. Behaviour : Javascript library that uses CSS selectors to apply javascript behaviors.
  2. ColorCombos : color combination palettes and tool
  3. Cross Browser | Toys : X Library, Demos & Applications
  4. DHTML Goodies : A library of DHTML and AJAX scripts
  5. dojo : open-source javascript toolkit
  6. Dynamic Drive CSS Library : practical javascript + CSS codes and examples such as CSS menus
  7. Image Reflection : add reflections to images on your webpages. It uses unobtrusive javascript to keep your code clean.
  8. Javascript Motion Tween : Javascript animation engine
  9. jQuery : new type of Javascript library. It is not a huge, bloated, framework promising the best in AJAX - nor is just a set of needlessly complex enhancements.
  10. Mochikit : A lightweight Javascript library
  11. Moo.fx : Superlightweight, javascript effects library.
  12. PEAR : a framework and distribution system for reusable PHP components
  13. Prototype : JavaScript framework that aims to ease development of dynamic web applications.
  14. Rico : open-source javascript toolkit
  15. Script.aculo.us : easy-to-use, compatible and, ultimately, totally cool JavaScript libraries to make your web sites and web applications fly, Web 2.0 style.
  16. sIFR : method to insert rich typography into web pages.
  17. Swat : open-source web application toolkit built with PHP5 (http://www.php.net/).
  18. Yahoo UI Library : set of utilities and controls, written in JavaScript, for building richly interactive web applications
  19. Transparent Custom Corners and Borders : make resizable box with rounded corners, custom borders, and a transparent shadow by Roger Johansson.

Reference sites for Javascript.

  1. Core JavaScript Reference : at WebReference
  2. JavaScript Reference : at JavaScriptKit

Tutorials to learn Javascript.

  1. JavaScript Tutorial : JavaScript tutorials at W3Schools.
  2. JavaScript tutorials : 100+ tutorials at Tutorialized.com
  3. JavaScript Tutorial : at Tizag.com
  4. Project Cool: Web Development Basics : JavaScript Tutorials at DevX
  5. QuirksMode : 150 pages with CSS and JavaScript tips and tricks by Peter-Paul Koch
  6. Sons of Suckerfish : create link hover effects using JavaScript and CSS.
  7. Getting Started with Ajax : Intro to Ajax by Aaron Gustafson
  8. Tutorials : Round-up of 30 AJAX Tutorials : Ajax Tutorials
  9. Tutorials : 60 More AJAX Tutorials : Ajax Tutorials
  10. 50 AJAX Reference Websites From Around the World : list of AJAX reference sites


"Javascript" 카테고리의 다른 글
  • Javascript Tutorials, References (0)2008/05/01
2008/05/01 01:20 2008/05/01 01:20
Posted by webdizen
Tags Ajax, Debugging, Javascript, JsUnit
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/3223

Leave your greetings.

[로그인][오픈아이디란?]

Programming2007/08/16 10:56

WinDbg 사용법

출처 : http://0range.net/entry/Windbg%EC%9D%84-%EB%A7%88%EC%8A%A4%ED%84%B0-%ED%95%98%EC%9E%90


프로세스 리스팅

!process 0 0


프로세스 어태치 시키기
.process /i [pid]

할당된 가상메모리 덤프

올리디버거의 Memory Map윈도의 기능

!vadump [-v]


해당메모리 주소가 어떤 속성인지 알려줌

!vprot [주소]


현재 프로세스내에 동작중인 스레드의 스택을 보여줌

!uniqstack [-b]

-b옵션을 주면 스택에 담긴 아규먼트까지 보여준다


현재 스레드에 할당된 권한(Privilege)를 보여줌

!token


각 스레드가 동작한 시간

!runaway


레지스트리 정보 확인

!dreg

예) 0:000> !dreg System\CurrentControlSet\Services\Tcpip!*


해당 주소를 UNICODE_STRING구조체 형식으로 살펴봄

!ustr [주소]

typedef struct _UNICODE_STRING {
    USHORT Length;
    USHORT MaximumLength;
    PWSTR  Buffer;
} UNICODE_STRING;


해당 주소를 ANSI_STRING혹은 OEM_STRING구조체로 살펴봄

!str [주소]

typedef struct _STRING {
    USHORT Length;
    USHORT MaximumLength;
    PCHAR Buffer;
} STRING;
typedef STRING ANSI_STRING;
typedef STRING OEM_STRING;


스레드 로컬 스토리지 슬롯을 살펴봄

!tls

모든 슬롯 출력

예) !tls -1

Specifies the thread environment block (TEB). If this is 0 or omitted, the current thread is used

예) !tls 0


현재 스레드의 TEB정보를 출력

!teb


현재 프로세스의 PEB정보를 출력

!peb


잘 알려진 몇몇 STL템플릿정보를 출력

!stl


로딩된 dll모듈의 베이스주소와 길이 모듈명을 출력한다

lm


해당모듈의 자세한 정보를 출력

!lmi [모듈]

예) !lmi 00400000


반복적인 디버거명령을 실행시키면서, 링크드리스트 정보를 출력함

!list

예) !list "-t ntdll!_LIST_ENTRY.Flink -e -x \"dd @$extret l4; dt ntdll!_RTL_CRITICAL_SECTION_DEBUG @$extret-0x8\" ntdll!RtlCriticalSectionList"


현재 Shared User-mode Page를 출력함

현재 타임존과 시스템루트, TickCount와 시간을 출력함

!kuser


로드된 모듈들의 리로케이션되기전의 주소를 출력한다

!imgreloc [주소]


최근 에러코드를 리턴한다

!gle


에러코드를 가지고 무슨 에러인지 설명을 보여준다

!error [에러코드번호]

글로벌 플래그를 설정 혹은 보여준다

!gflag


로드된 모듈들에 대한 커스터마이징(?)된 출력을 해준다.

!for_each_module ["명령어"]

예) !for_each_module .echo @#ModuleIndex : @#Base @#End @#ModuleName @#ImageName  @#LoadedImageName

로드된 모듈에서 MZ로 시작되는것을 찾는다
예) !for_each_module s-a @#Base @#End "MZ"


가상메모리에서 이미지헤더를 검색한다 (MZ검색)

.imgscan


표현식을 헥사, 8진수, 2진수, 시간형, Float형, Double 형으로 변환한 형태로 보여준다

.formats [표현식]

"Programming" 카테고리의 다른 글
  • Visual Studio 2005 Shortcut Keys (0)2007/08/17
  • WinDbg 간단 사용법 (0)2007/08/16
  • WinDbg 사용법 (0)2007/08/16
  • 평점계산기 v1.0 (0)2007/06/30
  • Stack을 이용한 계산기(Calculator) 프로그램 제작... (2)2007/06/28
2007/08/16 10:56 2007/08/16 10:56
Posted by webdizen
Tags Debugging, WinDbg
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/3118

Leave your greetings.

[로그인][오픈아이디란?]

Programming/ATL/COM2007/03/21 09:51

ATL 디버깅 정보 출력하기

원본 : http://www.debuglab.com/knowledge/atldebuginfo.html

1.요약

atlTraceFlags를 이용하여 디버깅시 ATL에 관련된 정보를 출력할 수 있다.


2.본문

MFC와 달리 ATL의 경우는 중요 메쏘드나 프러퍼티들에 trace하여 자신의 상태와 실행위치를 출력해주는 코드가 들어있다. 이러한 trace코드를 활성화 시키기위해서는 trace level과 category를 정의하면 되는데 다음과 같이 정의한다.

#ifndef ATL_TRACE_CATEGORY 

#define ATL_TRACE_CATEGORY 0xFFFFFFFF 

#endif 



#ifdef _DEBUG 



#ifndef ATL_TRACE_LEVEL 

#define ATL_TRACE_LEVEL 0 

#endif 

위의 정의는 ATLBASE.h에 디폴트로 정의된 값이다. 이렇게하면 ATL은 trace를 전혀 하지않는다.

caltegory와 level은 다음과 같이 정의 되어있다.


enum atlTraceFlags 

{ 

    // Application defined categories 

    atlTraceUser        = 0x00000001, 

    atlTraceUser2       = 0x00000002, 

    atlTraceUser3       = 0x00000004, 

    atlTraceUser4       = 0x00000008, 



    // ATL defined categories 

    atlTraceGeneral     = 0x00000020, 

    atlTraceCOM         = 0x00000040, 

    atlTraceQI          = 0x00000080, 

    atlTraceRegistrar   = 0x00000100, 

    atlTraceRefcount    = 0x00000200, 

    atlTraceWindowing   = 0x00000400, 

    atlTraceControls    = 0x00000800, 

    atlTraceHosting     = 0x00001000, 

    atlTraceDBClient    = 0x00002000, 

    atlTraceDBProvider  = 0x00004000, 

    atlTraceSnapin      = 0x00008000, 

    atlTraceNotImpl     = 0x00010000, 

}; 

category를 잘 들여다보면 각 부문별로 분류되어있는것을 알수 있다(^ ^!)

stdafx.h 같은곳에 정의하면 많은 정보들을 볼 수 있다.


3.예제



4.참고

ATL Internals



- 2001.08.13 Smile Seo -

"ATL/COM" 카테고리의 다른 글
  • ActiveX 컨트롤로부터 URL 알아내기 (0)2007/03/23
  • [ActiveX] 키보드 메세지 받기 (0)2007/03/21
  • ATL 디버깅 정보 출력하기 (0)2007/03/21
  • 웹페이지가 이동될때 진입하는 함수 (0)2007/03/17
  • ActiveX를 무조건 다운로드 하게 하기 (0)2007/03/15
2007/03/21 09:51 2007/03/21 09:51
Posted by webdizen
Tags ATL, Debugging
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2715

Leave your greetings.

[로그인][오픈아이디란?]

Programming/Debugging2007/01/22 12:58

Microsoft .NET Framework SDK 디버거 설명서

고수닷넷 - 디버깅전문가님


여러분이 아무리 훌륭한 프로그래머라고 할지라도, 한번쯤은 실수를 저지를 수 있다. 만약 적절한 도구가 없다면 코드에서 발생한 문제점들을 해결하기 어려울 수 있다. 다행스럽게도 ASP.NET이 컴파일된 파일을 이용할 때의 특징은 Web 응용 프로그램을 디버깅하는 거이 다른 managed 응용 프로그램을 디버깅하는 것과 다르지 않다는 것을 의미한다. 또한 .NET Framewor SDK는 이러한 목적을 달성하기에 충분한 가벼운 디버거를 포함하고 있다.

이 글은 SDK에서 제공하는 디버거를 사용하여 ASP.NET Framework 응용 프로그램을 디버깅하기 위해서 필요한 과정들을 설명한다. 이 디버거는 로컬 개발 컴퓨터에서의 프로세스 수동 연결 디버깅을 지원한다. SDK에 포함되어 있는 디버거 문서에서 특정한 기능에 대한 정보를 확인할 수 있다.

ASP.NET 응용 프로그램에서 디버그 모드 활성화하기


ASP.NET Framework 응용 프로그램의 많은 구성 요소들이 런타임시에 동적으로 컴파일되기 때문에(예를 들면, .aspx와 .asmx 파일), 여러분은 응용 프로그램을 디버깅하기 전에 반드시 해당 응용 프로그램을 심볼 정보와 함께 컴파일하도록 ASP.NET 런타임을 구성해야 한다. 심볼(.pdb 파일) 파일들은 디버거가 바이너리에 대한 원본 소스 파일을 찾고 해당 소스 파일의 코드에 있는 중단점을 매핑하기 위해서 사용한다. 심볼 정보를 갖도록 응용 프로그램을 컴파일하기 위해서는, 우선 응용 프로그램의 루트 디렉터리에 있는 Web.config 파일을 찾는다. 그리고 다음과 같이 system.web 그룹내에 있는 compilation 섹션에서 debug 특성을 포함한다.

<configuration> 
<compilation debug="true"/> </configuration>



중요 : 이 특성은 응용 프로그램의 성능에 매우 큰 영향을 끼치기 때문에, 응용 프로그램을 디버깅할 때에만 이 특성을 활성화해야 한다.

ASP.NET 응용 프로그램 디버깅하기


해당 응용 프로그램에 대한 디버깅을 활성화했다면, 디버깅하고자하는 페이지에 대한 요청을 만들어야 한다. 이렇게 함으로써 ASP.NET 런타임 프로세스(Aspnet_wp.exe)가 생성되고 응용 프로그램이 메모리에 로드되도록 한다.

디버깅 시작하기 위해서는 다음 단계를 수행한다.

1. .NET Framework 디버거, DbgClr.exe(기본 위치는 C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\GuiDebug 이다)를 실행한다.
2. 디버깅하고자 하는 페이지에 대한 소스 파일을 열기 위해서 <파일>-<열기>-<파일> 메뉴를 선택한다.
3. <도구>-<프로세스 디버그> 메뉴를 선택한다. 이 메뉴를 선택하면 아래 그림과 같은 창이 표시될 것이다.
4. 만약 시스템 프로세스 표시 체크 상자를 체크되어 있지 않다면 이 체크 상자를 체크한다.
5. Aspnet_wp.exe 프로세스를 찾아서 프로세스에 연결하기 대화 상자를 띄우기 위해서 해당 프로세스를 더블 클릭한다.
6. 여러분이 작성한 응용 프로그램이 실행 응용 프로그램 목록에 표시되는지 확인하고 응용 프로그램에 연결하기 위해서 [확인]을 클릭한다.
7. 프로세스 대화 상자를 닫는다.


중요 : 여러분이 Aspnet_wp.exe 프로세스에 연결할 때, 해당 프로세스에 있는 모든 스레드가 멈춘다. 디버거에 연결되면 클라이언트 요청을 실행할 수 없기 때문에 실제로 사용중인 응용 프로그램은 디버깅하지 않도록 한다.

중단점 설정하기


페이지에서 중단점을 설정하기 위해서, 실행 문이나 함수/메서드를 포함하고 있는 줄의 왼쪽 여백을 클릭한다. 중단점이 설정된 곳에 붉은 점이 나타난다. 중단점이 Aspnet_wp.exe 프로세스에 있는 정확한 응용 프로그램 인스턴스에 적절하게 매핑되었는지를 확인하기 위해서 중단점 위로 마우스를 이동시킨다.

브라우저에서 해당 페이지를 다시 요청한다. 디버거가 중단점에서 멈추고 윈도우 포커스를 얻을 것이다. 이제 프로그램을 한단계씩 실행하거나 변수 값을 살펴보고, 지역 변수를 보거나 스택 정보 및 디스어셈블리 등을 확인할 수 있다. 또한 this (C#) 또는 Me (VB)에 의해서 사용된느 Request, Reponse, 그리고 Session과 같은 객체를 조사식 창에서 살펴볼 수 있다.


미리 컴파일된 컴포넌트에 대한 심볼 생성하기


비지니스 객체나 코드-비하인드 파일처럼 미리 컴파일된 컴포넌트를 디버깅하기 위해서는, 디버깅을 하기 전에 심볼릭 정보를 갖도록 컴파일해야 한다. 어셈블리에 대한 심볼은 전형적으로 경로 기반의 검색 알고리즘으로 찾는다. 심볼릭 정보를 찾기 위해서 PDB 라이브러리 (Mspdb70.dll)이 사용하는 이 알고리즘은 다음과 같다.

1. 어셈블리가 위치한 경로를 찾는다. 이 파일은 일반적으로 .pdb 파일이다. 지역 어셈블리의 경우 응용 프로그램의 /bin 디렉터리에 해당 DLL과 함께 심볼 (.pdb 파일)을 보관한다.
2. PE 파일 ( NB10 디버그 헤더)에 명시된 경로를 찾는다.
3. NT 심볼 파일 위치를 찾는다(_NT_SYMBOL_PATH와 _NT_ALT_SYMBOL_PATH 환경 변수).

알아두기 : 만약 심볼 정보를 찾을 수 없다면, 디버거는 사용자가 위치를 지정하도록 묻는다.

요약


1. 이 글에서 설명한 디버거는 로컬 개발 컴퓨터에서 실행중인 프로세스에 대해서 수동 연결 디버깅을 지원한다.
2. 디버깅을 이용하여 ASP.NET 런타임이 동적으로 심볼 정보를 갖도록 컴파일할 수 있다. 이 기능은 응용 프로그램의 루트 디렉터리에 있는 Web.config 파일에서 <compilation debug="true"/>를 설정하여 활성화한다. 이 기능을 활성화하면 응용 프로그램의 성능이 떨어지기 때문에, 여러분이 응용 프로그램을 디버깅하고 있을 때에만 활성화되어야 한다.
3. 응용 프로그램을 디버그하기 위해서는 페이지를 요청하고 Aspnet_wp.exe 프로세스에 디버거를 연결한 후, 중단점을 설정하고 해당 페이지를 재요청한다.
4. Aspnet_wp.exe 프로세스에 연결되면, 해당 프로세스에 있는 모든 스레드가 멈춘다. 디버거에 연결되면 클라이언트 요청을 실행할 수 없기 때문에 실제로 사용중인 응용 프로그램은 디버깅하지 않도록 한다.
5. 미리 컴파일된 컴포넌트를 디버깅하기 위해서는, 디버깅을 하기 전에 심볼릭 정보를 갖도록 컴파일해야 한다.
이 글은 다음 링크에 있는 글을 번역한 것입니다.
http://www.dotnetjunkies.com/quickstart ··· sdk.aspx

번역한 내용은 http://www.debuglab.com에서 가져왔습니다.

"Debugging" 카테고리의 다른 글
  • LastError를 보여주는 Debugging Trace Macro (0)2007/03/05
  • Dll에 breakpoint 설치하기 (0)2007/02/22
  • Microsoft .NET Framework SDK 디버거 설명서 (0)2007/01/22
  • Set Next Statement를 이용하여 디버깅하기 (0)2007/01/22
  • ATL 디버깅 정보 출력하기 (0)2007/01/22
2007/01/22 12:58 2007/01/22 12:58
Posted by webdizen
Tags .NET Framework, Debugging
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2585

Leave your greetings.

[로그인][오픈아이디란?]

Programming/Debugging2007/01/22 12:54

Set Next Statement를 이용하여 디버깅하기

고수닷넷- 디버깅전문가님

Set Next Statement를 이용하여 디버깅하기


1.요약

프로그램을 실행하는 도중에 특정한 값을 바꾸어서 함수의 흐름이 정상적으로 작동하는지를 살펴보고, 에러가 났다면, 어떤 값에서 에러가 난것인지를 재컴파일(Re-compile)없이 확인해보는 방법에 대해서 살펴보겠습니다.


2.본문

VC++ 디버거는 그 기능중에 전체 프로그램의 흐름을 이쪽 저쪽으로 뛰어다닐 수 있는 기능을 제공합니다.

Set Next Statement 라는 기능이죠. 물론 이 기능은 Run to cursor 와 같습니다.

그럼 다음과 같은 상황에서 유용하게 써먹을 수 있겠네요.
void Func(int nValue); 

라는 함수가 있는데..

nValue 값에 따라서 어떻게 다른 값이 출력되는지를 확인해 볼려고 하는데. 보통의 경우라면 다음의 두가지 방법을 사용하겠죠.

1. Func() 함수에 비교하고 싶은 값을 여러번 넣어서 매번 컴파일해서 확인한다.
2. Func() 함수를 여러번 사용하여 확인한다.

아.. 1번과 2번.. 어떤게 더 빠를까요? 둘다 너무 비효율적입니다.

그래서 사용할 수 있는 방법이 바로 제가 위해서 설명한 'Set Next Statement' 입니다.

그럼 위의 경우에 어떻게 적용할까요?

일단 Func() 에 넣어 보고 싶은 값을 넣어서 컴파일 합니다.
그리고 Func()를 Step Over를 써서 결과를 확인해 봅니다.
다시 Func() 를 Set Next Statement 로 해놓구..
들어가는 인자의 값을 바꿉니다. 그리고 다시 Step Over를 해봅니다. 하고싶을때까지 합니다..
그리고 끝냅니다.
이런 방법을 통해서 컴파일 하지도 않고 여러번 확인 할 수 있답니다.
물론, 이렇게 직접 변수의 값을 바꾸어 사용하기 때문에 제약도 있고, 주의해야 할 점도 많습니다.

그럼 이제 예제를 통해서 직접 확인해 보도록 하겠습니다.


3.예제

void Func(int nValue) 

{ 

    if (nValue < 0) 

        printf("Error"); 

    else 

        printf("Thanks.."); 

} 


int main(int argc, char* argv[]) 

{ 

    // 프로그램 시작시 

    // User Breakpointer 를 걸어 둡니다. 

    __asm int 3; 

    

    // 초기에 nVal의 값이 -1 로 설정되어 있기 때문에 

    // Func() 함수는 Error 값을 Console Window 에 print합니다. 

    // 그런데. 사용자가 nVal 의 값이 정확히 0 이상이면 

    // Thanks 를 출력하는지를 살펴보기 위해서 

    // nVal 의 값을 바꾸어 다시 컴파일 해서 살펴보아야 할 수도 있는데 

    // 실제로 그렇게 하지 않고, 

    // nVal 의 값을 Watch Window 에서 바꾸어 테스트 해볼 수도 있습니다. 

    

    // 1. Watch Window 창의 띄웁니다. 

    // 2. nVal=10  이라고 입력합니다. 

    // 3. 그럼 nVal의 값이 10으로 바뀐것을 확인할 수 있습니다. 

    // 4. [1] 번 라인에 마우스를 놓고, 오른쪽 버튼을 눌러 

    //    'Set Next Statement' 를 선택합니다. 

    // 5. 그럼 [1]번 라인으로 cursor 가 옮겨 진것을 확인할 수 있습니다. 

    // 6. 다시 F10 을 눌러 Step Over를 해서 Func(nVal); 을 지나면 

    //    화면에 Thanks.. 라는 값이 출력된것을 확인할 수 있습니다. 

    // 7. 이제 Func() 함수가 정상적으로 작동하는 값을 찾을 수 있습니다. 

    

    int nVal = -1; // [1] 번 라인 

    Func(nVal); // [2] 번 라인 

    

    return 0; 

} 

"Debugging" 카테고리의 다른 글
  • LastError를 보여주는 Debugging Trace Macro (0)2007/03/05
  • Dll에 breakpoint 설치하기 (0)2007/02/22
  • Microsoft .NET Framework SDK 디버거 설명서 (0)2007/01/22
  • Set Next Statement를 이용하여 디버깅하기 (0)2007/01/22
  • ATL 디버깅 정보 출력하기 (0)2007/01/22
2007/01/22 12:54 2007/01/22 12:54
Posted by webdizen
Tags Debugging, Next Statement
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2584

Leave your greetings.

[로그인][오픈아이디란?]

Programming/Debugging2007/01/22 12:52

ATL 디버깅 정보 출력하기

고수닷넷 - 디버깅전문가님

1.요약

atlTraceFlags를 이용하여 디버깅시 ATL에 관련된 정보를 출력할 수 있다.


2.본문

MFC와 달리 ATL의 경우는 중요 메쏘드나 프러퍼티들에 trace하여 자신의 상태와 실행위치를 출력해주는 코드가 들어있다. 이러한 trace코드를 활성화 시키기위해서는 trace level과 category를 정의하면 되는데 다음과 같이 정의한다.


#ifndef ATL_TRACE_CATEGORY 

#define ATL_TRACE_CATEGORY 0xFFFFFFFF 

#endif 



#ifdef _DEBUG 


#ifndef ATL_TRACE_LEVEL 

#define ATL_TRACE_LEVEL 0 

#endif 

위의 정의는 ATLBASE.h에 디폴트로 정의된 값이다. 이렇게하면 ATL은 trace를 전혀 하지않는다.

caltegory와 level은 다음과 같이 정의 되어있다.


enum atlTraceFlags 

{ 

    // Application defined categories 

    atlTraceUser        = 0x00000001, 

    atlTraceUser2       = 0x00000002, 

    atlTraceUser3       = 0x00000004, 

    atlTraceUser4       = 0x00000008, 



    // ATL defined categories 

    atlTraceGeneral     = 0x00000020, 

    atlTraceCOM         = 0x00000040, 

    atlTraceQI          = 0x00000080, 

    atlTraceRegistrar   = 0x00000100, 

    atlTraceRefcount    = 0x00000200, 

    atlTraceWindowing   = 0x00000400, 

    atlTraceControls    = 0x00000800, 

    atlTraceHosting     = 0x00001000, 

    atlTraceDBClient    = 0x00002000, 

    atlTraceDBProvider  = 0x00004000, 

    atlTraceSnapin      = 0x00008000, 

    atlTraceNotImpl     = 0x00010000, 

}; 

category를 잘 들여다보면 각 부문별로 분류되어있는것을 알수 있다(^ ^!)

stdafx.h 같은곳에 정의하면 많은 정보들을 볼 수 있다.


참고


ATL Internals...

"Debugging" 카테고리의 다른 글
  • LastError를 보여주는 Debugging Trace Macro (0)2007/03/05
  • Dll에 breakpoint 설치하기 (0)2007/02/22
  • Microsoft .NET Framework SDK 디버거 설명서 (0)2007/01/22
  • Set Next Statement를 이용하여 디버깅하기 (0)2007/01/22
  • ATL 디버깅 정보 출력하기 (0)2007/01/22
2007/01/22 12:52 2007/01/22 12:52
Posted by webdizen
Tags ATL, Debugging
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2583

Leave your greetings.

[로그인][오픈아이디란?]

«Prev  1  Next»

RSS HanRSS
Blog Image
webdizen
이 곳은 컴퓨터에 대해 연구하고, 공유하고, 소통하기 위한 연구실입니다. 개인적으로는 OLAP, Data Mining, Semantic Web, Data Modeling에 대해서 연구하고 있습니다.

Categories

전체 (2998)
Webdizen (134)
Life (6)
Diary (16)
Blog (9)
IDEA (1)
Travel (10)
Book (14)
Photo (7)
Movie (7)
Music (13)
Leisure Sports (10)
Funny (5)
Hardware (119)
Software (120)
Windows (5)
Unix & Linux (119)
Installation (4)
Kernel (10)
System (34)
Develop (22)
X-Window (0)
Applicaton (31)
Security (4)
Framework (2)
Hadoop (2)
Programming (805)
Algorithm & Data Structure (1)
Assembly (38)
UNIX/Linux C (95)
C++ (128)
STL (4)
Java (38)
Win32 API (92)
ATL/COM (44)
MFC (151)
.NET (26)
WCF/WPF (4)
C# (28)
Network Programming (17)
Database Programming (12)
OpenGL / DirectX (13)
Multimedia Programming (0)
Game Programming (21)
Parallel Distributed Progra... (0)
Reverse Engineering (0)
Debugging (9)
Python (1)
Ruby (1)
Ruby on Rails (1)
QT (4)
GTK (0)
JSP (0)
PHP (6)
ASP.NET (6)
ASP (3)
Development (28)
Useful Library (2)
Data Modeling (0)
Database (105)
Oracle (4)
MSSQL (41)
MySQL (2)
Data Warehouse (2)
Data Mining (3)
Network (66)
Web (78)
DHTML (4)
XHTML (1)
Javascript (1)
CSS (1)
AJAX (9)
XML (11)
Flex (1)
Silverlight (3)
Security (91)
DoS (1)
Kernel (10)
Scanning (3)
Sniffing (0)
Spoofing (4)
Overflow (28)
Web (11)
Shell (10)
Format String (14)
Window (2)
Embedded (70)
Multimedia (27)
Mobile (14)
Graphic (24)
Management (633)
Knowledge (581)
Hadoop (0)

Notice

  • 메타 블로그 사이트에 등록
  • 새해 맞이 블로그의 변화
  • 블로그 명칭 변경
  • 도메인(www.webdizen.net) 구...
  • TEXTCUBE 1.6.1로 업그레이드...

Tags

  • warning 제거
  • 돌체 노벨라
  • 정치인
  • 나래관
  • Table
  • Regular Expression
  • 어학교육원
  • 지식
  • 의과대학
  • Event
  • 까무스
  • Tray
  • 비자
  • 미국
  • 에어론 의자
  • 명함
  • LaTeX
  • 대한민국
  • 캐시
  • 슬로코도

Recent Articles

  • ASCII Code의 CRLF 제거 방법.
  • Hadoop 에서 c++ API 이용시....
  • Ubuntu Linux에서 Hadoop 구....
  • 내 심장을 한껏 뛰게한 "국가....
  • 스타 스키마 데이터베이스 설....

Recent Comments

  • ■ 온라인카지노 ▶ http://L....
    asdf 11/21
  • 그리고 혹시 해외여행자보험....
    kim 11/05
  • ★★실제 바다게임장과 똑같....
    asdf 11/04
  • sbsyama.co.to← 짱5000만당....
    asdf 11/04
  • ♡KicaZ??o(???) 바카라사....
    fdsf3fass 11/03

Recent Trackbacks

  • 파일 열기/저장하기 CFileDialog.
    은마군의 나태블록 02/11
  • World IT Show 2008.
    상우 :: Oranzie's BLOG 2008
  • cvs서버 설치하기.
    3인3색 2008
  • 속속 공개되는 Google Chart....
    PHP와 Web 2.0 2007
  • 마방진을 구하는 프로그램.
    Oranzie's BLOG 3 2007

Archive

  • 2009/09 (3)
  • 2009/08 (1)
  • 2009/03 (1)
  • 2009/02 (9)
  • 2009/01 (13)

Calendar

«   2009/11   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

Bookmarks

    • Administration
      • IIS.NET
      • NTFAQ
      • OS의 모든 것
      • 리눅스포털
    • Database
      • SQL Server Central
      • SQL Team
    • Development
      • .NET Heaven
      • ASP Alliance
      • ASP.NET 2.0
      • Bullog.net
      • C# Corner
      • C++ (C PlusPlus.com)
      • C++ Reference
      • CodeGuru
      • CodePlex
      • DebugLab
      • Dev Articles
      • Devpia
      • DotNet Junkies
      • DotNet Zone
      • Driver Online
      • GOSU.NET
      • HOONS 닷넷
      • Joinc 팀블로그
      • KOSR
      • MSDN Home Page
      • OSR Online
      • Sky.ph - 개발자 커뮤니...
      • TAEYO.NET
      • The Code Project
      • WindowsClient.net
      • 김상욱의 개발자 Side
      • 조인시 위키
    • Human Networks
      • belief21c's e-space
      • I think I can
      • Invisible Rover's Blog :D
      • Rodman®
      • ■ Feel So Good~! ■
      • 까만 나비
      • 나를 가꾸는 시간.
      • 나만의 즐거움~~!
      • 단녕
      • 상우 :: Oranzie's BLOG
    • Information Technology
      • Microsoft TechNet
      • 지디넷코리아 - 글로벌...
    • Security
      • FoundStone
      • milw0rm
      • NewOrder
      • OpenRCE
      • Phrack.org
      • Reverse Engineering b1...
      • Reverse Engineering Team
      • RootKit
      • SecurityFocus
      • SecurityXploded by Nag...
      • Wow Hacker
      • Zone-H
Textcube
Louice Studio Inc.
Powered by Textcube. Original designed by Tistory.