从Macports(macOS)安装了gcc 8的gdb libstdc ++漂亮打印机中的错误 [英] Bug in gdb libstdc++ pretty-printers with gcc 8 installed from macports (macOS)

查看:102
本文介绍了从Macports(macOS)安装了gcc 8的gdb libstdc ++漂亮打印机中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 GDB Wiki 中的说明设置了gdb libstdc ++漂亮打印机.但是漂亮的打印不起作用,gdb继续打印原始数据.

I set up gdb libstdc++ pretty-printers as described in GDB Wiki. But pretty printing didn't work, gdb kept printing raw data.

我更改了 printers.py 进行了修复:

--- python/libstdcxx/v6/printers.py.old 2018-10-13 13:57:11.000000000 +0300
+++ python/libstdcxx/v6/printers.py 2018-10-13 14:35:55.000000000 +0300
@@ -1306,2 +1306,4 @@
     def add(self, name, function):
+        if (name.startswith('std::')):
+            self.add(name[5:], function)
         # A small sanity check.

此修补程序使打印机平等处理std :: xxx和xxx(例如std :: vector和vector).该修补程序有帮助!

The patch makes Printer handle std::xxx and xxx equally (e.g. std::vector and vector). The patch helped!

为什么有帮助?错误在哪里?通过macports使用的gdb 8.0.1,gcc 8.2.0.

Why did it help? Where is the bug? Used gdb 8.0.1, gcc 8.2.0 installed via macports.

推荐答案

这是OS X上的一个已知问题,但是我无法自行调试它,因为我没有使用OS X.

This is a known issue on OS X but I'm unable to debug it myself, as I don't use OS X.

问题似乎与GCC输出到OS X二进制文件的调试信息有关.在OS X上,调试信息中显示的类型与漂亮打印机所期望的类型不符.

The problem seems to be related to the debug info that GCC outputs into OS X binaries. On OS X the types shown in the debug info do not match what the pretty printers expect.

这篇关于从Macports(macOS)安装了gcc 8的gdb libstdc ++漂亮打印机中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆