简体   繁体   English

您如何调试android平台的源代码?

[英]How do you debug android platform source code?

When you have issues with android source code, how do you dig into the code? 当您对android源代码有疑问时,如何深入研究代码? For example for this issue 例如这个问题
I saw from the debugger that the CookieManager is AwCookieManager . 我从调试器中看到CookieManager是AwCookieManager
So from Google search I found that the setCookie is the following: 因此,通过Google搜索,我发现setCookie如下:

public void setCookie(final String url, final String value) {  
        nativeSetCookie(url, value);     
}  

But I had trouble finding that native code to see what's going on. 但是我很难找到该本地代码以查看发生了什么。
I searched again in Google and found different version of this native and java and ended up with this file: https://android.googlesource.com/platform/external/webkit/+/4bcd50196a7fe4c0c909ce6a7cfac6a808336611/Source/WebKit/android/jni/CookieManager.cpp 我在Google中再次搜索,找到了本机和Java的不同版本,并得到了以下文件: https : //android.googlesource.com/platform/external/webkit/+/4bcd50196a7fe4c0c909ce6a7cfac6a808336611/Source/WebKit/android/jni/CookieManager的.cpp

but I am not sure if this is the right file to look at and I suspect there is a smarter way for debugging these kind of things. 但是我不确定这是否是正确的文件,并且我怀疑有一种更聪明的方法来调试这些事情。 I also wasn't sure how to find the called methods from that file. 我也不确定如何从该文件中找到被调用的方法。

So how do you do it? 你是怎么做到的?

For java code debugging, use Java remote debug, check this 对于Java代码调试,请使用Java远程调试, 请检查此

For C++ code debugging, use GDB remote debug, check this 对于C ++代码调试,请使用GDB远程调试, 请检查此

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM