虾壳云 OpenClaw 多端安装包使用与环境配置干货(含安装包)
2026/6/16 12:31:13
在 Linux 编程里,调试是一项关键技能。以一个程序因段错误崩溃后的调试为例:
(gdb) file dbgtst A program is being debugged already. Kill it? (y or n) y Load new symbol table from “/home/naba/sw/dbgtst”? (y or n) y Reading symbols from /home/naba/sw/dbgtst...done. (gdb) list 1 #include <stdio.h> 2 static char buf[256]; 3 void read_input(char *s); 4 int main(void) 5 { 6 char *input = NULL; /* Just a pointer, no storage for string */ 7 read_input(input); 8 /* Process command. */ 9 printf(“You typed: %s\n”, input); 10 /* ... */ (gdb) break 7 Breakpoint 2 at 0x804842b: file dbgtst.c, line 7. (gdb) run Starting program: /home/naba/sw/dbgts