当前位置:网站首页>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
GDBConfiguration and.gdbinitCompilingSecurity restriction for auto-loading
MIT 6.S081 xv6 Debugging doesn't point to the North completely
边栏推荐
- Concept and basic knowledge of network layering
- 06 products and promotion developed by individuals - code statistical tools
- Interpretation of Flink source code (I): Interpretation of streamgraph source code
- Final review of information and network security (based on the key points given by the teacher)
- 【MySQL入门】第三话 · MySQL中常见的数据类型
- 02 personal developed products and promotion - SMS platform
- 关于Selenium启动Chrome浏览器闪退问题
- CTF reverse entry question - dice
- Remote code execution penetration test - B module test
- February database ranking: how long can Oracle remain the first?
猜你喜欢

Uipath browser performs actions in the new tab

Vscode matches and replaces the brackets

Display picture of DataGridView cell in C WinForm

The NTFS format converter (convert.exe) is missing from the current system

06 products and promotion developed by individuals - code statistical tools

BearPi-HM_ Nano development environment

2021-03-22 "display login screen during recovery" can't be canceled. The appearance of lock screen interface leads to the solution that the remotely connected virtual machine can't work normally

Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system

Wu Jun's trilogy experience (VII) the essence of Commerce

03 products and promotion developed by individuals - plan service configurator v3.0
随机推荐
遠程代碼執行滲透測試——B模塊測試
EasyRE WriteUp
Deploy flask project based on LNMP
JVM garbage collection overview
学 SQL 必须了解的 10 个高级概念
Akamai 反混淆篇
灵活报表v1.0(简单版)
基于Infragistics.Document.Excel导出表格的类
Solr appears write Lock, solrexception: could not get leader props in the log
Shawshank's sense of redemption
自动化运维利器ansible基础
Models used in data warehouse modeling and layered introduction
C WinForm series button easy to use
Based on infragistics Document. Excel export table class
DataGridView scroll bar positioning in C WinForm
[getting started with MySQL] fourth, explore operators in MySQL with Kiko
Distributed (consistency protocol) leader election (dotnext.net.cluster implements raft election)
Vscode replaces commas, or specific characters with newlines
Flink parsing (III): memory management
mysql高級(索引,視圖,存儲過程,函數,修改密碼)