Visitar URL original
can not debugging external files · Issue #328 · microsoft/java-debug · GitHub
The Wayback Machine - https://web.archive.org/web/20201202182632/https://github.com/microsoft/java-debug/issues/328
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not debugging external files #328

Open
qinlinwang opened this issue Apr 12, 2020 · 6 comments
Open

can not debugging external files #328

qinlinwang opened this issue Apr 12, 2020 · 6 comments
Assignees

Comments

@qinlinwang
Copy link

@qinlinwang qinlinwang commented Apr 12, 2020 •

when i debug, i can not debugging external files, even though i have user contex menu "attach source" to add third party source jars;
in Call Stack, there are a lot of classes which is "Unknown Source", but i have "attach source" to vscode.
I use the latest version of vscode.
Please help me. Thanks!
微信图片编辑_20200412113329

@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Jun 28, 2020

in Call Stack, there are a lot of classes which is "Unknown Source", but i have "attach source" to vscode.

After you attached source, are you able to jump the corresponding source with "Go to Definition" feature?

@qinlinwang
Copy link
Author

@qinlinwang qinlinwang commented Jul 18, 2020 •

The problem is that: when i click "Go to Definition" menu, it only open the interface, but not open the real class.
For example, when i "Go to Definition" of task.run(), it only open Runnable.run(), but not open the SocketProcessorBase.run() which is implement of Runnable.run(). In this case i have no chance to attach source of SocketProcessorBase.
我想调试到调用堆栈里的SocketProcessorBase中的代码,但是我没有机会打开SocketProcessorBase的代码,因为我打开 task.run()的时候,只是跳转到了Runnable.run()的代码,而不是SocketProcessorBase的代码
微信图片_20200718160950

@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Jul 20, 2020

When you click task.run(), it's definition is exactly the Runnable.run(). Please use "Go to Implementations" if you want to find the implementation.

@qinlinwang
Copy link
Author

@qinlinwang qinlinwang commented Jul 26, 2020

When you click task.run(), it's definition is exactly the Runnable.run(). Please use "Go to Implementations" if you want to find the implementation.

When i use "Go to Implementations", it does find all of the subclass including 'SocketProcessorBase' class. Although there are many subclasses of Runnable, i find the 'SocketProcessorBase' finally. And the following problems are:

  1. when i debug next time, it can not find the source again.
  2. More often, when i want to debug upper class in call stack, for example “ServletInvocableHandlerMethod.invokeAndHandle(ServletWebRequest,ModelAndViewContainer,Object[])”, the method "Go to Implementations" does not work.
    I finally find a better way to solve it: i use ‘sourcePaths ’ configuration parameter in launch.json, then the vscode can find source every time. But i still think we should make ‘attach source’ more covenient to use.
    Thanks for your reply.
    "sourcePaths": ["C:/Users/.m2/repository/org/springframework/spring-webmvc/5.2.4.RELEASE/spring-webmvc-5.2.4.RELEASE-sources", "C:/Users/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.31/tomcat-embed-core-9.0.31-sources"],

微信图片_20200726125349

微信图片_20200726130705

@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Jul 27, 2020

Generally when you are debugging maven dependencies, Java extension will automatically download the maven source. And when the source is ready, then the debugger should be able to find them automatically.

Would you mind sharing a sample project to help us reproduce the issue? Thanks!

@qinlinwang
Copy link
Author

@qinlinwang qinlinwang commented Aug 9, 2020

Of course, this is my project. Thanks.
firstWebSrpingBoot.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.