microsoft / microsoft/vscode-java-debug
Cannot check array[0].lengh variable in debugger
Chưa có ai nhận issue này.
- 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ả
Hi everyone.
I have an issue when trying to debug a program that contains 2D array. If I try to put breakpoints checking for array[0].length, it fails with:
Breakpoint condition 'array[0].length > 0' error: Cannot evaluate because of compilation error(s): length cannot be resolved or is not a field.
After somme diggining, it seems that the debugger considers the array[0] object as a double:
Breakpoint condition 'array[0][0] == 0' error: Cannot evaluate because of compilation error(s): The type of the expression must be an array type but it resolved to double.
Do you have any idea on how to solve this?
Thanks
Nicolas
Environment
- Operating System: Ubuntu 22.04.3 LTS
- JDK version:
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)
- Visual Studio Code version:
Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.2.0-26-generic snap
- Java extension version: Java Extension Pack (v0.25.13)
- Java Debugger extension version: v0.53.0
Steps To Reproduce
- Add in Watch
array.length - Add in Watch
array[0].length - Add coniditional breakpoint in line 15:
array[0].length > 0
Current Result
Breakpoint condition 'array[0].length > 0' error: Cannot evaluate because of compilation error(s): length cannot be resolved or is not a field.
Expected Result
Debugger should stop on breakpoint without error
Files
Code source: TestDebugger.java.txt
Log file:
client.log.2023-08-24.txt
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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 chạy bản tái hiện TestDebugger.java.txt đính kèm trong VS Code và kiểm tra client.log.2023-08-24.txt cùng với hành vi đánh giá biểu thức của trình gỡ lỗi đối với array.length và array[0].length. Được xem là hoàn tất khi các biểu thức theo dõi và breakpoint có điều kiện liên quan đến array[0].length được đánh giá mà không có lỗi.
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, typescript, vscode
- Lĩnh vực
- 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
- 45/100