You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装GDB后运行汇编代码脚本出现版权信息,是否安装有误?

问题

运行.asm文件时曾提示gdb not found,于是通过终端执行sudo apt-get install gdb安装了GDB。但现在运行代码时会弹出GDB的完整版权许可信息,请问是否安装错误?

运行时输出如下:

rm: cannot remove '*.o': No such file or directory
rm: cannot remove '*.lis': No such file or directory
rm: cannot remove '*.out': No such file or directory
compile driver.cpp using the g++ compiler standard 2017
compile isFloat.cpp using the g++ compiler standard 2017
Assemble compare.asm
Link object files using the gcc Linker standard 2017
Run the Float Program:
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 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 "x86_64-linux-gnu".
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 <RET> for more, q to quit, c to continue without paging--q
Quit
Script file has terminated.
回答

没有安装错误,GDB的版权信息是正常启动提示,不属于安装问题。

原因分析

  1. 你的运行脚本在“Run the Float Program”步骤中,调用了GDB来启动程序,而非直接运行编译后的可执行文件。比如脚本里用了gdb ./xxx.out这类命令,而非./xxx.out,所以GDB启动时会默认显示版权信息。
  2. 开头的rm错误只是脚本尝试清理旧的目标文件、列表文件和可执行文件但未找到,属于无关的警告,不影响程序编译和运行。

解决办法

  • 直接运行程序:修改脚本中的启动命令,把调用GDB的语句改成直接运行编译生成的.out文件。例如将gdb float_program.out改为./float_program.out,这样就不会触发GDB启动。
  • 保留GDB但关闭版权信息:如果确实需要用GDB调试,可在启动命令中添加-q(安静模式)参数,比如gdb -q ./float_program.out,这样GDB会跳过版权和欢迎信息,直接进入调试界面。

内容的提问来源于stack exchange,提问作者cheaseeds

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 10:57:36