编写代码#include int main(int argc, char **argv){ int i; int result = 0; if(1 >= argc) { printf(helloworld.n); } printf(hello world %s!n,argv[1]); for(i = 1; i <= 100; i++) { result += i; } printf(result = %dn, result ); return 0;}编译时加上 -g 参数:
gcc helloworld.c -o hellowrld -g启动调试$ gdb helloworldgnu gdb (gdb) red hat enterprise linux 8.2-12.el8copyright (c) 2018 free software foundation, inc.license gplv3+: gnu gpl version 3 or later 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-redhat-linux-gnu.type show configuration for configuration details.for bug reporting instructions, please see:.find the gdb manual and other documentation resources online at: .for help, type help.type apropos word to search for commands related to word...reading symbols from helloworld...done.(gdb) run < ----------------------------- 不带参数运行starting program: /home/zhuzhg/helloworldmissing separate debuginfos, use: yum debuginfo-install glibc-2.28-101.el8.x86_64helloworld.result = 5050[inferior 1 (process 1069013) exited normally](gdb) run china < ----------------------------- 带参数运行starting program: /home/zhuzhg/helloworld chinahello world china!result = 5050[inferior 1 (process 1071086) exited normally](gdb)
Vokenization是一种比GPT-3更智能的视觉语言模型
霍尼韦尔完成威尔明顿市由经济刺激法案支持的太阳能计划
通过风向风速仪可更好地研究风的变化
诺基亚3、诺基亚5两款入门手机台湾发布 价格亲民
智能巡检机器人开始上岗 保证电网更加安全可靠地运行
Linux系统中如何进行GDB调试
如何为Google翻译上的性别中性词提供女性化和男性化两种翻译结果的技术原理
PbSe量子点被用于制备高性能的光电探测器
安捷伦发表Agilent N6854A-AG1射频传感器网络定位软
高精地图在无人驾驶领域的作用,高精地图与普通导航地图的区别
黑芝麻智能携手经纬恒润打造全场景智能驾驶解决方案
oppo和vivo 3000元以下最值得推荐的手机
到2035年,北美LED照明所节省的能源可高达569万亿瓦时
核辐射辐射的是什么?如何防止核辐射?
PCB厂CAM工程师要注意哪些事项
湖南师范大学在DNA纳米传感器用于溶酶体酸化与钾离子流相关性研究取得新进展
沐曦进一步夯实算力基础设施安全底座能力
使用NVIDIA DALI加速医学图像处理
华为Mate40系列发布:支持90Hz高刷新率和240Hz触控采样率
电源线路滤波器电路,带屏蔽层的隔离变压器