低水平基于QEMU调试 [英] Low level qemu based debugging

查看:180
本文介绍了低水平基于QEMU调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经测试在ARM架构的一些低级别code。通常的实验是相当复杂的上实板,所以我在想QEMU。

I've to test some low level code on an ARM architecture. Typically experimentation is quite complicated on the real board, so I was thinking about QEMU.

我想获得某种调试喜欢用printfs或GDB的信息。我知道,这是Linux的简单,因为它实现既为QEMU Integrator和gdb的功能的设备驱动程序,但我不使用Linux。此外,我怀疑是从Linux内核源代码code提取这种功能将是复杂的。

What I'd like to get is some kind of debugging information like printfs or gdb. I know that this is simple with linux since it implements both the device driver for the QEMU Integrator and the gdb feature, but I'm not working with Linux. Also I suspect that extracting this kind of functionality from the Linux kernel source code would be complicated.

我从一些简单工作已经实现了这些功能的一个系统搜索。你有没有一些建议?

I'm searching from some simple operating system that already implements one of those features. Do you have some advice?

先谢谢了。

推荐答案

您不需要一个目标操作系统调试code这里面QEMU运行 - QEMU已经不适合您。

You don't need a target OS to debug code that's running inside QEMU -- QEMU already does that for you.

具体而言,QEMU支持从GDB远程调试 - 你可以使用相应的命令行选项运行QEMU,它会导出GDB(在主机上运行)的副本可以连接到一个接口。在这一点上,你可以简单,只是因为如果你是在主机上运行它调试GDB pretty程序。

Specifically, QEMU supports remote debugging from GDB -- you can run QEMU with the appropriate command-line options and it will export an interface that a copy of GDB (running on the host machine) can connect to. At that point, you can debug the program in GDB pretty much just as if you were running it on the host machine.

http://wiki.osdev.org/GDB 似乎有更多的基本情况;可能不足以完全让你开始,但至少给你基本概念和一些术语来寻找QEMU和GDB文档中获得。跳过关于实施GDB存根,该位,因为QEMU有一个已经在这里并不适用,在使用模拟器存根一节​​开始。简短的形式很简单,你的 -s 选项(出口在本地主机上一个GDB连接:1234)启动QEMU和 -S 选项(等待GDB开始执行之前继续命令),然后在GDB的主机上你说目标远程:1234 而不是运行。此外,当然,你需要使用GDB的ARM版本,而不是原生的x86之一。

http://wiki.osdev.org/GDB appears to have a bit more basic information; possibly not enough to completely get you started, but at least give you the basic idea and some terms to look for in the QEMU and GDB documentation. Skip over the bit about "Implementing GDB Stubs", which doesn't apply here since QEMU has one already, and start at the section on "Using Emulator Stubs". The short form is simply that you start QEMU with the -s option (export a GDB connection on localhost:1234) and the -S option (wait for a GDB "continue" command before starting execution), and then in GDB on your host you say target remote :1234 instead of run. Also, of course, you need to be using an ARM version of GDB rather than a native-x86 one.

(另外,如果你愿意支付的商业解决方案,codeSourcery的ARM工具链有IDE集成,自动设置这一切了,包括printf的打印到调试器控制台支持。这一工程在物理板也一样,如果你有一个硬件调试器通常的声明对我是一个codeSourcery员工适用 - 。但我觉得很容易使用)

(In addition, if you're willing to pay for a commercial solution, CodeSourcery's ARM toolchain has the IDE integration to set all of this up automatically, including support for "printf" to print into the debugger console. That works on a physical board, too, if you've got a hardware debugger. Usual disclaimer about me being a CodeSourcery employee applies -- but I do find it very easy to use.)

更新,2012:的codeSourcery的工具链现在被称为Mentor Graphics公司的Sourcery codeBench,但上述所有仍然适用

Update, 2012: CodeSourcery's toolchain is now called Mentor Graphics Sourcery CodeBench, but all the above still applies.

这篇关于低水平基于QEMU调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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