Debugging Tip
2014년 1월 15일 수요일
PM 1:32
먼저 Eclipse에서 보여주는 simbol을 살펴보자
우선 symbol들을 알아보자.
http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-icons.htm
-
- debugging mode에서 break 설정이 안될경우
아래 그림에서 Looper.loop()가 있는 구문의 왼쪽처럼 색깔(파란색)이 들어가 있어야 break 설정이 된다.
이 색깔이 들어가게 하려면, 해당 class를 열어줘야 한다. 즉 file로 열어 해당 file에 같이 있는 class를 browsing한 후 그 class에 break를 걸게 되면 안걸리게 된다.
따라서 정확한 이름으로 해당 class를 열어줘야 break가 설정된다.
특정변수를 casting
watch를 한 후 특정변수에 add watch expression으로 type casting
현재 context의 symbol값을 가지고 Display에서 간단한 수식에 대한 결과확인이 가능하다. 블록으로 실행하고자 하는 구문선택 후 오른쪽의 J icon 클릭하여 실행
-
- Casting시 Formatter를 사용하는 방법
-
- 특정 Thread만 Break
java경우 여러 thread에 의해 해당 code가 reenterent 가능하므로 디버깅이 복잡하게 된다. 이경우 특정 thread만 선택하여 break를 걸수 있다
"break를 걸고 오른쪽 마우스 edit break에서 원하는 thread선택하면 된다."
-
- break 시 condition
조건부 break 예제 (conditional check, suspend when true check
handleMessage에서 Break가 걸리지 않아야 하는 객체를 아래와 같이 기술하면 된다.
if ((msg.target.toString().contains("KeyguardUpdateMonitor"))
(msg.target.toString().contains("VolumePanel")))
|
---|
-
- code에서 처리하지 않은 exception이 발생하는지 검사할때
method break point 로 method entry나 exit에서 break가 가능하다
-
- Class load break point로 class load시 break가 가능하다.