Skip to content

Line number is not corrected match for system classes on the Ubuntu #11

Closed

Description

Project: https://github.com/fbricon/vscode-java-demo
System: Ubuntu

  1. Git clone the project
  2. Open with VSCode and wait for the project initialized with language server
  3. Config launch.json
  4. Start debugging

Issue: Debug into the system classes such as Arrays/AbstractCollection, it will stop at the last line

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        
        {
            "type": "java",
            "name": "Debug (Launch)",
            "request": "launch",
            "mainClass": "com.redhat.vscode.demo.DevoxxApplication",
            "args": "",
            "sourcePaths": [
                "${workspaceRoot}"
            ]
        },
        {
            "type": "java",
            "name": "Debug (Attach)",
            "request": "attach",
            "hostName": "localhost",
            "port": 0,
            "timeout": 30000,
            "sourcePaths": [
                "${workspaceRoot}"
            ]
        }
    ]
}

error

Activity

  1. added this to the 0.1.0 milestone on Sep 15, 2017
  2. Eskibear commented on Sep 18, 2017

    @Eskibear
    Member

    Reason: lack of source file.

    Currently in latest Ubuntu, default-jdk is openjdk-8-jdk, and it doesn't contain source code. Now we decompile the class and open the generated 'sourcefile' with only method signatures. It's much smaller than the real source file, thus we cannot stop at the correct line.
    e.g.
    We're told to stop at Line 666 of PrintStream.java, but the decompliled 'PrintStream.java' has only 180 lines. So it stops at the last line.

    After install openjdk-8-source package, it behaves normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions