gpt4 book ai didi

debugging - 使用 Buildroot 生成 RISC-V Linux GDB

转载 作者:行者123 更新时间:2023-12-02 19:51:20 26 4
gpt4 key购买 nike

我正在尝试使用 Buildroot 为 QEMU(RV64G ISA、lp64d ABI、Virt machine)交叉编译 Linux。但显然,GDB 已从我正在使用的 buildroot 版本(2019.08)中删除,并列在旧列表下。

我的目标是能够运行 RISC-V Linux 应用程序(在用户模式和 softmmu 中)并使用 GDB 调试。我能够在两种模式下使用 QEMU 构建和运行 RISC-V 应用程序。但我没有找到像其他主机实用程序一样生成 GDB 的方法。关于如何做到这一点有什么想法吗?

最佳答案

从头开始构建 riscv64-linux-gnu-gdb 的可能过程是:

PREFIX=$(pwd)/gdb-8.3.1-riscv64-linux-gnu
wget ftp://ftp.gnu.org/gnu/gdb/gdb-8.3.1.tar.xz
tar Jxf gdb-8.3.1.tar.xz
mkdir gdb
cd gdb
../gdb-8.3.1/configure --program-prefix=riscv64-linux-gnu- -with-tui --target=riscv64-linux-gnu --prefix=${PREFIX}
make all install
cd -

构建工件将位于$(pwd)/gdb-8.3.1-riscv64-linux-gnu:

ls -gG gdb-8.3.1-riscv64-linux-gnu/bin/riscv64-linux-gnu-gdb
-rwxr-xr-x 1 80395824 Sep 26 14:16 gdb-8.3.1-riscv64-linux-gnu/bin/riscv64-linux-gnu-gdb

gdb-8.3.1-riscv64-linux-gnu/bin/riscv64-linux-gnu-gdb --version
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 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.

如果您不想使用 TUI interface 构建 GDB ,从 ./configure 命令中删除 --with-tui

我希望这会有所帮助。

关于debugging - 使用 Buildroot 生成 RISC-V Linux GDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58118709/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com