如何构建OpenHarmony的debug版本用于进行子系统调试。

weggle 显示全部楼层 发表于 2023-11-5 23:20:40

我想用GDB调试OpenHarmony的子系统,所以构建时增加debug选项,用来在构建时保留更多符号信息以助于debug,我参考了https://blog.csdn.net/openharmony/article/details/128558711 帖子 使用以下命令进行构建:

./build.sh --product-name=rk3568 --gn-args="is_debug=true use_unstripped_as_runtime_outputs=true"

然而,构建过程中发生报错,报错内容如下: image.png

请问是否处理过这种错误,或者是否尝试过构建debug版本的openharmony源代码。

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

精彩评论4

weggle

沙发 发表于 2023-11-5 23:21:58

我想上传完整的build log,但是没有发现上传附件的选项

s_hao

发表于 2023-11-6 15:12  IP属地: 运营商级NAT

回复 weggle: 完整的图片能否发我一下,或者贴在评论区

weggle

发表于 2023-11-6 20:19  IP属地: 运营商级NAT

回复 s_hao: 改了一些构建文件以及注释了一些代码,就可以build了,请问您有build过debug版本(就是带debug符号信息)的OH吗?我build后然后烧录也成功了,但是启动的时候一直卡死在启动界面(但是可以通过hdc shell进去),通过查看hilog,我发现日志一直重复输出以下内容:

  1. 11-06 20:15:10.828  1678  1678 E C01510/BinderInvoker: 124: SendRequest: handle=0 result = 3
  2. 11-06 20:15:10.828  1678  1678 W C01800/SA_CLIENT: GetSystemAbilityWrapper:sa 5100 is not exist
  3. 11-06 20:15:10.828  1675  1675 E C01510/BinderInvoker: 124: SendRequest: handle=0 result = 3
  4. 11-06 20:15:10.828  1675  1675 W C01800/SA_CLIENT: GetSystemAbilityWrapper:sa 5100 is not exist
  5. 11-06 20:15:10.828   252   693 E C01800/SAMGR: [SA Scheduler][SA: 10] not in SA profiles
  6. 11-06 20:15:10.828   252   693 W C01800/SAMGR: NOT found service : 10
  7. 11-06 20:15:10.828   252   693 I C01800/SAMGR: [SA Scheduler][SA: 10] handle load event by check start
  8. 11-06 20:15:10.828   252   693 E C01800/SAMGR: [SA Scheduler][SA: 10] not in SA profiles
  9. 11-06 20:15:10.828   687   687 E C01510/BinderInvoker: 124: SendRequest: handle=0 result = 3
  10. 11-06 20:15:10.828   687   687 W C01800/SA_CLIENT: GetSystemAbilityWrapper:sa 10 is not exist
  11. 11-06 20:15:10.828   252   287 E C01800/SAMGR: [SA Scheduler][SA: 5100] not in SA profiles
  12. 11-06 20:15:10.828   252   287 W C01800/SAMGR: NOT found service : 5100
  13. 11-06 20:15:10.828   252   287 I C01800/SAMGR: [SA Scheduler][SA: 5100] handle load event by check start
  14. 11-06 20:15:10.828   252   287 E C01800/SAMGR: [SA Scheduler][SA: 5100] not in SA profiles
  15. 11-06 20:15:10.829  1672  1672 E C01510/BinderInvoker: 124: SendRequest: handle=0 result = 3
  16. 11-06 20:15:10.829  1672  1672 W C01800/SA_CLIENT: GetSystemAbilityWrapper:sa 5100 is not exist
  17. 11-06 20:15:10.838  1654  1654 E C01800/SA_CLIENT: GetSystemAbilityWrapper sa 5100 didn't start. Returning nullptr
  18. 11-06 20:15:10.858   252   287 E C01800/SAMGR: [SA Scheduler][SA: 5100] not in SA profiles
  19. 11-06 20:15:10.858   252   287 W C01800/SAMGR: NOT found service : 5100
  20. 11-06 20:15:10.858   252   287 I C01800/SAMGR: [SA Scheduler][SA: 5100] handle load event by check start
  21. 11-06 20:15:10.859   252   693 E C01800/SAMGR: [SA Scheduler][SA: 5100] not in SA profiles
  22. 11-06 20:15:10.859   252   693 W C01800/SAMGR: NOT found service : 5100
  23. 11-06 20:15:10.859   252   693 I C01800/SAMGR: [SA Scheduler][SA: 5100] handle load event by check start
  24. 11-06 20:15:10.859   252   693 E C01800/SAMGR: [SA Scheduler][SA: 5100] not in SA profiles
复制代码

【2 条回复】

论坛小助手 官方账号

板凳 发表于 2023-11-8 17:15:47

可以使用此命令进行debug版本编译:./build.sh --product-name rk3568 --ccache --gn-args is_debug=true --keep-ninja-going,但是由于门禁默认的是release编译所以会有很多编译问题需要处理

Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部