是否可以使用gdb和qemu同时调试linux用户空间程序和内核空间? [英] Is it possible to use gdb and qemu to debug linux user space programs and kernel space simultaneously?

查看:356
本文介绍了是否可以使用gdb和qemu同时调试linux用户空间程序和内核空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,使用gdb + qemu,我可以跨入Linux内核源代码。是否可以同时调试用户空间程序?例如,单步执行从用户空间到内核空间的程序,以便通过发布 info registers ?$ b $来观察qemu监视器上的寄存器更改我通过使用gdb命令添加符号文件来添加用户空间程序的调试信息来实现它。但是你必须知道这些程序加载地址。准确地说,您必须像平常一样通过将gdb连接到gdbserver来启动内核调试;然后,您可以添加这些程序调试信息。你也可以使用.gdbinit脚本。阅读


So far, with gdb + qemu, I can step into/over linux kernel source code. Is it possible to debug the user space programs simultaneously? For example, single step a program from user space to kernel space so I can observe the changes of registers on the qemu monitor by issuing info registers?

解决方案

I achieve it by using the gdb command add-symbol-file to add userspace programs debugging information. But you must know these programs loading addresses. so to be precise, you have to launch the kernel debugging by connecting gdb to gdbserver as usual; and then, you can add those program debugging information. You can also use .gdbinit script though. Read this

这篇关于是否可以使用gdb和qemu同时调试linux用户空间程序和内核空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆