Android - How-to Rebuild gdbserver
The gdbserver provided in Android releases is statically linked to Bionic libraries like libc and libthread_db. When there are large changes to bionic, it will be useful to rebuild gdbserver
because you might otherwise see some strange behavior when debugging with GDB.
[edit]Assumptions
- An Android baseline is located at $MYDROID and you have already followed instructions to build the baseline. For instructions, see [Getting
Started]
- The examples in this tutorial assume that you built Android forBlazeplatform, but you should be able to apply them to any platform.
- We will be building gdbserver in a folder namedgdb_buildin your HOME directory.
[edit]Step
1: Download GDB Source and Toolchain Build Scripts
Android's toolchain repo manifest is located at git://android.git.kernel.org/toolchain/manifest.git. You can choose to repo init/sync the whole manifest, but for the purposes of this tutorial,
we will just be cloning thegdbandbuildtrees. GDB source for Android is located at git://android.git.kernel.org/toolchain/gdb.git, and build scripts source is located at git://android.git.kernel.org/toolchain/build.git. For this tutorial,
we will be downloading from the latest on the master branch.
[edit]Step
2: Create sysroot Directory
The sysroot directory contains all the header files and libraries needed to build gdbserver (and other Android toolchains but that will be for another topic). The script to generate the sysroot
directory is in thebuildtree that we cloned in the last step. It basically just copies the relevant libraries and header files located in various places in your Android environment into a central location.
Syntax forbuild-sysroot.shscript:
./build/build-sysroot.sh <product out directory> <install directory>
Usage:
[edit]Step
3: Build gdbserver
Thendktree in your $MYDROID repo provides a script (build-gdbserver.sh) to rebuildgdbserver.
[edit]Modify
Scripts
However, the scripts in NDK tree are for NDK users and not for developers with an entire Android environment, so we will need to make some small modifications.
$MYDROID/ndk/build/tools/build-gdbserver.sh removes the libthread_db related binaries and header files from the sysroot directory and tries to replace them with the ones found in the NDK. In
our case, we want to use the libthread_db binaries that we built.
$
MYDROID/ndk/build/tools/prebuilt-common.sh points to the toolchain found in NDK. We want to use the toolchain provided in the $MYDROID/prebuilts tree.
[edit]Modify
GDB 7.1.x
There is a small bug in the GDB 7.1.x code in the Android GDB tree.
- The Makefile.in for gdbserver has the LDFLAG in the wrong place for linking of gdbserver and gdbreplay
- PTRACE_GETVFPREGS is defined in Bionic's ptrace.h, but PTRACE_SETVFPREGS is undefined. Need to define it in gdb-7.1.x/gdb/gdbserver/linux-arm-low.c
Apply the following patch:
To build gdbserver, run the following:
gdbserverwill be at$HOME/gdb_build/install/gdbserver
build-gdbserver.sh --help:
转自:http://www.omappedia.org/wiki/Android_-_How-to_Rebuild_gdbserver
分享到:
相关推荐
Laravel开发-laravel-fulltext-rebuild 重建mysql全文索引
前端开源库-workers-factory-rebuild工人工厂重建,一组不同的工人用于构建前端应用程序
"# plazma-burst-2-website-css-rebuild" 根据: 整出来的css,使用方法在html文件里按顺序引入fix.css和pb.css就可以用了 index.html为demo,可以在里面看看样式咋用,一般是给div添加pb-XXXX的类就起作用了 来自 超...
docker-base-image-auto-rebuild-on-dependency更新如果(poetry.lock)中定义的python依赖关系已更新,则此操作将构建新的docker基本映像。 它的主要灵感来自于。 我将此包用于我们Github组织的容器注册表。输入项...
使用--save-dev安装软件包: npm install --save-dev electron-rebuild 然后,每当您安装新的npm软件包时,请重新运行electron-rebuild: $( npm bin ) /electron-rebuild 或者,如果您使用的是Windows: ....
tools for mapplestory files and map decompress
Hamilton-Mathye-qvc现场重建QVC网站
./node_modules/.bin/electron-rebuild npm start Install Robotmon App Only support Android No need to root Download on Google Play. Run Robotmon Service (Important) Enable USB Debugging on your ...
------ Rebuild All started: Project: OpenGL_on_a_Windows_Form Configuration: Debug Win32 ------1> stdafx.cpp1> AssemblyInfo.cpp1> OpenGL_on_a_Windows_Form.cpp1> Generating Code...1> ....
Android-BaseProjecta base project for starting a new project , or rebuild your old project.本文初衷:由于很多Android项目的基础框架大致一致,于是针对主流的Android项目基础需求,严格按照MVC模式进行基类...
Android版Rebuild.fm Android的Rebuild.fm是收听Rebuild.fm的最佳播客播放器。 (非官方) 关于Rebuild.fm 的。 谈论技术,软件开发和小工具。 截屏 当前版本(0.10.0) 安装 建立在本地 $ git clone ...
注意参考日期:“预”版本是快速移动的目标,经常更新以获取最新的更改/修复/开发工作/等。 Raspberry Pi 参考 2018-04-27 使用 pi-gen 生成,https://github.com/RPi-Distro/pi-gen,2233762f826460d964daf9e0d6d...
开始使用 REBUILD 非常简单,不需要配置复杂的运行环境,零依赖快速部署,超简单! 1. 使用已发布版本 生产环境强烈推荐使用此方式 !!! 首先 下载 安装包,我们同时提供 standalone 与 boot 两种安装包。...
Keil开发51内核的单片机,生成hex文件,不像32位机那样...同时keil工程下选择魔术棒——User--after build/rebuild,勾选Run1,写入命令:.\Objects\hex2bin.bat;后每一次编译即可自动生成bin文件到Objects目录下。
主要介绍了使用android-apktool来逆向(反编译)APK包方法介绍,本文讲解了版本问题、使用apktool、反编译decode、rebuild重打包等内容,需要的朋友可以参考下
How to get apk 分析 jadx Java方法调用追踪(与DDMS method profiling 配合使用) TraceReader 逆向工具 Hopper 逆向工具 jeb 逆向工具 Ida 逆向工具 radare2 so 修复 ThomasKing rebuild_section jar 包查看 JD-GUI ...
Steppers Screen Setup 1. Add library to project Grab via Gradle: repositories { mavenCentral() maven { ... compile 'me.drozdzynski....Rebuild the project Add dependency File → Project Structure in Modul
Alter Android app behavior without rebuild when debugging. You can change method without build when debugging in your app. And this changes does not affected to production code. So you can implement ...
Sync Project with gradle files:对gradle文件之后,或刷新gradle配置时使用; Make project:只是对项目中新产生或修改过的文件进行一次编译,已经编译过...Invalidate Cache/Restart AndroidStudio:自动生成的项目
这是警告: Warning: mysql_connect(): Headers and client library minor version mismatch....指示 在您的命令行中: ... git clone https://github.com/falcacibar/php5-mysql-rebuild cd php5-mysq