当前位置:网站首页>Section qemu+gdb
Section qemu+gdb
2022-06-12 17:56:00 【_ kerneler】
gdb+qemu What a good thing , To practice this , Debug the kernel later , I won't print it .
qemu
First :qemu To write a script :
Name is runqemu
#!/bin/bash
#SIMPLEVGA=1024x768-16:0x0df00000 /home/andy/loongson/qemu/qemu/mips64el-softmmu/qemu-system-mips64el -M ls2k -kernel vmlinux -m 2048 -smp 1 -append 'console=ttyS0, 115200 initcall_debug=1 loglevel=20 maxcpus=1 nomsix=1 nomsi=0 [email protected]' -dtb /home/andy/loongson/code/2k/pmon-loongson3/zloader.ls2k/LS2K.dtb -s -nographic -net nic -net user "[email protected]" # -initrd ./rootfs.cpio.gz
#SIMPLEVGA=1024x768-16:0x0df00000 /home/andy/loongson/qemu/qemu/mips64el-softmmu/qemu-system-mips64el -M ls2k -kernel vmlinux -m 2048 -smp 1 -append 'console=ttyS0, 115200 initcall_debug=1 loglevel=20 maxcpus=1 nomsix=1 nomsi=0 [email protected]' -dtb /home/andy/loongson/code/2k/pmon-loongson3/zloader.ls2k/LS2K.dtb -s -nographic -net nic -net user "[email protected]" # -initrd ./rootfs-pai2.cpio.gz
#SIMPLEVGA=1024x768-16:0x0df00000 /home/andy/loongson/qemu/qemu/mips64el-softmmu/qemu-system-mips64el -M ls2k -kernel vmlinux -m 2048 -smp 1 -append 'console=ttyS0, 115200 initcall_debug=1 loglevel=20 maxcpus=1 nomsix=1 nomsi=0 [email protected]' -dtb /home/andy/loongson/code/2k/pmon-loongson3/zloader.ls2k/LS2K.dtb -s -nographic -net nic -net user "[email protected]" #
SIMPLEVGA=1024x768-16:0x0df00000 /home/andy/loongson/qemu/qemu/mips64el-softmmu/qemu-system-mips64el -M ls2k -kernel vmlinux -m 2048 -smp 1 -append 'console=ttyS0, 115200 initcall_debug=1 loglevel=20 maxcpus=1 nomsix=1 nomsi=0 [email protected]' -dtb /home/andy/loongson/code/loongson_pai/linux-4.19-loongson_new/linux-4.19.167-loongson/arch/mips/boot/dts/loongson/ls2k1000_pai_udb_v1_5.dtb -s -nographic -net nic -net user "[email protected]" #
-M It corresponds to the name of the card for debugging . You can use ./qemu -d ? To view the supported boards .
-m Memory size
-smp Simulate several cores
-append Kernel boot pass parameters
-dtb dtb The path of
-s debugging ( Unknown )
-nographic No graphics
./runqemu -S Step by step debugging . After running, it will be stuck in the first line
GDB
Suggest opening a tmux,qemu It's over there ./runqemu -S
gdb here gdb-multiarch vmlinux
Then enter gdb ,target remote 127.0.0.1:1234 Enter debugging .//qemu Created a
gdbserver, Use the command to establish a connection with the simulator's application
After that you can ctrl + x + o ,ctrl + x +2 Open the code box
Then you can officially debug
b To set breakpoints
c perform
n Single step non stepping function
s Single step but progressive function
frame 1 see Who called the current function ( Current function parent function )
frame 2 View the grandfather of the current function
.....
wait .....
If there is no code box, no code is displayed ,list There is no code to show
Remember to add... When compiling +g colleagues menuconfig In the kernel hacking->config_debug_info
Choose
边栏推荐
猜你喜欢

文章名字

Vant3 +ts packaged simple step advancer component

A method of quickly reusing wechat login authorization in app
![[csp]202012-2 optimal threshold for period end forecast](/img/40/9b59bd692bcfe05d16614cc6d55d1f.png)
[csp]202012-2 optimal threshold for period end forecast

论文《Deep Interest Evolution Network for Click-Through Rate Prediction》
Goframe gredis configuration management | comparison of configuration files and configuration methods

es7不使用父子和嵌套关系来实现一对多功能

一种好用、易上手的小程序IDE

Nixos 22.05 installation process record

Use applet to quickly generate app in seven steps
随机推荐
[csp]202012-2 optimal threshold for period end forecast
Lambda - 1
数据库SQL操作基础
SqlServer常用语句及函数
leetcode 647. 回文子串
全局锁、表锁、行锁
Advanced mountain -asp Net core router basic use demo 0.1
JDBC快速入门教程
Sqlserver common statements and functions
Recognize function originality
JDBC几个坑
grpc-swift入门
Cesium parabolic equation
小程序+App,低成本获客及活跃的一种技术组合思路
Vulnhub[DC3]
vant3+ts h5页面嵌套进app 与原生app通信
迄今微软不同时期发布的SQL Server各版本之间的大致区别,供参考查阅
Authorization in Golang ProjectUseing Casbin
轻量、便捷的小程序转App技术方案,实现与微信/流量App互联互通
Error record: illegalstateexception: optional int parameter 'XXXX' is