GDB 调试出现:Couldn't find general-purpose registers in core file
来源:互联网 发布:nginx 多域名别名 编辑:程序博客网 时间:2024/06/05 03:26
现在平台基本都是64位的,用平台默认的gdb工具来加载vmlinux和ramdump会出现:
warning: Couldn't find general-purpose registers in core file.warning: Couldn't find general-purpose registers in core file.#0 <unavailable> in ?? ()
这是因为该gdb版本比较落后,并不能支持当前ARM平台的寄存器设置,无法识别;
解决方法:官网下载最新的gdb版本:http://www.gnu.org/software/gdb/download/
我下载的是最新的版本gdb 8.0,下载下来解压:
~$ cd gdb-8.0~/gdb-8.0$ ./configure --host=x86_64-linux-gnu --target=aarch64-elf-linuxconfigure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used.checking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... aarch64-elf-linux-gnuchecking for a BSD-compatible install... /usr/bin/install -cchecking whether ln works... yeschecking whether ln -s works... yes
需要根据平台config,如果不知道也可以打开平台自带的老版本gdb查看:
$ ./aarch64-linux-android-gdb -versionPython Exception <type 'exceptions.ImportError'> No module named gdb: warning: Could not load the Python gdb module from `/tmp/ndk-mtk04092/build/toolchain/prefix/share/gdb/python'.Limited Python support is available from the _gdb module.Suggest passing --data-directory=/path/to/gdb/data-directory.GNU gdb (GDB) 7.6Copyright (C) 2013 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Type "show copying"and "show warranty" for details.This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf-linux".For bug reporting instructions, please see:<http://source.android.com/source/report-bugs.html>.
最后make一下,在gdb目录下就可以找到运行的gdb bin文件了:
~/gdb-8.0$ ./gdb/gdb --versionGNU gdb (GDB) 8.0Copyright (C) 2017 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Type "show copying"and "show warranty" for details.This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf-linux".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos word" to search for commands related to "word".
用gdb 加载vmlinux和rumdump:
$ ./gdb vmlinux rumdumpGNU gdb (GDB) 8.0Copyright (C) 2017 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Type "show copying"and "show warranty" for details.This GDB was configured as "--host=x86_64-linux-gnu --target=aarch64-elf-linux".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos word" to search for commands related to "word"...Reading symbols from vmlinux...done.[New LWP 107][New LWP 1][New LWP 2][New LWP 3][New LWP 4][New LWP 5][New LWP 6][New LWP 7][New LWP 8]Core was generated by `console=tty0 console=ttyMT0,921600n1 root=/dev/ram vmalloc=496M slub_max_order='.#0 0xffffffc0006bd034 in capture (image_window=<optimized out>, sensor_config_data=<optimized out>) at xxx.c:12521252 BUG();(gdb) bt#0 0xffffffc0006bd034 in capture (image_window=<optimized out>, sensor_config_data=<optimized out>) at xxx.c:1252#1 control (scenario_id=<optimized out>, image_window=<optimized out>, sensor_config_data=<optimized out>) at xxx.c:1461
阅读全文
0 0
- GDB 调试出现:Couldn't find general-purpose registers in core file
- gdb Couldn't get registers: No such process
- ionic创建项目报错:Couldn't find ionic.config.json file. Are you in an Ionic project?
- ionic创建项目报错:Couldn't find ionic.config.json file. Are you in an Ionic project?
- aidl文件中出现couldn't find import for class
- 安装vc6出现couldn't find acme setup的解决办法
- Android Studio 加载 .so库出现couldn't find "*.so"
- Android Studio 加载 .so库出现couldn't find "*.so"
- iOS开发 -- Couldn't find default.styleproto in framework Error
- xcode 出现 The file couldn’t be opened.
- cocos2dx 3.x打包出现Can't find config file .cocos-project.json in path
- couldn‘t find design note
- Couldn’t find MySQL server
- couldn't find "libyuv.so
- couldn't find "libvinit.so"
- couldn't find native method
- couldn't find "libweibosdkcore.so"
- couldn't find "libgnustl_shared.so"
- linux常用命令 文件操作类
- (1)OFBIZ-安装部署
- Qt Charts编译和使用
- CRC循环冗余校验码
- xml基础知识(3)
- GDB 调试出现:Couldn't find general-purpose registers in core file
- docker web-GUI DockerUI和Shipyard对比
- Js_log2000_两种定时器的异同
- docker容器中搭建kafka集群环境
- slice splice split
- LINQ语句
- CentOS Linux Various Versions Meaning
- 你所不知的 CSS ::before 和 ::after 伪元素用法
- Python把对应格式的csv文件转换成字典类型存储脚本