从Eclipse查看本机代码 [英] view native code from Eclipse

查看:140
本文介绍了从Eclipse查看本机代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用本机方法调用的java应用程序。有没有办法在eclipse中查看这个代码?
我可以获得此本机库的源代码,但不知道如何在IDE中链接。
如果有人告诉我如何调试这个本机方法,这也是有帮助的。

解决方案

但Eclipse确实有 C / C ++ IDE功能



以下是一些信息(尽管看起来有点过时):有关CDT / JDT集成的信息



信息在Eclipse内部创建JNI代码(查看最后的帖子)



看起来像一个集成的调试体验可能在Eclipse的功能之内,但是这显然不是很重要。



OK - 所有这一切,我确实有一个回忆,让Visual C ++调试器与使用JNI调用的Java应用程序一起工作s ...已经有一段时间了,但我很确定您可以使用pid将C ++调试器连接到正在运行的Java应用程序。然后设置一个断点和摇滚(你显然必须编译JNI库作为调试模块)。



这不是一个完全集成的体验,但它是非常有效的。尽管如此,我尝试将本机JII代码写入瘦包装,但是我花费很少时间调试JNI电话。


I have a java application which makes use of native method calls.Is there a way to view this code in eclipse? I can get the source code for this native library, but do not know how to link in the IDE. It will also be helpful if someone tells me how to debug this native method.

解决方案

Not a full answer, but Eclipse does have C/C++ IDE functionality

Here is some information (though it seems a bit dated): Information on CDT/JDT integration

Info on creating JNI code from inside Eclipse (look at the very last post)

It does seem like an integrated debugging experience would be well within Eclipse's capabilities, but it's obviously not hyper important.

OK - all that said, I do have a recollection of getting Visual C++ debugger to work with a Java application that was making JNI calls... It's been awhile, but I'm pretty sure you can connect the C++ debugger to the running Java application using the pid. Then set a breakpoint, and rock and roll (you'll obviously have to compile the JNI library as a debug module).

It wasn't a fully integrated experience, but it was pretty effective. I try to write my JNI code as thin wrappers around the native calls, though, so I spend very little time debugging my JNI calls.

这篇关于从Eclipse查看本机代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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