当前位置: 技术问答>linux和unix
请教gdb调试问题
来源: 互联网 发布时间:2017-02-17
本文导语: [root@localhost code4]# gdb replace6 GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. ...
[root@localhost code4]# gdb replace6
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 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 "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/wangdu/code4/replace6...done.
(gdb) l
9 { int fd1,fd2;
10 char *filename1;
11 char *filename2;
12 char *src, *dest;
13 char *content;
14 char *p;
15 char *tmp;
16 struct stat st;
17 int size;
18 if(argc != 5)
(gdb)
19 {
20 printf("%1 filename source_string dest_stringn", argv[0]);
21 return 0;
22 }
23 filename1 = argv[1];
24 filename2=argv[2];
25 src = argv[3];
26 dest = argv[4];
27 fd1 = open(filename1, O_RDONLY);
28 if(fd1
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 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 "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/wangdu/code4/replace6...done.
(gdb) l
9 { int fd1,fd2;
10 char *filename1;
11 char *filename2;
12 char *src, *dest;
13 char *content;
14 char *p;
15 char *tmp;
16 struct stat st;
17 int size;
18 if(argc != 5)
(gdb)
19 {
20 printf("%1 filename source_string dest_stringn", argv[0]);
21 return 0;
22 }
23 filename1 = argv[1];
24 filename2=argv[2];
25 src = argv[3];
26 dest = argv[4];
27 fd1 = open(filename1, O_RDONLY);
28 if(fd1