【译】RMS's gdb Debugger Tutorial —— Example Debugging Sessions

Unknown – “Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.”

例子

Infinite Loop Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <ctype.h>

int main(int argc, char **argv) {
char c;

c = fgetc(stdin);
while (c != EOF) {
if (isalnum(c))
printf("%c", c);
else
c = fgetc(stdin);
}

return 1;
}
阅读更多