Eclipse的跳过线调试时 [英] Eclipse skipping lines while debugging

查看:192
本文介绍了Eclipse的跳过线调试时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Java和Eclipse中,我一直在尝试调试设备上的Andr​​oid应用程序。这是一个小项目,一个jar文件引用。我读了类似的问题,但他们并没有帮助。

I am new to both java and eclipse, I have been trying to debug an android app on a device. It is a small project with a jar file reference. I read similar questions but they didn't help.

我需要的是能够调试源$ C ​​$ jar文件的CS,所以我附源$ C ​​$ CS(这是我获得使用反编译器),我能够进入源$ C ​​$图书馆的CS,所以我认为我这样做正确。但我不能调试到这些源$ C ​​$ CS成功;在调试模式下,它skipps断点,当我尝试'步入code'它去随机线跳过线调试时(仅在连接到jar文件的源文件的那些)。

What I need is to be able to debug the source codes of the jar file so I attached the source codes ( which I obtained using a decompiler ) and I am able to go into source codes of the library so I thought I did that correctly. But I can not succeed in debugging into these source codes; in debug mode it skipps breakpoints (only the ones in the source files which are attached to jar file) and when I try to 'step into code' it goes to random lines skips lines when debugging.

我使用Eclipse,Android SDK和JDK的最新版本。我不知道是什么原因导致这个问题,我想知道。

I am using the latest versions of eclipse, android sdk and jdk. I don't know what causes this problem and I'd like to know.

在此先感谢,我希望我充分的解释。

Thanks in advance, I hope I explained sufficiently.

推荐答案

的问题是,你不能反编译的类文件进行调试。由于反编译的文件的行会有所不同,以原来的Java源代码code线(想象一下:真正的源头code的一些意见和其他的东西,不会被编译成class文件)!

The problem is, that you can't decompile the class files to debug it. Because the lines of the decompiled files will differ to the original Java source code lines (imagine: the real source code has some comments and other things which will not be compiled into class files)!

所以,如果你的Eclipse显示当前调试行 42 ,那么它只是告诉你,调试器将present你的第42 在类文件code线。这不会匹配您的反编译Java源文件。

So, if your Eclipse shows you the current debug line 42, then it only tells you, that the debugger will present you the 42th line of code in the class file. This won't match your decompiled java source file.

不过,你可以反编译的选项的类文件添加行号作为注释。在评论这些行号可以比较实际的堆栈跟踪行号。这可以帮助你一点点想象的问题。

However, you could decompile the class files with the option add line numbers as comments. These line numbers in comments you can compare to the actual stacktrace line numbers. This could help you a little bit to imagine the issue.

编辑:洛朗乙建议,您将能够重新调整code是 JD-的Eclipse ,请参见:< A HREF =htt​​p://mchr3k.github.io/jdeclipse-realign/相对=nofollow> http://mchr3k.github.io/jdeclipse-realign/

edit: as Laurent B recommended, you will be able to realign the code with JD-Eclipse, see: http://mchr3k.github.io/jdeclipse-realign/

+1您的评论! :)

+1 for the comment! :)

EDIT2::您将无法行号反编译如果类文件与标志的 - G:无

edit2: You won't be able to decompile with line numbers if the class files are compiled with the flag -g:none:

-g:无结果
      不生成任何调试信息。

-g:none
Do not generate any debugging information.

所以,如果是这样的话:设法找到你的jar文件的原始来源$ C ​​$ C

So if this is the case: try to find the original source code of your jar file!

这篇关于Eclipse的跳过线调试时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆