Android Studio的JNI调试c++程序时遇到的问题。

有些值获取失败,比如key等变量。

还会出现有些值看不到的情况(未提示获取失败),如localLOD。

通过lldb命令查看,也是同样的结果

可能和程序优化有关

https://stackoverflow.com/questions/13040777/lldb-error-variable-not-available

This is an artifact of debugging optimized code. When the compiler's optimization is enabled in your build settings, it moves variables between memory and registers as it decides is best. At the point where you're examining the variable in lldb, it may not exist in registers or memory at all -- even though it looks like it should still be available for display.

It's possible it is a shortcoming of the debug information output by the compiler. Sometimes the compiler will copy a variable into a register for its use and only list that register location in the debug information. Later the register is repurposed for other uses; value is still present on the stack but the compiler hasn't told the debugger that the value can be found there.

The only way to really tell whether it's insufficient debug info or if the value genuinely doesn't exist at that particular instruction is to examine the assembly code by hand. As soon as you turn on optimization with the compiler, the source code becomes a weak view into what's actually being executed in any particular order.

Instead of wandering too far into the wacky world of optimized code debugging, I strongly recommend turning off optimization (Optimization Level in your Build Settings) for your build and debugging it that way, if at all possible. If you do need to debug your app with optimization, make sure you're building with the latest Apple LLVM compiler supported by your Xcode -- there is always work being done to improve optimized code debugging and you want to avail yourself of the most up to date tools you can.

C++学习(四八六)lldb parent failed to evaluate variable not available相关推荐

  1. OpenCV学习笔记(四十六)——FAST特征点检测features2D OpenCV学习笔记(四十七)——VideoWriter生成视频流highgui OpenCV学习笔记(四十八)——PCA算

    OpenCV学习笔记(四十六)--FAST特征点检测features2D 特征点检测和匹配是计算机视觉中一个很有用的技术.在物体检测,视觉跟踪,三维常年关键等领域都有很广泛的应用.这一次先介绍特征点检 ...

  2. OpenCV学习笔记(六)(七)(八)(九)(十)

    OpenCV学习笔记(六)--对XML和YAML文件实现I/O操作 1. XML.YAML文件的打开和关闭 XML\YAML文件在OpenCV中的数据结构为FileStorage,打开操作例如: [c ...

  3. Linux性能优化实战学习笔记:第四十六讲=====实战分析

    Linux性能优化实战学习笔记:第四十六讲 一.上节回顾 不知不觉,我们已经学完了整个专栏的四大基础模块,即 CPU.内存.文件系统和磁盘 I/O.以及网络的性能分析和优化.相信你已经掌握了这些基础模 ...

  4. 视觉SLAM十四讲学习笔记-第六讲学习笔记总结(1)---非线性优化原理

    第六讲学习笔记如下: 视觉SLAM十四讲学习笔记-第六讲-非线性优化的状态估计问题_goldqiu的博客-CSDN博客 ​​​​​​视觉SLAM十四讲学习笔记-第六讲-非线性优化的非线性最小二乘问题_ ...

  5. 视觉SLAM十四讲学习笔记-第六讲-非线性优化的实践-高斯牛顿法和曲线拟合

    专栏系列文章如下: 视觉SLAM十四讲学习笔记-第一讲_goldqiu的博客-CSDN博客 视觉SLAM十四讲学习笔记-第二讲-初识SLAM_goldqiu的博客-CSDN博客 视觉SLAM十四讲学习 ...

  6. 视觉SLAM十四讲学习笔记-第六讲-非线性优化的非线性最小二乘问题

    专栏系列文章如下: 视觉SLAM十四讲学习笔记-第一讲_goldqiu的博客-CSDN博客 视觉SLAM十四讲学习笔记-第二讲-初识SLAM_goldqiu的博客-CSDN博客 视觉SLAM十四讲学习 ...

  7. JavaScript学习(八十六)—运算符知识点总结

    JavaScript学习(八十六)-运算符知识点总结 一. 运算符的分类 运算符(operator)也被称为操作符,是用于实现赋值.比较和执行算数运算等功能的符号. JavaScript中常用的运算符 ...

  8. JavaScript学习(八十四)—变量

    JavaScript学习(八十四)-变量 一.什么是变量? 白话: 变量就是一个装东西的盒子 通俗:变量是用于存放数据的容器. 我们通过 变量名 获取数据,甚至数据可以修改. 二.变量在内存中的存储 ...

  9. JavaScript学习(四十六)—练习题

    JavaScript学习(四十六)-练习题 练习1 练习2

最新文章

  1. 【Win 10 应用开发】将墨迹保存到图像的两种方法
  2. Spring Cloud和Dubbo
  3. leetcode 125. 验证回文串
  4. LeetCode 508. 出现次数最多的子树元素和(递归)
  5. 记使用talend从oracle抽取数据时,数字变为0的问题
  6. mf模型 svd++_序列推荐模型(一): FPMC
  7. 7-134 敲笨钟 (20 分)
  8. Analysis by Its History Theorem 2.2 牛顿广义二项式公式
  9. E. Sergey and Subway
  10. 2.4时序卷积网络TCN:因果膨胀卷积、残差连接和跳过连接
  11. JDBC中数据库连接池的使用与传统方式的比较
  12. maven setting.xml详解
  13. Dreamweaver CS4自学实例视频教程(高清)
  14. 无插件播放之http-flv
  15. 转(js幻灯片,jQuery幻灯,js焦点轮换图,js幻灯轮播代码大全(2) - 酷站代码)...
  16. 苹果手机sim卡无效怎么办_苹果手机存储空间不足怎么办
  17. ValueError: multiclass format is not supported
  18. Toasts官方教程
  19. python的pulp包_使用Python/PuLp解决线性规划问题
  20. B1094 谷歌的招聘 (20 分)

热门文章

  1. 图文并茂,讲解TCP和UDP协议的原理以及区别
  2. 小程序导航栏文字更改
  3. Django xadmin的使用 (二)
  4. 神经网络训练结果不稳定,神经网络越训练越慢
  5. 雨林木风服务器系统安装教程视频,雨林木风win10系统怎么安装.net3.5的方法教程...
  6. pr片头模板,故障文字logo开场视频片头模板mogrt
  7. 今年考研的几个变化 务必注意!
  8. 2020/11/18 python实现词性标注(含词库文件)
  9. RabbitMQ消息应答重新入队
  10. winform遍历bartender_C#怎么调用bartender软件