当前位置: 技术问答>linux和unix
linux gdb: 我在一台机器上编译的程序用GDB可以调试,把程序放到另外一台机器上调试,调试信息就没有了 这是什么原因呢?
来源: 互联网 发布时间:2017-01-17
本文导语: 我在一台机器上编译的程序用GDB可以调试,把程序放到另外一台机器上调试,调试信息就没有了 这是什么原因呢? 可以调试: [root@eix bussiness]# gdb bussiness GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2) Copyright...
我在一台机器上编译的程序用GDB可以调试,把程序放到另外一台机器上调试,调试信息就没有了 这是什么原因呢?
可以调试:
[root@eix bussiness]# gdb bussiness
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2)
Copyright (C) 2009 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 "i386-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/bruce/oa-srv/project/bussiness/bussiness...done.
(gdb) l
118 // TRACE_EXCEPTION(pException);
119 SERVICE::instance ()->SetEvent();
120 // exit(0);
121
122 return EXCEPTION_EXECUTE_HANDLER;
123 }
124
125 #endif
126
127 int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
(gdb)
不可以调试:
[bill@localhost ~]$ gdb bussiness
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-32.el5_6.2)
Copyright (C) 2009 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 "i386-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/bill/bussiness...done.
(gdb) l
118 ../../com/service/ProcessSVR.cpp: 没有那个文件或目录.
in ../../com/service/ProcessSVR.cpp
(gdb)
可以调试:
[root@eix bussiness]# gdb bussiness
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2)
Copyright (C) 2009 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 "i386-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/bruce/oa-srv/project/bussiness/bussiness...done.
(gdb) l
118 // TRACE_EXCEPTION(pException);
119 SERVICE::instance ()->SetEvent();
120 // exit(0);
121
122 return EXCEPTION_EXECUTE_HANDLER;
123 }
124
125 #endif
126
127 int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
(gdb)
不可以调试:
[bill@localhost ~]$ gdb bussiness
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-32.el5_6.2)
Copyright (C) 2009 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 "i386-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/bill/bussiness...done.
(gdb) l
118 ../../com/service/ProcessSVR.cpp: 没有那个文件或目录.
in ../../com/service/ProcessSVR.cpp
(gdb)
|
118 ../../com/service/ProcessSVR.cpp: 没有那个文件或目录.
====
不是没有调试信息,是没有源代码。
====
不是没有调试信息,是没有源代码。
|
要是只要加-g就能看到源码,那别人还敢发布debug版本吗?。。。
|
|
必须有源码,调试时才能看到具体代码