vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

debug pauses on decompiled class file instead of source java files

Open ahmednrana opened this issue 4 years ago • 5 comments
trafficstars

debug pauses on decmpiled class file instead of source java files

Environment
  • Operating System: RHEL 7.6 on Remote and windows 10 on local machine
  • JDK version: 1.8.0_181
  • Visual Studio Code version: 1.51.1
  • Java extension version: 0.71
  • Java Debugger extension version: 0.29.0
Steps To Reproduce
  1. I have a project in a remote machine. Which works and compiles fine.
  2. The debug option is pausing on .class files instead of .java files.
  3. I tried adding this setting sourcePaths settings too. but it didn't work. Is there any specific synatax for that? e.g. if my source is in /opt/myproject/trunk/src/com/abcd/xyz/main.java Should I be adding /opt/myproject/trunk/src in this setting?

Language Server Logs

[Error - 11:55:35 AM] Nov 27, 2020, 11:55:35 AM Unable to load IDecompiler class for jarFileContentProvider

Current Result

Debugger pausing on .class files

Expected Result

Debugger should use the source .java files

Additional Informations

ahmednrana avatar Nov 27 '20 06:11 ahmednrana

Would you mind sharing a minimum sample project to help reproduce the issue?

testforstephen avatar Dec 07 '20 02:12 testforstephen

I cannot actually, the problem I am facing for is in confidential code.

ahmednrana avatar Dec 09 '20 13:12 ahmednrana

I added the breakpoint in testLogger, but it was marked 'Unkown Source' as below, and always hit at 'Method.class:566', so I am wondering if there is a way to specify the source?

HelloWorld.testLogger(String,HttpServletRequest) (Unknown Source:78) NativeMethodAccessorImpl.invoke0(Method,Object,Object[])[native method] (Unknown Source:-1) NativeMethodAccessorImpl.invoke(Object,Object[]) (Unknown Source:62) DelegatingMethodAccessorImpl.invoke(Object,Object[]) (Unknown Source:43) Method.invoke(Object,Object[]) (/rt.jar/java.lang.reflect/Method.class:566) ResourceMethodInvocationHandlerFactory$1.invoke(Object,Method,Object[]) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model.internal/ResourceMethodInvocationHandlerFactory.class:81) AbstractJavaResourceMethodDispatcher$1.run() (/jersey-server-2.24.jar/org.glassfish.jersey.server.model.internal/AbstractJavaResourceMethodDispatcher.class:144) AbstractJavaResourceMethodDispatcher.invoke(ContainerRequest,Object,Object[]) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model.internal/AbstractJavaResourceMethodDispatcher.class:161) JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(Object,ContainerRequest) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model.internal/JavaResourceMethodDispatcherProvider.class:160) AbstractJavaResourceMethodDispatcher.dispatch(Object,ContainerRequest) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model.internal/AbstractJavaResourceMethodDispatcher.class:99) ResourceMethodInvoker.invoke(RequestProcessingContext,Object) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model/ResourceMethodInvoker.class:389) ResourceMethodInvoker.apply(RequestProcessingContext) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model/ResourceMethodInvoker.class:347) ResourceMethodInvoker.apply(Object) (/jersey-server-2.24.jar/org.glassfish.jersey.server.model/ResourceMethodInvoker.class:102) ServerRuntime$2.run() (/jersey-server-2.24.jar/org.glassfish.jersey.server/ServerRuntime.class:326) Errors$1.call() (/jersey-common-2.24.jar/org.glassfish.jersey.internal/Errors.class:271) Errors$1.call() (/jersey-common-2.24.jar/org.glassfish.jersey.internal/Errors.class:267) Errors.process(Callable,boolean) (/jersey-common-2.24.jar/org.glassfish.jersey.internal/Errors.class:315) Errors.process(Producer,boolean) (/jersey-common-2.24.jar/org.glassfish.jersey.internal/Errors.class:297) Errors.process(Runnable) (/jersey-common-2.24.jar/org.glassfish.jersey.internal/Errors.class:267) RequestScope.runInScope(RequestScope$Instance,Runnable) (/jersey-common-2.24.jar/org.glassfish.jersey.process.internal/RequestScope.class:317) ServerRuntime.process(ContainerRequest) (/jersey-server-2.24.jar/org.glassfish.jersey.server/ServerRuntime.class:305) ApplicationHandler.handle(ContainerRequest) (/jersey-server-2.24.jar/org.glassfish.jersey.server/ApplicationHandler.class:1154) WebComponent.serviceImpl(URI,URI,HttpServletRequest,HttpServletResponse) (/jersey-container-servlet-core-2.24.jar/org.glassfish.jersey.servlet/WebComponent.class:473) WebComponent.service(URI,URI,HttpServletRequest,HttpServletResponse) (/jersey-container-servlet-core-2.24.jar/org.glassfish.jersey.servlet/WebComponent.class:427) ServletContainer.service(URI,URI,HttpServletRequest,HttpServletResponse) (/jersey-container-servlet-core-2.24.jar/org.glassfish.jersey.servlet/ServletContainer.class:388) ServletContainer.service(HttpServletRequest,HttpServletResponse) (/jersey-container-servlet-core-2.24.jar/org.glassfish.jersey.servlet/ServletContainer.class:341) ServletContainer.service(ServletRequest,ServletResponse) (/jersey-container-servlet-core-2.24.jar/org.glassfish.jersey.servlet/ServletContainer.class:228) ApplicationFilterChain.internalDoFilter(ServletRequest,ServletResponse) (Unknown Source:227) ApplicationFilterChain.doFilter(ServletRequest,ServletResponse) (Unknown Source:162) WsFilter.doFilter(ServletRequest,ServletResponse,FilterChain) (Unknown Source:53) ApplicationFilterChain.internalDoFilter(ServletRequest,ServletResponse) (Unknown Source:189) ApplicationFilterChain.doFilter(ServletRequest,ServletResponse) (Unknown Source:162) StandardWrapperValve.invoke(Request,Response) (Unknown Source:202) StandardContextValve.invoke(Request,Response) (Unknown Source:97) AuthenticatorBase.invoke(Request,Response) (Unknown Source:542) StandardHostValve.invoke(Request,Response) (Unknown Source:143) ErrorReportValve.invoke(Request,Response) (Unknown Source:92) AbstractAccessLogValve.invoke(Request,Response) (Unknown Source:687) StandardEngineValve.invoke(Request,Response) (Unknown Source:78) CoyoteAdapter.service(Request,Response) (Unknown Source:357) Http11Processor.service(SocketWrapperBase) (Unknown Source:374) AbstractProcessorLight.process(SocketWrapperBase,SocketEvent) (Unknown Source:65) AbstractProtocol$ConnectionHandler.process(SocketWrapperBase,SocketEvent) (Unknown Source:893) NioEndpoint$SocketProcessor.doRun() (Unknown Source:1707) SocketProcessorBase.run() (Unknown Source:49) ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) (/rt.jar/java.util.concurrent/ThreadPoolExecutor.class:1128) ThreadPoolExecutor$Worker.run() (/rt.jar/java.util.concurrent/ThreadPoolExecutor.class:628) TaskThread$WrappingRunnable.run() (Unknown Source:61) Thread.run() (/rt.jar/java.lang/Thread.class:829)

mmk909 avatar Apr 22 '21 17:04 mmk909

I have the same issue

Environment VS Code Version: 1.81.1 (user setup) Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045 Extension Pack for Java: v0.25.13 Java Debugger extension version: v0.54.0 Gradle for Java: v3.12.7

Steps To Reproduce I have a project to create a jar file which contains an API (Gradle) I have an other project which used API (Ant) I put breakPoint in source code of API or tryed to step in (F11). Each time, debbuger break in class file, never in source file of API.

FSS1313 avatar Sep 11 '23 13:09 FSS1313

Same issue for me too.

Language Support for Java(TM) by Red Hat: v1.28.1 Extension Pack for Java: v0.25.15 Debugger for Java: v0.56.2

sirishp-tcs avatar Mar 07 '24 16:03 sirishp-tcs