2016-11-04 4 views
0

Eclipse 플러그인에서 프로그램 적으로 중단 점을 설정하려고합니다. 그것은 잘 작동하는 것 같다; 마커가 편집기 사이드 바에 추가되고 중단 점 항목이 중단 점보기에도 추가됩니다. 그러나 프로그램을 디버깅 할 때 VM은 중단 점에서 일시 중단되지 않습니다. 또한 getNormalFlowFunction을 호출하기 전에 VM을 일시 중단 한 다음 단계로 들어가면 VM이 갑자기 재개되어 프로그램이 끝날 때까지 실행됩니다. 불행히도 오류 메시지는 없습니다. 필자는 매개 변수에 문제가 있다고 가정하지만 필자가 찾은 문서와 샘플 코드에서 무엇이 잘못 될지 알 수 없습니다. 어떤 아이디어?Eclipse : JDIDebugModel로 중단 점 설정

resource: L/code/src/code/Main.java class: Main method: getNormalFlowFunction signature: (QString;)QString; resource: L/code/src/code/Main.java entry: true exit: false nativeOnly: false line: 12 charStart: 248 charEnd: 405 hit count: 0 register: true attrs: {}

대상 클래스는 다음과 같습니다 :

package code; 

public class Main { 
    public static void main(String[] args) { 
     System.out.println("Hello World"); 
     System.out.println("Bla"); 
     String outSet = getNormalFlowFunction("Hallo"); 
     System.out.println(outSet); 
     anotherMethod(); 
    } 

    public static String getNormalFlowFunction(String inSet) { 
     System.out.println("getNormalFlowFunction"); 
     String outSet = inSet + inSet; 
     return outSet; 
    } 

    public static void anotherMethod() { 
     System.out.println("Another method"); 
    } 
} 

다음

내가

IJavaMethodBreakpoint breakpoint = JDIDebugModel.createMethodBreakpoint(resource, className, methodName, methodSignature, entry, exit, nativeOnly, lineNumber, charStart, charEnd, hitCount, register, attrs); 

나는 이러한 매개 변수 값을 사용하여 중단 점을 설정하고있어 어떻게

편집 : 디버거를 시작하기 전에 수동으로 중단 점을 설정하면 수동으로 설정된 중단 점에 작은 체크 표시가 표시되지만 프로그래밍 방식으로 설정된 중단 점은 표시되지 않습니다.

답변

0

내 매개 변수에는 몇 가지 문제가있었습니다. 나는

  1. 클래스는
  2. 서명이 해결해야 완전한 이름을이어야 같은 매개 변수를 볼 필요가 어떻게 알아 JDT으로 디버깅했다. ToggleBreakpointAdapter의 코드를 복사했습니다.
  3. chartStart 및 charEnd는 메서드 이름을 가리켜 야합니다. resource: L/code/src/code/Main.java class: code.Main method: getNormalFlowFunction signature: (Ljava/lang/String;)Ljava/lang/String; resource: L/code/src/code/Main.java entry: true exit: true nativeOnly: false line: 12 charStart: 269 charEnd: 290 hit count: 0 register: true attrs: null

    : 제 n 여기서

뒤에 getNormalFlowFunction 및 charEnd 포인트 g에 charStart 포인트 파라미터의 갱신 된 목록