microsoft / microsoft/vscode-java-debug

Unable to debug Java Card Applet Code using Java Card Simulator.

Đang mở
#1,280 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

ai-triaged breakpoint question
Ngôn ngữ chính
TypeScript
Star
591
Fork
429
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
19

Mô tả

I am trying to debug a Java Card Project in VS Code, but the breakpoints are not hit.

Environment
  • Operating System: Windows 10.
  • JDK version: 17.0.5 LTS
  • Visual Studio Code version: 1.74.2
  • Java extension version:
  • Java Debugger extension version: 0.47.2022112823
Steps To Reproduce

image

  1. Download and Install Java Card Simulator from Oracle. [Java Card Classic Development Kit 3.0.5u4]
    https://www.oracle.com/java/technologies/java-archive-downloads-javame-downloads.html#javacardkitv305
  2. Download and Extract Sample Java Card Project. [Sample.zip attached.]
  3. Terminal 1: Start the Simulator.
    cd "{Your_Install_Location}\Java Card Development Kit 3.0.5u4\bin}"
    cref_tdual.exe -p 9025 -debugPort 7019
  4. Terminal 2: Launch APDU Tool.
    cd "{Your_Install_Location}\Java Card Development Kit 3.0.5u4\bin}"
    apdutool.bat -p 9025
  5. Load the cap file in Simulator.
    • Copy paste the contents of {Your_Extract_Location}/apdu_scripts/cap-com.sample.script in Terminal-2 and press Enter
  6. Installing the application in Simulator.
    • Copy paste the contents of {Your_Extract_Location}/apdu_scripts/create-com.sample.MyApplet.script in Terminal-2 and press Enter.
  7. Terminal 3: Launch Debug Proxy.
    cd "{Your_Install_Location}\Java Card Development Kit 3.0.5u4\lib"
    java -jar jc-debug-proxy.jar -port 8989 -vmPort 7019 -capPath {Your_Extract_Location}\Sample\deliverables\com\sample\javacard\sample.cap

---- Debugging In VS Code [Doesn't work]-----

  1. Open the Sample project in VS Code.
  2. Start the debug session in VS Code.(Press F5). [A launch.json with correct configurations is already present.]
  3. Open the file src/com/sample/MyApplet.java and set a breakpoint at line 57.
  4. In Terminal-2
    0x00 0xA4 0x04 0x00 0x06 0x89 0x89 0x89 0x89 0x89 0x81 0x7F;
    • Press Enter.
    • The breakpoint at Line-57 should be hit. [This doesn't work.]

---- Debugging with Eclipse for Java [Working] ----------

  1. Open the Sample project in Eclipse.
  2. Select File -> Open Projects From File System -> Select the Sample Directory.
  3. Setup Debug Configuration.
    • Select Run -> Debug Configurations...
    • On Left Panel Select Remote Java Application.
    • In Project Field, Click on Browse and Select Sample.
    • Change the port to 8989
    • Click on Apply then Debug.
  4. Open the file src/com/sample/MyApplet.java and set a breakpoint at line 57.
  5. In Terminal-2
    0x00 0xA4 0x04 0x00 0x06 0x89 0x89 0x89 0x89 0x89 0x81 0x7F;
    • Press Enter.
    • The breakpoint at Line-57 should be hit. [Working]
Additional Informations

Sample.zip

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lỗi breakpoint với Java Card Simulator, Debug Proxy, APDU Tool và dự án Sample được cung cấp; so sánh phiên VS Code F5 với phiên gỡ lỗi từ xa đang hoạt động của Eclipse trên cổng 8989. Kiểm tra launch.json hiện có và breakpoint tại src/com/sample/MyApplet.java:57. Được xem là hoàn tất khi lệnh APDU luôn dừng tại breakpoint đó trong VS Code.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, vscode
Lĩnh vực
developer-experience, devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.