Debugging in the Eclipse
-
Upload
harrison-santiago -
Category
Documents
-
view
163 -
download
0
description
Transcript of Debugging in the Eclipse
![Page 2: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/2.jpg)
목차
Eclipse 에 대한 소개 Eclipse Architecture Eclipse Perspective
Eclipse Debugging View Step 단위 진행 Step Filtering
Eclipse Tips
![Page 3: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/3.jpg)
Eclipse
Open-source 개발 Platform 원래 IBM 에서 개발하던 개발 Platform JAVA 로 작성되어 개발되었음
• JAVA VM 위에서 돌아가기 때문에 , JAVA VM이 실행될 수 있는 어떤 운영체제에서도 돌아감(Window, Linux, Unix...)
다양한 프로그래밍 언어 개발을 지원• JAVA IDE 뿐만 아니라 , C/C++, Python 등의 다른 언어로의 개발도 가능
Eclipse 라는 이름은 식 ( 蝕 ) 을 의미• Sun Microsystems 을 염두에 두고 지은것이라 추측
현재 많은 S/W 벤더들이 컨소시엄에 참가하고 있음• 우리 나라의 ETRI 도 참여하고 있음
![Page 4: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/4.jpg)
Eclipse Architecture
![Page 5: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/5.jpg)
Eclipse Architecture (cont`d)
Platform RunTime Eclipse 의 kernel 에 해당하는 부분 이 부분을 제외한 이클립스의 모든 부분이 플러그인
Workbench 이클립스 IDE 의 표준화된 인터페이스를 제공함 개발자가 실제로 접하는 부분 SWT/JFace 로 구현
Workspace 자원 ( 사용자가 생성한 project, file, folder 등 ) 의 관리
![Page 6: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/6.jpg)
Eclipse Architecture (cont`d)
JDT (Java Development Tools) 이클립스를 이용한 JAVA 개발 환경을 지원 JAVA Application Compile, Debugging, UI View 등
PDE (Plug-in Development Environment) 이클립스에 필요한 또 다른 플러그인을 제작할 수 있는 환경 이클립스의 기능을 무한대로 확장시켜 줄 수 있는 토대
![Page 7: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/7.jpg)
Eclipse Perspective
Perspective Workbench 를 구성하는 editor/view 의 모음 현재 작업공간이나 프로젝트를 어떤 시각 (perspective) 로
볼 것인 가에 대한 표현 JAVA Programming 을 할 때는 JAVA perspective 로 작업 Debug 를 할 때는 Debug perspective 로 작업
![Page 8: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/8.jpg)
Debug Perspective
![Page 9: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/9.jpg)
Debugging View
디버깅하는 프로그램을 실행 / 관리 디버그 모드로 실행할 경우에 , 해당 프로그램에 속하는
Thread 까지 표시됨 여러 개의 프로그램을 동시에 디버깅할 수 있음
• 서버 / 클라이언트 기반 프로그램을 동시에 실행시켜서 디버깅할 수 있음
![Page 10: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/10.jpg)
Variables View
Debug View 에서 선택한 스택 프레임에서 볼 수 있는변수들을 트리 형태로 표시
![Page 11: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/11.jpg)
BreakPoints view
현재 설정한 BreakPoint 들을 보여준다 소스코드에 직접 가지 않아도이곳에서 Breakpoint 를
비활성화 / 해제 할수 있음 Hit Count / Suspend VM 설정이 가능
• Hit Count : breakpoint 가 정해진 횟수만큼 실행되기 직전에만 멈춤• Suspend VM : 프로그램의 모든 스레드를 일제히 멈추게 함
![Page 12: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/12.jpg)
Expression View
현재 스택 프레임의 context 에서 , 어떤 수식이나 변수를평가하여 그 값을 보여줌 값이 변화하는 모습까지도 확인 가능
![Page 13: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/13.jpg)
Display View
현재 스택 프레임의 컨텍스트에서 수식 또는 변수를 평가하여 그 값을 보여줌
Expression view 와 다른 점은 평가하려는 수식이나 변수를 뷰 에 직접 입력 가능함
디버깅 중 실제 코드를 수정하지 않고 어떤 값을 평가해 볼 수 있음
GUI Application 에서 프로그램 실행 중 UI 를 변경할 수도 있음( 실제 코드를 수정하는 것이 아니기 때문에 임시적 )
![Page 14: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/14.jpg)
Display View
![Page 15: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/15.jpg)
Hot Code Replace
프로그램이 디버깅 모드에서 실행되고 있는 동안에도 코드를 수정하여서 컴파일한 결과를 반영하는 기능 소스를 수정하고 바로 저장하면 실행중인 결과가 반영됨 메소드나 필드를 추가한 경우에는 hot code replace 가 불가능함
-> 다시 실행시켜야 함
![Page 16: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/16.jpg)
Step 단위 진행
Breakpoint 로 프로그램의 실행 중 어떤 스레드가 멈춘 후 , 프로그램을 한 스텝씩 진행시키는 방법
Step Into (F5 key) : 현재의 명령문이 호출하는 method 속으로 진행하여 그 첫문장을 실행하기 직전에 멈춘다
Step Over (F6 key) : 현재의 명령문을 실행하고 다음 명령문 직전에 다시 멈춘다
Step Return (F7 key) : 현재의 메소드에서 리턴한 직후에 다시 멈춘다
Resume (F8 key) : 멈추어 있던 스레드를 계속 실행시킨다 .( 다음 breakpoint 가 있을 때까지 )
![Page 17: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/17.jpg)
Step Filter
프로그램을 스택 단위로 진행할 때 , 실행 상태를 추적할 필요가 없는 패키지나 클래스를 그냥 넘어가게 하는 기능 디버깅 중에 Step Into 를 하게 되면 Java 클래스 라이브러리
수준까지 스텝을 진행하는 점을 해결 Debug View 에서 step with filter 로 설정 (Shift + F5) Preferences 다이얼로그의 JAVA>debug>step Filtering
에서어떤 클래스나 패키지를 Filtering 할 것인지 설정할 수 있음
• Filter synthetic method : 어떤 클래스를 컴파일할때 컴파일러가 임의로 정의해 바이트코드에 추가한 메소드들을 필터링함
• Filter static initializers : 모든 클래스의 정적 초기화 블록과 정적 멤버 초기화 코드를 필터링
• Filter Constructors : 모든 생성자를 필터링함
![Page 18: Debugging in the Eclipse](https://reader035.fdocument.pub/reader035/viewer/2022062217/56813588550346895d9ceabf/html5/thumbnails/18.jpg)
Appendix : Eclipse Tips
JavaDoc Using JAVA API Generating User-defined JavaDoc
Library Import Import statement Organization : Shift + Ctrl + OOpen Declaration : F3Quick Fix : Ctrl+1Key Assists : Shift+Ctrl+L