Android15之解决gdb:Remote register badly formatted问题(二百三十六)

devtools/2024/10/23 3:42:11/

简介: CSDN博客专家、《Android系统多媒体进阶实战》一书作者

新书发布:《Android系统多媒体进阶实战》🚀
优质专栏: Audio工程师进阶系列原创干货持续更新中……】🚀
优质专栏: 多媒体系统工程师系列原创干货持续更新中……】🚀
优质视频课程:AAOS车载系统+AOSP14系统攻城狮入门视频实战课 🚀

人生格言: 人生从来没有捷径,只有行动才是治疗恐惧和懒惰的唯一良药.

更多原创,欢迎关注:Android系统攻城狮

欢迎关注Android系统攻城狮

🍉🍉🍉文章目录🍉🍉🍉

    • 🌻1.前言
    • 🌻2.gdb介绍
    • 🌻3.解决方案
      • 🐓3.1 查看cpu架构
      • 🐓3.2 gdb设置cpu架构

🌻1.前言

本篇目的:Android15之解决gdb:Remote register badly formatted问题

  • 详细报错:
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
warning: while parsing target description (at line 4): Target description specified unknown architecture "aarch64"
warning: Could not load XML target description; ignoring
Reading /system/bin/cameraserver from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /system/bin/cameraserver from remote target...
Reading symbols from target:/system/bin/cameraserver...
Reading /usr/lib/debug/.build-id/a2/71360f43b374f7c470860ddb073a9f.debug from remote target...
Reading symbols from .gnu_debugdata for target:/system/bin/cameraserver...
warning: section .interp not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .note.android.ident not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .note.gnu.build-id not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .dynsym not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .gnu.version not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .gnu.version_r not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .gnu.hash not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .dynstr not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .rela.dyn not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .relr.dyn not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .rela.plt not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .rodata not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .eh_frame_hdr not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .eh_frame not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .plt not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .tdata not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .preinit_array not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .init_array not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .fini_array not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .dynamic not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .got not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .got.plt not found in .gnu_debugdata for target:/system/bin/cameraserver
warning: section .bss not found in .gnu_debugdata for target:/system/bin/cameraserver
(No debugging symbols found in .gnu_debugdata for target:/system/bin/cameraserver)
Remote register badly formatted: T001d:602f7dc77f000000;1f:802e7dc77f000000;20:98460e667d000000;thread:p1363.1363;core:0;
here: 7f000000;1f:802e7dc77f000000;20:98460e667d000000;thread:p1363.1363;core:0;

🌻2.gdb介绍

  • GDB(GNU Debugger)是一款功能强大的程序调试工具,由GNU项目开发,主要用于C、C++、Ada、Fortran等编程语言的调试。GDB可以帮助开发者查找程序中的错误,分析程序运行时的状态,以及了解程序崩溃的原因。作为开源软件,GDB广泛应用于Linux、Unix、macOS等操作系统,成为了许多程序员日常开发不可或缺的工具。
    GDB的主要特点如下:
  1. 断点设置:GDB允许在代码的特定位置设置断点,当程序运行到这些位置时,会暂停执行,便于开发者观察程序状态。
  2. 单步执行:通过单步执行,开发者可以观察程序在每一条指令执行后的状态变化,从而找到问题所在。
  3. 变量查看:GDB可以查看程序中各种变量的值,包括局部变量、全局变量以及静态变量,帮助开发者分析程序逻辑。
  4. 调用栈分析:GDB提供了查看调用栈的功能,可以显示函数调用顺序及各个函数的参数值,便于定位错误所在的函数。
  5. 动态修改:在调试过程中,GDB允许动态修改程序中的变量值,甚至可以直接修改代码,从而快速测试不同场景下的程序表现。
  6. 信号处理:GDB可以捕获程序运行时收到的信号,并显示信号处理函数的调用栈,帮助开发者分析信号处理相关的问题。
  7. 多线程调试:GDB支持多线程程序的调试,可以分别查看和控制各个线程的执行状态。
  8. 调试核心文件:GDB能够分析程序崩溃时生成的核心文件,找出导致程序崩溃的原因。
    GDB的基本使用流程如下:
  9. 编译程序:在编译程序时,需要添加调试信息选项(如GCC的"-g"选项),以便GDB能够获取到程序的源代码信息。
  10. 启动GDB:在命令行中输入"gdb"命令,启动GDB调试器。
  11. 加载程序:使用"gdb"命令启动GDB后,通过"file"命令加载要调试的程序。
  12. 设置断点:使用"break"命令在程序的特定位置设置断点。
  13. 运行程序:使用"run"命令开始执行程序,程序会在断点处暂停。
  14. 查看状态:在断点处,可以使用各种GDB命令查看程序状态,如"print"查看变量值,"next"单步执行等。
  15. 继续执行:使用"continue"命令让程序继续执行,直到遇到下一个断点或程序结束。
  16. 退出GDB:调试完成后,使用"quit"命令退出GDB。
  • GDB作为一款强大的调试工具,其功能丰富且灵活,能够有效提高开发者查找和解决问题的效率。熟练掌握GDB的使用,对于程序员来说具有重要的实际意义。

🌻3.解决方案

🐓3.1 查看cpu架构

# lscpu
架构:                   x86_64CPU 运行模式:         32-bit, 64-bitAddress sizes:         39 bits physical, 48 bits virtual字节序:               Little Endian
  • cpu架构为: x86_64

🐓3.2 gdb设置cpu架构

(gdb) set architecture i386:x86-64
The target architecture is set to "i386:x86-64".
  • 设置成功以后,再来执行gdb命令操作即可。

http://www.ppmy.cn/devtools/128037.html

相关文章

【Flutter】Dart:类

在 Dart 中,类(Class)是面向对象编程的核心概念之一,提供了一种封装数据和功能的方式。理解 Dart 中的类以及它的相关特性是开发 Flutter 应用的基础。本教程将深入介绍 Dart 中类的定义、属性、构造函数、方法、接口、Mixin 以及…

quic-go源码二---server accept请求

本篇是上一篇的 看点2 内容。本该放上篇,但是由于上篇内容已经不少,所以单独拆开。另外还是主动说明下:我使用quic-go版本是github.com/quic-go/quic-go v0.47.0, 虽然我在上篇截图过程中就尽量带上了quic-go版本信息,…

【C语言】循环结构while循环do...while循环

while循环&#xff1a; 初始化循环变量 while(循环条件) {循环变量控制;循环体; }do while循环&#xff1a; do{循环变量控制;循环体; }while(循环条件)#include <stdio.h> #include <math.h> /* 功能&#xff1a;循环结构&#xff08;while,do while&#xff09…

在 Vue 3 中实现电子签名组件

在 Vue 3 中实现一个简单的电子签名组件&#xff0c;并解决一个常见问题&#xff1a;当签名组件放在弹窗内时&#xff0c;鼠标绘制会出现偏移的问题。 项目环境&#xff1a; Vue 3&#xff1a;前端框架Element Plus&#xff1a;UI 组件库 电子签名组件功能 画布绘制&#x…

判断 HTTP/2 多路复用是否在服务器上实现

要判断 HTTP/2 多路复用是否在服务器上实现&#xff0c;并确保浏览器正在使用多路复用来加载资源&#xff0c;您可以使用以下几种方法进行验证&#xff1a; 1. 使用浏览器开发者工具 大多数现代浏览器&#xff08;如 Chrome、Firefox、Edge&#xff09;提供了开发者工具&…

Python进阶

面向对象编程&#xff08;OOP&#xff09; 1.1 类和对象 类 是一个模板&#xff0c;用来描述一类对象的属性和行为。通过定义类&#xff0c;你可以创建对象&#xff08;也称为类的实例&#xff09;。对象 是类的实例&#xff0c;通过类创建的具体实例对象。 示例&#xff1a…

基于Springboot在线视频网站的设计与实现

基于Springboot视频网站的设计与实现 开发语言&#xff1a;Java 框架&#xff1a;springboot JDK版本&#xff1a;JDK1.8 服务器&#xff1a;tomcat7 数据库&#xff1a;mysql 5.7 数据库工具&#xff1a;Navicat11 开发软件&#xff1a;idea 源码获取&#xff1a;https://do…

架构设计笔记-21-案例分析

1.遗留系统策略 / 数据迁移 / REST和RPC风格 2.分布式系统 / 分布式对象调用 3.开放式架构 / GOA 4.ESB 5.FMEA故障分析 6. 加密 / 公钥体系机制 / 加解密API和透明加密 7.嵌入式系统故障 / 故障滤波算法 / 容错算法 8.开源框架struts / spring / Hibenate 9.企业应用集成 10.T…