当前位置:网站首页>Kgdb debug kernel cannot execute breakpoints and kdb-22:permisson denied
Kgdb debug kernel cannot execute breakpoints and kdb-22:permisson denied
2022-07-27 10:39:00 【Kun Yu】
Before that Centos8 Operating system , adopt kgdb Debugging kernel encountered a breakpoint and kdb-22:Permisson denied The problem of . Next , This article describes the modified configuration parameters .
Chapter Preview :
1. Select kernel to configure kernel parameters
2. Configure kernel parameters
2.1 To configure kgdb Basic debugging parameters
2.2 Check or manually configure parameters
3. kgdb Relevant required configuration parameters
4. Follow up
Chapter content :
1. Select kernel to configure kernel parameters
stay linux Debugging the kernel in related systems is a simple thing , However, some minor problems may be encountered if a parameter is not configured or configured incorrectly : For example, you cannot connect to the target machine through the serial port , Unable to debug target kernel code, etc .
First , Let's start by choosing the kernel version , adopt uname -r View kernel version :
Refer to the figure 1, The kernel version is 4.18.0-240.10.1, Can download 4.18.0-240.10.1 or 4.18.xx The version uses .
2. Configure kernel parameters
First, copy the kernel package to /usr/src(ubuntu System ) or /usr/src/kernels(Centos Related systems ) Unzip and enter the directory , Then configure the kernel parameters .
Input make menuconfig( Install the required libraries one by one according to the prompts ):
2.1 To configure kgdb Basic debugging parameters
First , Press / The search window appears :
Refer to the figure 3, Enter... In the search window CONFIG_KGDB:

Refer to the figure 4, Enter enter :

Refer to the figure 5, We can see (1)、(2)… Next is CONFIG_KGDB Corresponding to all settable parameter options , We press the numbers 1 Get into :

Refer to the figure 6, Press enter to continue :

Refer to the figure 7,CONFIG_KGDB This is the setting , Then press the shift right key to Save Options , Press enter again :

Refer to the figure 8, choice ok Save configuration , And then all the time Esc Key to exit the kernel parameter configuration interface .
2.2 Check or manually configure parameters
Use vi .config or vim .config Open profile ( root directory ):

Refer to the figure 9, When we are not sure whether the file has been configured correctly , Parameters can be checked or manually set .
3. kgdb Relevant required configuration parameters
Now we know how to configure and check parameters , Next, learn what configuration parameters are required :
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
CONFIG_DEBUG_INFO=y
Easy to ignore configuration ( You can configure ):
CONFIG_KDB_DEFAULT_ENABLE=0x1 # kdb -22:Permisson denied
CONFIG_RANDOMIZE_BASE=y # Unable to debug breakpoints
4. Follow up
After the above steps , The rest is a brief introduction :
① Compiling and installing the kernel is relatively simple , Refer to previous articles ,ubuntu Compile kernel mode ;
② ubuntu The system is in /boot/grub/grub.cfg Internal increase kgdboc=ttyS1,102400 kgdbwait ,Centos8 stay /boot/loader/entries/xxxx- Kernel version .conf Internal increase kgdboc=ttyS1,102400 kgdbwait ;
③ The kernel source code in the remote debugging machine should be placed in the position corresponding to the target machine , And put... In the source code of the target machine vmlinux Copy to the corresponding location in the kernel source code in the remote debugging machine ;
④ stay vmware Start the target machine (kgdb Debugged machine ) when , You can communicate with the remote debugging machine by adding a serial port .
边栏推荐
猜你喜欢

flask_restful中的输出域(Resource、fields、marshal、marshal_with)

Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 1)

Mail server

Free DIY trip

Warning: remote head references to nonexistent ref, unable to checkout error messages

warning package.json: No license field报错

ctf (hardrce)

Beijing publicized the spot check of 8 batches of children's shoes, and qierte was listed as unqualified

Multipoint bidirectional republication and routing strategy

Oracle调整数据文件大小杂谈
随机推荐
数据类型与变量
数据库操作基础语句
TDengine 商业生态合作伙伴招募开启
SQL injection
Matlab/Simulink求解微分方程样例分享
家庭琐事问题
语音数据采集-实时语音数据可视化
MySQL master-slave architecture, read-write separation, and high availability architecture
【英雄哥六月集训】第 28天: 动态规划
window平台下本地连接远程服务器数据库(一)
php生成文字图片水印
Matlab的不同进制转换
服务器访问速度
厉害了!VMware ESXi安装记录,附下载
[Linux] install MySQL
Ubuntu and MySQL quick start tutorial
FTP 服务器
Establishment of NFS server
[brother hero June training] day 23: dictionary tree
warning: remote HEAD refers to nonexistent ref, unable to checkout报错信息