gdb调试的问题
时间:2010-08-04
来源:互联网
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
(gdb) l
warning: Source file is more recent than executable.
11 * Foundation. See file COPYING.
12 *
13 */
14
15 #include "libceph.h"
16 #include <iostream>
17 using namespace std;
18
19 int main(int argc, const char **argv)
20 {
(gdb)
21 if (ceph_initialize(argc, argv) < 0) {
22 cerr << "error initializing\n" << std::endl;
23 return(1);
24 }
25 cout << "Successfully initialized Ceph!" << std::endl;
26
27 if(ceph_mount() < 0) {
28 cerr << "error mounting\n" << std::endl;
29 return(1);
30 }
(gdb)
31 cout << "Successfully mounted Ceph!" << std::endl;
32
33 //test readdir
34 DIR * dirpp;
35 struct dirent *de=new struct dirent;
36 int a=ceph_opendir("/",&dirpp);
37 if (a<0){
38 cerr<<"error!can not open dir\n";
39 return 1;
40 }
(gdb)
41 else {
42 cout<<"find the dir\n";
43 a=ceph_readdir_r(dirpp,de);
44 if(a==1)
45 cout<<"we got a dirent!\n";
46 else if(a==0)
47 cout<<"for the end of direntory\n";
48 else
49 cout<<"on error!\n";
50 delete de;
(gdb)
51 }
52
53 //chdir func & getcwd func
54 a=ceph_chdir("/");
55 if(a>0)
56 cout<<"chdir done!\n";
57 else{
58 cout<<"failed in chdir!\n";
59 return 1;
60 }
(gdb)
61
62 char buf[50];
63 a=ceph_getcwd(buf,sizeof(buf));
64 if(a==0)
65 cout<<"get cwd \n";
66
67 ceph_deinitialize();
68 cout << "Successfully deinitialized Ceph!" << std::endl;
69
70 return 0;
(gdb)
71 }
(gdb) b 54
No line 54 in file "client/testceph.cc".//这里的问题谁能告诉我啊?
都已经列出了71行了,怎么就没有54行呢?
急
Copyright (C) 2008 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 "i486-linux-gnu"...
(gdb) l
warning: Source file is more recent than executable.
11 * Foundation. See file COPYING.
12 *
13 */
14
15 #include "libceph.h"
16 #include <iostream>
17 using namespace std;
18
19 int main(int argc, const char **argv)
20 {
(gdb)
21 if (ceph_initialize(argc, argv) < 0) {
22 cerr << "error initializing\n" << std::endl;
23 return(1);
24 }
25 cout << "Successfully initialized Ceph!" << std::endl;
26
27 if(ceph_mount() < 0) {
28 cerr << "error mounting\n" << std::endl;
29 return(1);
30 }
(gdb)
31 cout << "Successfully mounted Ceph!" << std::endl;
32
33 //test readdir
34 DIR * dirpp;
35 struct dirent *de=new struct dirent;
36 int a=ceph_opendir("/",&dirpp);
37 if (a<0){
38 cerr<<"error!can not open dir\n";
39 return 1;
40 }
(gdb)
41 else {
42 cout<<"find the dir\n";
43 a=ceph_readdir_r(dirpp,de);
44 if(a==1)
45 cout<<"we got a dirent!\n";
46 else if(a==0)
47 cout<<"for the end of direntory\n";
48 else
49 cout<<"on error!\n";
50 delete de;
(gdb)
51 }
52
53 //chdir func & getcwd func
54 a=ceph_chdir("/");
55 if(a>0)
56 cout<<"chdir done!\n";
57 else{
58 cout<<"failed in chdir!\n";
59 return 1;
60 }
(gdb)
61
62 char buf[50];
63 a=ceph_getcwd(buf,sizeof(buf));
64 if(a==0)
65 cout<<"get cwd \n";
66
67 ceph_deinitialize();
68 cout << "Successfully deinitialized Ceph!" << std::endl;
69
70 return 0;
(gdb)
71 }
(gdb) b 54
No line 54 in file "client/testceph.cc".//这里的问题谁能告诉我啊?
都已经列出了71行了,怎么就没有54行呢?
急
作者: hjwsm1989 发布时间: 2010-08-04
另外我检查了一下我的
Uid: ( 1031/ UNKNOWN) Gid: ( 1031/ UNKNOWN)
是不是这个不对啊?我是以根用户进入的
Uid: ( 1031/ UNKNOWN) Gid: ( 1031/ UNKNOWN)
是不是这个不对啊?我是以根用户进入的
作者: hjwsm1989 发布时间: 2010-08-04
好了,是gdb要调试的*.0文件,我没有进入这个目录下面,进了就好了……
作者: hjwsm1989 发布时间: 2010-08-04
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28