microsoft / microsoft/vscode-java-debug

Cannot check array[0].lengh variable in debugger

Abierto
#1,379 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

ai-triaged bug evaluation
Lenguaje dominante
TypeScript
Estrellas
591
Forks
429
Merge medio
1 d 9 h
PR fusionados (30 d)
19

Descripción

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
  1. Add in Watch array.length
  2. Add in Watch array[0].length
  3. 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.

Screenshot from 2023-08-24 12-53-09

Expected Result

Debugger should stop on breakpoint without error

Files

Code source: TestDebugger.java.txt
Log file:
client.log.2023-08-24.txt

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza ejecutando en VS Code la reproducción adjunta TestDebugger.java.txt e inspecciona client.log.2023-08-24.txt junto con el comportamiento del depurador al evaluar array.length y array[0].length. Se considera terminado cuando las expresiones de inspección y el punto de interrupción condicional que incluye array[0].length se evalúen sin errores.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, typescript, vscode
Área
devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.