gdb错误消息:DW_OP_reg,DW_OP_piece和DW_OP_bit_piece [英] gdb error message: DW_OP_reg, DW_OP_piece, and DW_OP_bit_piece

查看:1058
本文介绍了gdb错误消息:DW_OP_reg,DW_OP_piece和DW_OP_bit_piece的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试别人的Qt程序,并遇到以下错误消息,我不明白:

I'm debugging somebody else's Qt program and ran into the following error message which I don't understand:

DWARF-2 expression error: DW_OP_reg operations must be used either alone or in
conjuction with DW_OP_piece or DW_OP_bit_piece.

我不确定这是什么意思,谷歌没有太多帮助。

I'm not sure what that means and Google isn't of much help.

这里是上下文 - sLocation 是一个 QString 行。但是,它是从内联函数创建的,所以我不确定它的价值,并尝试检查之前附加:

Here's the context - sLocation is a QString that was declared a few lines earlier. However, it was created from functions which were inlined, so I'm not sure of its value and am attempting to check before being appended to:

(gdb) printqstring suffix
(QString)0xffffbd80: "sorted"
(gdb) next
1241        sLocation += suffix;
(gdb) printqstring sLocation
Can't take address of "sLocation" which isn't an lvalue.
(gdb) info local
sLocation = <error reading variable sLocation (DWARF-2 expression error:
    DW_OP_reg operations must be used either alone or in conjuction with
    DW_OP_piece or DW_OP_bit_piece.)>

有人可以解释一下错误信息是什么意思或什么原因导致的?

Could somebody please explain what that error message means or what could cause it?

推荐答案

错误消息表示 GDB 正在读取 DWARF2 从可执行文件调试信息,并拒绝该信息作为无效(不遵循 DWARF2 标准)。

The error message means that GDB is reading DWARF2 debug info from the executable, and is rejecting that info as invalid (not following the DWARF2 standard).

无效信息很可能是由于GCC中的错误,在SVN修订147187中修复:

The invalid info is likely due to a bug in GCC, fixed in SVN revision 147187:

2009-05-06  Jakub Jelinek  <jakub@redhat.com>

    * dwarf2out.c (new_reg_loc_descr): Don't ever create DW_OP_regX.
    (one_reg_loc_descriptor): Create DW_OP_regX here instead of calling
    new_reg_loc_descr.
    (loc_by_reference): If loc is DW_OP_regX, change it into DW_OP_bregX 0
    instead of appending DW_OP_deref*.

这篇关于gdb错误消息:DW_OP_reg,DW_OP_piece和DW_OP_bit_piece的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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