我试图在编译Linux内核之后使用eclipse调试Linux。 我创建了一个新项目,现在在运行 - >调试配置中给出了vmlinux的路径。 给了TCP端口并点击了DEBUG。 我有以下错误无法使用eclipse调试linux
"/home/linux-kernel/vmlinux":
not in executable format: File format not recognized TCP port and clicked on debug.
请点我在哪里,我错了。
我试图在编译Linux内核之后使用eclipse调试Linux。 我创建了一个新项目,现在在运行 - >调试配置中给出了vmlinux的路径。 给了TCP端口并点击了DEBUG。 我有以下错误无法使用eclipse调试linux
"/home/linux-kernel/vmlinux":
not in executable format: File format not recognized TCP port and clicked on debug.
请点我在哪里,我错了。
Linux内核不是一个可执行程序。它接管了整个电脑。因此,您需要在不同的PC上或像qemu这样的PC仿真器上运行内核。
这里是一个博客帖子里面给出了详细说明如何一切设置:Debugging the Linux kernel using Eclipse/CDT and Qemu
你得到暗示你没有正确配置远程调试的错误。 Eclipse不会连接到正在运行的qemu,而是尝试像正常程序一样启动Linux内核。在这里看到如何配置启动配置进行远程调试:
点击“调试器”标签,并在“调试器”列表框中选择“gdbserver Debugger”。
接下来,将“启动时停止在:”修改为“start_kernel”。
在此之下,您会注意到一个名为“调试器选项”的框架;
单击此框架中的“连接”选项卡,并将“类型”修改为“TCP”和“端口号”为1234.
继续单击“调试”按钮。
如果这不起作用,请确保qemu实际上使用端口1234
。
感谢您的回复,我在qemu上运行Linux,给了qemu-system-i386 -s -S -kernel arch/x86/boot/bzImage – anikhan
查看我的编辑;确保调试设置是正确的 –
看一看:http://issaris.blogspot.hu/2007/12/download-linux-kernel-sourcecode-from.html – meskobalazs
我也跟着同一个链接,谢谢 – anikhan
然后你*可以提到它*在帖子中,并告诉我们你卡在哪里。 – meskobalazs