开发者

I cannot set breakpoints nor see flow with ddd/gdb after upgrade to my os

开发者 https://www.devze.com 2023-03-03 23:01 出处:网络
I have just moved from Ubuntu 10.04 to the new version of 11.04 and when I try to debug with ddd/gdb I cannot set anymore breakpoints nor see the flow while the debugger is executing my program.

I have just moved from Ubuntu 10.04 to the new version of 11.04 and when I try to debug with ddd/gdb I cannot set anymore breakpoints nor see the flow while the debugger is executing my program.

I receive error messages saying

  (gdb)b MyFile.cpp:27
  No line 27 in file "MyFile.cpp".

When I start running my application calling r I also can see the following text message that looks to me related to my issue. The debuggers traps all assertions but I cannot stop at any point.

  (gdb) r
  BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278
  BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278

If I want to see the file, the debuggers open the file with me开发者_如何学C but I receive the following error message

 (gdb) list MyFile.cpp:27
 Line number 27 is out of range for "MyFile.cpp".

Can you help me? I read some forum asking to check the result of info source and info sources and this is what I have but I don't know what to do with it.

 (gdb) list MyFile.cpp:27
 Line number 27 is out of range for "MyFile.cpp".
 (gdb) info source
 Current source file is /usr/local/include/boost/exception/exception.hpp
 Compilation directory is /home/emanueler/trunk/tools/myAppBinary
 Located in /usr/local/include/boost/exception/exception.hpp
 Contains 436 lines.
 Source language is c++.
 Compiled with unknown debugging format.
 Includes preprocessor macro info.

Why it says "Compiled with unknown debugging format." when I am giving the -g option at compiler?


It seems all the compiling related tools were also updated, including GCC. It would be best if you recompile your entire application in this new environment before trying to debug it again.

You can do a simple test for check that your toolchain is ok. Write a small hello world app, compile it with -g and try to set a breakpoint on the cout line.

0

精彩评论

暂无评论...
验证码 换一张
取 消