我关注了教程以及这个一为 ARM 汇编设置编译器 + 调试器。
按照第一个命令,我运行了命令qemu-arm -singlestep -g 1234 empty
并启动了一个新的 shell,在那里我尝试通过复制粘贴给定的指令将 gdb 连接到 qemu:
➜ arm-none-eabi-gdb GNU gdb (GDB) 7.9.1 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later > <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-none-eabi". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) file empty Reading symbols from empty...done. (gdb) target remote localhost:1234 Remote debugging using localhost:1234 _start () at empty.s:4 4 mov r0, #1 (gdb)
但是每当我尝试连接时target remote localhost:1234
都会出现超时错误。我也按照第二个教程中的说明进行操作,但最终还是出现了相同的超时错误。我需要预先配置 qemu 吗?