【问题标题】:Gdb not catching kernel panicGdb 没有捕捉到内核恐慌
【发布时间】:2015-10-23 09:22:06
【问题描述】:

我有一个 ARM Linux 内核作为 android 模拟器的一部分运行,我正在做一些测试。我在没有 GUI 的情况下启动模拟器,只使用 adb shell 访问模拟器的内部存储器。

我在 OSX 机器上启动模拟器如下:-

$ emulator -verbose -debug init -show-kernel -kernel ./zImage -avd debug -no-boot-anim -no-skin -no-audio -no-window -qemu -gdb tcp::1234

我将 gdb 附加到模拟器如下:-

$ arm-eabi-gdb ./vmlinux
(gdb) target remote :1234

我知道附加效果很好,因为如果我早些时候附加调试器,我可以看到引导过程暂停,直到我在 gdb 中按“c”。但是,当模拟器中出现内核恐慌时,我会在运行模拟器的终端上看到堆栈跟踪——但是,我在 gdb 端看不到任何变化。当内核崩溃时机器会停止,所以我假设 gdb 会显示一些相同的迹象。为什么不会发生这种情况?

当我在模拟器端 Ctrl-C 停止 QEMU 时,我收到消息 emulator: Done with QEMU main loop. emulator: User-config was not changed. 并且 gdb 显示 Remote connection closed

我在这里错过了什么?

【问题讨论】:

    标签: linux-kernel android-emulator gdb kernel qemu


    【解决方案1】:

    在 panic 上设置断点并检查回溯是解决问题的一种可能方法。

    【讨论】:

      猜你喜欢
      • 2014-09-21
      • 2013-12-12
      • 2020-01-28
      • 2012-02-08
      • 2015-12-11
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多