【问题标题】:gdb doesn't stop at break point startup_32gdb 不会在断点处停止 startup_32
【发布时间】:2018-12-13 11:20:26
【问题描述】:

使用 qemu 和 gdb 调试 linux 内核启动。这是源分支:https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3.18。配置是 i386_ranchu_defconfig。这是我使用的步骤:

qemu-system-i386 -kernel ~/aosp/goldfish/arch/x86/boot/bzImage -s -S
gdb ~/aosp/goldfish/vmlinux
(gdb) target remote :1234
0x0000fff0 in ?? ()
(gdb) b startup_32
Breakpoint 1 at 0xc0200000: file arch/x86/kernel/head_32.S, line 96.
(gdb) c
Continuing.

但是程序不会在 startup_32 处停止。相反,如果我将 startup_32 更改为 start_kernel 则它可以工作。

(gdb) b start_kernel
Breakpoint 1 at 0xc0b3672c: file init/main.c, line 498.
(gdb) c
Continuing.

Breakpoint 1, start_kernel () at init/main.c:498
498 {
(gdb) 

为什么程序没有在 startup_32 停止?

【问题讨论】:

    标签: linux-kernel gdb


    【解决方案1】:

    startup_32 是引导代码的一部分,虚拟内存尚未设置,因此尝试在 0xc0200000(虚拟内存地址)处中断可能会锁定系统,内核不会执行该跳转。

    start_kernel OTOH,在虚拟内存初始化后发生。

    【讨论】:

      猜你喜欢
      • 2013-07-20
      • 2020-12-30
      • 2013-09-26
      • 2021-12-07
      • 1970-01-01
      • 2012-03-11
      • 1970-01-01
      • 2019-04-29
      • 2012-07-15
      相关资源
      最近更新 更多