当前位置:网站首页>Debug xv6
Debug xv6
2022-07-06 17:39:00 【Wzzzzzzx】
The original text can be found in debugging Xv6 Check out , Subsequent updates will be updated to Personal blog
Debugging is a troublesome thing , There are a lot of things to toss , And I don't know some problems now
Debugging tools
There are three known debugging tools , I haven't figured out the specific difference between them yet .
riscv64-unknown-elf-gdb
stay {% post_link 6s081/ function xv6 System “ start-up ” %} xv6
The article introduced SiFive
A tool chain is provided to start the system , You can find it in this tool chain riscv64-unknown-elf-gdb
For debugging
gdb-multiarch
Official tool page The tools provided are gdb-multiarch
. This can be done through apt-get
Direct installation . Besides , Provided on the tools page GitHub Can be found in , The bags provided by the warehouse are also riscv64-unknown-elf-gdb
riscv64-linux-gnu-gdb
stay video Can be seen in , The debugging tool used by the teacher is riscv64-linux-gnu-gdb
, Because the previous tool has solved the debugging problem , So I didn't find the installation method of this package
.gdbinit
file
Every time you start debugging ,Makefile
Will use .gdbinit.tmpl-riscv
Generate .gdbinit
file . from Makefile
You can see , What will change is the debugging port number . The purpose of this file is to initialize the debugging environment ,gdb
When starting, it will read the commands and execute . See Help document
Difficult miscellaneous diseases
Undefined item: "riscv:rv64"
Use gdb-multiarch
You will see this error prompt at the beginning , At this point, through the command set architecture
View all currently supported system architectures , Found that there was no riscv64
Support for , No wonder there is this error prompt . stay Stack Overflow The answer found on says that the version needs to be upgraded to 8.3 That's all . But my system is Ubuntu 18.04
, System source The maximum supported version is 8.1.1. So there is no way to use this tool for debugging .
I don't know why the course official recommends this as a debugging tool , Maybe I haven't got something right
no symbol table is loaded. use the file command
This problem occurs because symbols are not loaded correctly , At first, there was doubt that it was not used when compiling -g
This option , As a result, the compliance table was not entered . But look at it. Makefile
After the discovery , It USES -ggdb
This command , Can also type the symbol table into the executable file . It's very easy to solve this problem , Only need gdb
In the command line file kernel/kernel
You can load the symbols of the kernel
auto-loading has been declined by your `auto-load safe-path’ set to “$debugdir:$datadir/auto-load”
This is also strange , This warning will be output every time you start . Later I realized , In order to avoid some safety problem ,gdb
Will no longer actively execute any files . So you need to declare in the user directory ,xv6
This warehouse's .gdbinit
The file is secure
adopt echo add-auto-load-safe-path {PATH}/.gdbinit > ~/.gdbinit
Command is enough . among {PATH}
Change to your own warehouse Path
This problem incidentally affects the second problem . If not added as a trusted file , It can lead to gdb
Do not actively load kernel files , Affect symbol resolution .
Reference resources
GDB
Configuration and.gdbinit
CompilingSecurity restriction for auto-loading
MIT 6.S081 xv6 Debugging doesn't point to the North completely
边栏推荐
- CTF逆向入门题——掷骰子
- Shawshank's sense of redemption
- Vscode matches and replaces the brackets
- MySQL error reporting solution
- 自动答题 之 Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。
- Solr appears write Lock, solrexception: could not get leader props in the log
- Quick start of Hongmeng system
- CentOS7上Redis安装
- Application service configurator (regular, database backup, file backup, remote backup)
- [CISCN 2021 华南赛区]rsa Writeup
猜你喜欢
About selenium starting Chrome browser flash back
基于LNMP部署flask项目
CTF reverse entry question - dice
Garbage first of JVM garbage collector
Akamai talking about risk control principles and Solutions
Pyspark operator processing spatial data full parsing (4): let's talk about spatial operations first
Wordcloud colormap color set and custom colors
连接局域网MySql
Connect to LAN MySQL
Jetpack compose 1.1 release, based on kotlin's Android UI Toolkit
随机推荐
Solr appears write Lock, solrexception: could not get leader props in the log
关于Selenium启动Chrome浏览器闪退问题
1. Introduction to JVM
Xin'an Second Edition: Chapter 25 mobile application security requirements analysis and security protection engineering learning notes
信息与网络安全期末复习(基于老师给的重点)
Flink parsing (VII): time window
Learn the wisdom of investment Masters
自动化运维利器-Ansible-Playbook
Precipitated database operation class - version C (SQL Server)
C version selenium operation chrome full screen mode display (F11)
Redis installation on centos7
Development and practice of lightweight planning service tools
Deploy flask project based on LNMP
C WinForm series button easy to use
Redis quick start
mysql高级(索引,视图,存储过程,函数,修改密码)
Openharmony developer documentation open source project
connection reset by peer
C # nanoframework lighting and key esp32
BearPi-HM_ Nano development environment