免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4190 | 回复: 10
打印 上一主题 下一主题

kgdb问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-17 21:26 |只看该作者 |倒序浏览
同学们在bootloader里配置好关于kgdb的启动参数后,内核启动都是停止在什么地方等待remote gdb connection啊?
kgbdoc=ttyS0,kgdbwait

我的是要等uart完全启动后,即就是tty layer启动后才停下来,Log如下:
Linux version 2.6.31-1.2 (leon@leon) (gcc version 4.2.0 20070124 (prerelease) - BRCM 11ts-2009050 #7 Mon May 3 14:24:41 CST 2010
Fetching vars from bootloader... found 7 vars.
Early serial console at MMIO 0x10406b00 (options '115200n8')
console [uart0] enabled
Options: sata=0 enet=1 emac_1=0 no_mdio=0 docsis=0 pci=0 smp=0 moca=0 usb=1
Probing system memory size... found 128 MB
CPU revision is: 00029041 (Broadcom BMIPS3300)
Determined physical RAM map:
memory: 08000000 @ 00000000 (usable)
bmem: adding 90 MB RESERVED region at 38 MB (0x05a00000@0x02600000)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00008000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: ubiroot bmem=90M@38M ubi.mtd=rootfs rootfstype=ubifs root=ubi0:rootfs
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Primary instruction cache 32kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 32kB, 2-way, VIPT, cache aliases, linesize 16 bytes
Memory: 30436k/131072k available (3613k kernel code, 100476k reserved, 743k data, 172k init, 0k highmem)
NR_IRQS:128
Detected MIPS clock frequency: 185 MHz (92.574 MHz counter)
Calibrating delay loop... 184.83 BogoMIPS (lpj=92416)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
fuse init (API version 7.12)
msgmni has been set to 59
io scheduler noop registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x10406b00 (irq = 21) is a 16550A
console handover: boot [uart0] -> real [ttyS0]
serial8250.0: ttyS1 at MMIO 0x10406b40 (irq = 65) is a 16550A
serial8250.0: ttyS2 at MMIO 0x10406b80 (irq = 66) is a 16550A
-----stop here

看文档应该是在更早些时候就能停下来的吧???

论坛徽章:
0
2 [报告]
发表于 2010-07-17 21:59 |只看该作者
这个停在哪是你bootloader里配置的

论坛徽章:
0
3 [报告]
发表于 2010-07-17 22:06 |只看该作者
我用的参数是kgdboc=ttyS0, kgdbwait

bootloader里还能怎么配???

回复 2# 0vk0

论坛徽章:
0
4 [报告]
发表于 2010-07-17 22:13 |只看该作者
移殖bootloader的时候就有相关的配置

论坛徽章:
0
5 [报告]
发表于 2010-07-17 22:14 |只看该作者
移殖bootloader的时候就有相关的配置

论坛徽章:
0
6 [报告]
发表于 2010-07-17 22:22 |只看该作者
在bootloader里不就是主要设置关于kgdb的启动参数嘛? kgdboc=ttyS0, kgdbwait
你能告诉我你的是在什么地方就stop下来的么?我就想知道是不是一定要等tty layer起来,等uart注册成功后才能stop?

回复 5# 0vk0

论坛徽章:
0
7 [报告]
发表于 2010-07-18 08:10 |只看该作者
kgdb调试太麻烦了,很不方便,而且要开两个虚拟机...

论坛徽章:
0
8 [报告]
发表于 2010-07-20 17:28 |只看该作者
版上的同学呢???说说你们的kgdb是停在那个地方啊??kgdb我已经可以用起来了,但因为启动的时候kernel停下来太靠后了,所以不能debug booting issue啊....我现在就想confirm一下你们的kgdb都是在启动的哪个阶段停下来的?先谢了哈...

回复 1# heberthe

论坛徽章:
0
9 [报告]
发表于 2010-07-23 13:13 |只看该作者
本帖最后由 dedodong 于 2010-07-23 13:17 编辑
Linux version 2.6.31-1.2 (leon@leon) (gcc version 4.2.0 20070124 (prerelease) - BRCM 11ts-2009050 #7 Mon May 3 14:24:41 CST 2010
Fetching vars from bootloader... found 7 vars.
Early serial console at MMIO 0x10406b00 (options '115200n8')
console [uart0] enabled
Options: sata=0 enet=1 emac_1=0 no_mdio=0 docsis=0 pci=0 smp=0 moca=0 usb=1
heberthe 发表于 2010-07-17 21:26



在kgdb邮件列表里看到你邮件了,但开始没仔细看明白。

kgdb是支持"早期"调试的,但是需要一些"定制"..

Fetching vars from bootloader... found 7 vars.
Early serial console at MMIO 0x10406b00 (options '115200n8')

理论上可以在Early serial console at MMIO 0x10406b00 (options '115200n8') 后开始调试。

你试试 kgdb8250 这个通信模块(你现在使用的是kgdboc).

kgdb8250=ttyS0,kgdbwait?

论坛徽章:
0
10 [报告]
发表于 2010-07-23 13:14 |只看该作者
Kernel parameter: kgdb8250

You can build the make the kgdb8250 driver as a kernel module "8250_kgdb.ko" or as a built-in. Either way you must pass the parameter kgdb8250=<args described below> to configure the I/O driver. Alternately if you used the kgdb8250 kgdb I/O driver as a built-in you can configure it at run time by using the echo command to send the configuration into the sysfs parameters. Note that when using sysfs, you omit the "kgdb8250=" For example:

    *

      kgdb8250=ttyS<n>,<baud rate>

You can also return kgdb back to the unregistered state by using:

    *

      echo "" > /sys/module/8250_kgdb/paramaters/kgdb8250

When loading the 8250_kgdb.ko module or using the kgdb8250 driver as a built in, the configuration takes one of two forms.

   1.

      Full serial address specification:
          *

            kgdb8250=<io|mmio|mbase>,<address>[/<regshift>],<baud rate>,<irq>
          *

            The values io or mmio refer to if the address being passed next needs to be memory mapped (mmio) or not. The mbase (short for membase) parameter is only used if mapbase is set to zero for uart definition, which is the case for some ppc boards. The address must be passed in hex and is the hardware address and will be remapped if passed as mmio. An optional regshift value can be given to express address spreading of the 8250 registers. regshift just as the succeeding baud rate and irq values are base-10. The supported values for baud rate are 9600, 19200, 38400, 57600, and 115200.

            To specify the values of the serial port at boot:

            kgdb8250=io,3f8,115200,3

            On certain non x86 archs it might look something like:

            kgdb8250=mmio,0xff5e0000,115200,74

   2.

      Simple configuration:
          *

            kgdb8250=<tty_name>,<baud rate>
          *

            The simple configuration can be used so long as you are not trying to perform "early" debugging on a platform that supports early debugging. Early debugging allows you to debug the kernel prior to console_init() and the tty driver registration. In the case of the simple configuration the address, port type and irq information can be obtained dynamically by the kgdb I/O driver after the tty's are registered. Here is an example of the simple configuration parameter for ttyS0:

            kgdb8250=ttyS0,115200

If you do use the full serial address configuration and the kgdbwait parameter to boot your kernel, on some architectures it may be able to stop before console output has started in which it might look like the target machine is hung when in reality it is just waiting for the debugger.

Finally, it should be noted that you should not try to multiplex a standard serial console and use the kgdb8250 driver at the same time if you have a single serial port IE: "console=ttyS0,11520 kgdb8250=ttyS0,115200". You should use the kgdboc and not the kgdb8250 driver if this is what you want to do.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP