如何在Android Studio中使用NDK堆栈?
我需要调试我的本机C代码。 (我是C和NDK的新手)。我遇到了这个错误,但是我不确切知道错误的来源:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x38
我发现一些工具这样做,但是文档对我来说还不清楚,我真的不知道该如何使用。我尝试了文档中的命令,但是我有:
'$NDK' is not recognized as an internal or external command, operable program or batch file.
我尝试用ndk位置替换$ ndk
$ project_path
用我的Android Studio Project Project Path,但是我得到了:
C: is not recognized as an internal or external command, operable program or batch file.
我如何才能得到 :从使用Android Studio的C信号中获取(人类可读)的位置?如果有人给我非常详细的逐步指南(例如白痴),我会非常感激。
我已经看过许多类似的问题,例如 this href =“ https://stackoverflow.com/questions/56779125/how-do-i-i-is-i-i-is-ndk-stack-stack-usish-usish-usish-usish-us----------- using-android-ndk-r20”> this ,但我还没有发现它们有帮助。
预先感谢!
完整错误看起来像这样:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x38
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: Cause: null pointer dereference
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x0 0000000000000000 x1 0000007fcbe612e8 x2 0000000000000000 x3 0000007fcbe612f4
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x4 0000007fcbe5fea0 x5 000000760d208470 x6 000000760d200100 x7 0000000000000001
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x8 3a081cfc2b057a9c x9 3a081cfc2b057a9c x10 0000000000430000 x11 0000007fcbe5fe20
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x12 0000007fcbe5fd00 x13 0000000000000010 x14 000000760d2188fc x15 00000000ebad6a89
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x16 0000007587a487e8 x17 0000007fcbe611f0 x18 0000000000000000 x19 000000778106c380
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x20 0000000000000000 x21 000000778106c380 x22 000000792f0f3000 x23 000000778106c430
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x24 00000075eb871320 x25 00000076f106d510 x26 000000792f0f3000 x27 0000000000000d89
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x28 0000007fcbe61200 x29 0000007fcbe61200
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: lr 000000760d222248 sp 0000007fcbe611f0 pc 0000007587a487ec pst 0000000060000000
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: backtrace:
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: #00 pc 00000000010757ec /data/app/~~3Zs2OavC8p7AJpYYMbAsbw==/com.fivesoft.fivesfotstreamer-4yYlj4e5I5l3j1ng0knVeQ==/base.apk!libgstreamer_android.so
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: #01 pc 0000000000222244 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 600193f4a9fcf9ced238223aee6c1164)
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: #02 pc 0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 600193f4a9fcf9ced238223aee6c1164)
...
I need to debug my native C code. (I'm a newbie in C and ndk). I get this error, but i don't know exactly from where the bug come from:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x38
I find some tool to do that, but the documentation is very unclear for me and I realy don't know how to use that. I tried command from documentation, but I have:
'$NDK' is not recognized as an internal or external command, operable program or batch file.
I tried replacing $NDK
with ndk location and $PROJECT_PATH
with my android studio project path, but then I get:
C: is not recognized as an internal or external command, operable program or batch file.
How can I get the place (human readable) from where the C signal comes from using Android Studio? I would be realy grateful if somebody gave me veryy detailed step by step guide (like for idiot) with example.
I've seen many similar questions like this or this, but I've not found them helpful.
Thanks in advance!
Full error looks like this:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x38
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: Cause: null pointer dereference
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x0 0000000000000000 x1 0000007fcbe612e8 x2 0000000000000000 x3 0000007fcbe612f4
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x4 0000007fcbe5fea0 x5 000000760d208470 x6 000000760d200100 x7 0000000000000001
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x8 3a081cfc2b057a9c x9 3a081cfc2b057a9c x10 0000000000430000 x11 0000007fcbe5fe20
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x12 0000007fcbe5fd00 x13 0000000000000010 x14 000000760d2188fc x15 00000000ebad6a89
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x16 0000007587a487e8 x17 0000007fcbe611f0 x18 0000000000000000 x19 000000778106c380
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x20 0000000000000000 x21 000000778106c380 x22 000000792f0f3000 x23 000000778106c430
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x24 00000075eb871320 x25 00000076f106d510 x26 000000792f0f3000 x27 0000000000000d89
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: x28 0000007fcbe61200 x29 0000007fcbe61200
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: lr 000000760d222248 sp 0000007fcbe611f0 pc 0000007587a487ec pst 0000000060000000
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: backtrace:
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: #00 pc 00000000010757ec /data/app/~~3Zs2OavC8p7AJpYYMbAsbw==/com.fivesoft.fivesfotstreamer-4yYlj4e5I5l3j1ng0knVeQ==/base.apk!libgstreamer_android.so
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: #01 pc 0000000000222244 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 600193f4a9fcf9ced238223aee6c1164)
2022-04-11 14:47:00.618 28022-28022/? A/DEBUG: #02 pc 0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 600193f4a9fcf9ced238223aee6c1164)
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论