如何在 ARM 上使用 kgdb? [英] How to use kgdb on ARM??

查看:15
本文介绍了如何在 ARM 上使用 kgdb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ARMv7 作为目标机器.我已经为目标编译了 Linux 源代码 2.6.34.13.

Im using ARMv7 as a target machine. I have compiled the Linux source 2.6.34.13 for target.

Target 使用 minicom 通过串口与主机(Linux 开发机)连接.

Target is connected with Host(Linux Development machine) through serial port using minicom.

Target 已加载新内核并在命令提示符下启用 KGDB.

Target is loaded with new kernel and KGDB is enabled in command prompt.

$ echo ttyAMA0 > /sys/module/kgdboc/parameters/kgdboc 
$ echo g > /proc/sysrq-trigger

正在输入 KGDB... 消息显示并等待命令.

Entering KGDB... message is displayed and waits for commands.

主机端

$arm-none-linux-gnueabi-gdb vmlinux

    gdb > set remotebaud 115200
    gdb > set debug remote 1
    gdb > target remote /dev/ttyS0

在此之后,默认会进行一些命令通信.

After this, some command communication takes place by default.

  1. qSupported 从主机发送到目标.但目标不支持 qSupoted,因此返回 $#00.类似地 ?, HC-1 命令已发送但收到正确的响应.

  1. qSupported is sent from Host to Target. But qSuppoted is not supported by target so $#00 is returned. similarly ?, HC-1 commands were sent but receives proper response.

但是 qOffsets 命令没有收到来自目标的任何响应.

But qOffsets command not receiving any response from target.

我怀疑是 vmlinux.因为如果我在 gdb 中给出 list,它不会显示 10 行代码而是说

I suspect vmlinux. Because if I give list in gdb, its not showing 10 lines of code instead it says

arch/arm/kernel/head.S : No such file or directory.

注意 :: 内核编译在服务器中完成.所以开发机器中没有可用的源.但 arm-gdb 似乎在寻找 head.S.

Note :: Kernel compilation done in server. so no source is available in development machine. But arm-gdb looks for head.S it seems.

我不确定我在做什么错.我需要为整个内核加载符号.在这方面指导我.

I am not sure what mistake im doing. I need symbols to be loaded for entire kernel. Guide me in this regards.

推荐答案

最后主机到目标的通信建立起来只是线路延迟的bcos.开发机器中的内核源与超时问题没有关系.

Finally Host to Target communication established just bcos of line delay. There is no relationship between kernel source in development machine and time-out issues.

对于某些命令的超时问题,说 qOffsetqSupported 通过使用 GtkTerm 而不是 minicom 作为串行端口通信工具来解决.区别在于 GtkTerm 中的线路延迟"选项.因此,当它配置为 ~250 时,此后没有超时消息.只需建立连接并在默认断点处等待.如果有人知道如何在minicom中给出这个"line delay"对大家会更有帮助.

For the time-out kind of issue for some of the commands say qOffset and qSupported is solved by using GtkTerm instead of minicom as the serial port communication tool. Difference is "line delay" option in GtkTerm. so when this is configured to ~250, there is no timeout message thereafter. simply connection established and waits at default break point. If anyone knows how to give this "line delay" in minicom will be more helpful to everyone.

是的,当然,我们需要执行 list 命令的源代码.但是如果没有这些源,我们也可以调试,即 si, bt 可以在 vmlinuxsystem.map 的帮助下执行.

yes ofcourse, we need source code for list command to execute. but without those source also, we can debug i.e si, bt can be executed with the help of vmlinux and system.map.

注意:设置调试远程 1 不是必需的.这给出了主机到命令通信的详细显示.更详细的视图,set debug serial 1.

Note:: set debug remote 1 is not necessary. This gives detailed display of host to command communications. For more detailed view, set debug serial 1.

这篇关于如何在 ARM 上使用 kgdb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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