Using the NDK Plugin

1. First set the path to SDK and NDK:

  Eclipse -> Window -> Preferences -> Android -> set path to SDK  

  Eclipse -> Window -> Preferences -> Android -> NDK -> set path to the NDK

2. Right click on an Android project and select Android Tools -> Add native support.

  Note that you will not be able to add native support if the project already has C/C++ nature.

  At this point, you will be able to build your applications using Project -> Build All.

  Debugging native applications

  a. Update your build config to include “NDK_DEBUG=1”. 没有 空格

    Right click project -> properties -> C/C++ Build:
 
  b. Set a breakpoint in your C code.
  c. Right click on your project, select Debug As -> Android Native Application

Note:

  a,  There is a delay of a few seconds between when the activity is launched and when native debugging starts. If your code is already executed by that point, then you won’t see the breakpoint being hit. So either put a breakpoint in code that is called repetitively, or make sure that you call JNI code after you see that ndk-gdb has connected.
  b,  在模拟器上调试时最好在Application.mk中  APP_ABI := x86  
  c,  在真机器上,最好有root权限, Application.mk中  APP_ABI := armeabi
 
下图是在模拟器上调试:
 
Known Issues

1. Eclipse does not automatically find the include paths to all the NDK headers on Windows. This issue will be fixed (20.0.1+).
2. Eclipse does not automatically find the include paths with CDT 8.1.0 (Juno). This issue is tracked in Bug 33788.

NDK(6)eclipse下断点调试ndk代码的更多相关文章

  1. 052 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 14 Eclipse下程序调试——debug2 多断点调试程序

    052 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 14 Eclipse下程序调试--debug2 多断点调试程序 本文知识点: Eclipse下程序调 ...

  2. 051 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 13 Eclipse下程序调试——debug入门1

    051 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 13 Eclipse下程序调试--debug入门1 本文知识点: 程序调试--debug入门1 程序 ...

  3. eclipse打断点调试进入到class文件中,不显示变量值的解决办法汇总

    每天学习一点点 编程PDF电子书免费下载: http://www.shitanlife.com/code 问题描述:eclipse打断点调试进入到class文件中,而且监视区不显示变量结果 是由于对应 ...

  4. 编程入门-Eclipse的断点调试

    编程入门-Eclipse的断点调试 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 1>.双击选中你要调试的代码行数 2>.允许方法透视图 3>.进行代码调试 4& ...

  5. Eclipse下Android的NDK开发环境配置

    编辑2016年7月26日——增加了下载网址,修改了一些错误. 摸索了一周,走了很多弯路,磕磕绊绊,总算是弄好了NDK的开发环境,在这里总结一下吧. 一.Android NDK开发环境 首先下载安装JR ...

  6. deepin linux下eclipse c/c++ 调试开源代码

    1.deepin linux 下使用eclipse c/c++ 调试2. 编译选项,-g3 -O0,-g3表示输出调试信息,-O0不优化代码(第一个字母o的大写,第二个是数字0) 3.必备环境: gd ...

  7. ndk学习6: 使用gdb调试ndk程序一

    生成debug版程序 方法一: 使用ndk-build编译时,加上如下参数NDK_DEBUG=1,之后生成so文件之外,还会生成gdbobserver,gdb.setup调式文件   方法二: 修改A ...

  8. Java Eclipse进行断点调试

    如何调试Java程序? 大家最开始学习Java,都会觉得IDE调试好高端有木有,其实很简单了. 下文会尽量简单直观的教会你在Eclipse中调试,其他的IDE调试步骤也是类似的. 1.在你觉得有错的地 ...

  9. 解决Eclipse Debug 断点调试的source not found问题

    写完代码进行调试的时候,经常会用到断点调试,一步步检测问题,但有时候eclipse有时候无法进入断点,这样就失去了断点的意义,原因是debug无法找到该项目的源代码,解决方法如下 1,打开debug ...

随机推荐

  1. 使用log4javascript记录日志

    1.定义log4js服务类,用于初始化log4javascript相关参数 log4jsService.js //启用javascript 日志功能 var logger = log4javascri ...

  2. bzoj 1270 DP

    w[i,j]代表高度j,第i颗树的时候的最大值 那么w[i,j]:=max(w[i,j+1],w[k,j+heigh])+sum[i,j]: 但是这样枚举是n^3的,我们发现转移的第二个选择w[k,j ...

  3. zoj 1450 Minimal Circle 最小覆盖圆

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=450 You are to write a program to fi ...

  4. poi实现Excel比较

    http://stackoverflow.com/questions/866346/easiest-way-to-compare-two-excel-files-in-java http://stac ...

  5. poj 3254

    状态压缩 dp dp[i][j] 为第 i 行状态为 j 的总数 #include <cstdio> #include <cstdlib> #include <cmath ...

  6. xml string 相互转换

    一.使用最原始的javax.xml.parsers,标准的jdk api // 字符串转XMLString xmlStr = /"....../";StringReader sr ...

  7. spring 两个 properties

    A模块和B模块都分别拥有自己的Spring XML配置,并分别拥有自己的配置文件: A模块 A模块的Spring配置文件如下: <?xml version="1.0" enc ...

  8. windbg内核诊断方式--转载

    一.WinDbg是什么?它能做什么? WinDbg是在windows平台下,强大的用户态和内核态调试工具.它能够通过dmp文件轻松的定位到问题根源,可用于分析蓝屏.程序崩溃(IE崩溃)原因,是我们日常 ...

  9. (转)xmpp 环境配置-支持扩展

    第一种方法直接拖 1> 拖入文件夹 在网盘链接的xmppFramework文件夹 :http://pan.baidu.com/s/1jGxLa3G 也可以直接去github搜索下载. 2> ...

  10. Android 内存剖析 – 发现潜在问题

    简介 移动平台上的开发和内存管理紧密相关.尽管随着科技的进步,现今移动设备上的内存大小已经达到了低端桌面设备的水平,但是现今开发的应用程序对内存的需求也在同步增长.主要问题出在设备的屏幕尺寸上-分辨率 ...