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. 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针。 例如,链表1->2->3->3->4->4->5 处理后为 1->2->5

    // test20.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<iostream> #include< ...

  2. Matlab中颜色线形和形状

    1.颜色字符串有'c', 'm', 'y', 'r', 'g', 'b', 'w',和'k'.分别表示青,红紫,黄,红,绿,白和黑. 2.线型字符串有:'-' 为实线, '--' 为虚线, ':' 为 ...

  3. java 验证身份证号

  4. poi生成excel

    转自:http://www.cnblogs.com/bmbm/archive/2011/12/08/2342261.html 1.首先下载poi-3.6-20091214.jar,下载地址如下: ht ...

  5. 各大Oj平台介绍

    1.题库与网站资源题库-在线提交系统(Online Judge)简介   下面是几个比较大的在线提交系统(OnlineJudge)里面有大量历年的竞赛题目,注册一个ID,然后用自己熟悉的语言(一般有P ...

  6. Extjs整体加载树节点

    Ext.onReady(function () {             Ext.define('company', {                 extend: 'Ext.data.Mode ...

  7. MySql计数器,如网站点击数,如何实现高性能高并发的计数器功能

    MySql计数器,如网站点击数,如何实现高性能高并发的计数器功能 Clicks: Date: -- :: Power By 李轩Lane TagMysql计数器高性能 现在有很多的项目,对计数器的实现 ...

  8. codeforces 439C Devu and Partitioning of the Array(烦死人的多情况的模拟)

    题目 //这是一道有n多情况的烦死人的让我错了n遍的模拟题 #include<iostream> #include<algorithm> #include<stdio.h ...

  9. cf 403 D

    D. Beautiful Pairs of Numbers time limit per test 3 seconds memory limit per test 256 megabytes inpu ...

  10. CSS Ruler 前端工具

    CSS Ruler是一款在线的CSS单位工具. CSS Ruler 彩蛋爆料直击现场 http://katydecorah.com/css-ruler/