小编Muc*_*arn的帖子

GCC 4.8在编译单元头中插入版本4,即使使用-gdwarf-2也是如此

我用GCC 4.8编译了一个应用程序,我试图在一个没有GDB 7.5+的旧系统上调试它(据说它增加了对DWARF-4的支持).在该系统上升级GDB不是一种选择.我无法调试它,因为GDB输出以下消息:

Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module a.out]
Run Code Online (Sandbox Code Playgroud)

我尝试使用-gdwarf-2 -gstrict-dwarf进行编译,如其他问题所示,但编译器会继续插入一些版本4的编译单元头:

/tmp> readelf --debug-dump=info a.out | grep -A2 'Compilation Unit @'
readelf: Warning: CU at offset 6b contains corrupt or unsupported version number: 4.
readelf: Warning: CU at offset 1eb contains corrupt or unsupported version number: 4.
  Compilation Unit @ offset 0x0:
   Length:        0x67 (32-bit)
   Version:       2
--
  Compilation Unit @ offset 0x6b:
   Length:        0x84 (32-bit)
   Version:       4
--
  Compilation …
Run Code Online (Sandbox Code Playgroud)

c gcc elf dwarf

9
推荐指数
1
解决办法
617
查看次数

为什么要避免嵌套QEventLoops?

在他的Qt事件循环,网络和I/O API谈话中,Thiago Macieira提到QEventLoop应该避免嵌套:

QEventLoop用于嵌套事件循环...如果可以的话,请避免使用它,因为它会产生许多问题:事情可能会重新进入,新的套接字或定时器激活是你没想到的.

任何人都可以扩展他指的是什么吗?我维护了许多使用模态对话框的代码,这些代码在exec()调用时在内部嵌套一个新的事件循环,因此我非常有兴趣知道这可能导致什么样的问题.

qt

8
推荐指数
1
解决办法
1013
查看次数

标签 统计

c ×1

dwarf ×1

elf ×1

gcc ×1

qt ×1