2010-09-15 12 views
5

मैं किसी और के क्यूटी कार्यक्रम डिबगिंग रहा हूँ और निम्न त्रुटि संदेश में भाग जो मुझे समझ नहीं आता:gdb त्रुटि संदेश: DW_OP_reg, DW_OP_piece, और DW_OP_bit_piece

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. 

मुझे यकीन है कि क्या है कि इसका मतलब है नहीं कर रहा हूँ और Google बहुत मदद नहीं है।

यहां संदर्भ है - sLocation एक QString है जिसे पहले कुछ पंक्तियों की घोषणा की गई थी। हालांकि, यह कार्य करता है जो inlined गया से बनाया गया था, इसलिए मैं अपने मूल्य का यकीन नहीं है और के साथ जोड़ दिया किए जाने से पहले की जांच करने के लिए प्रयास कर रहा हूँ:

(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.)> 

किसी कृपया समझा सकते हैं क्या है कि त्रुटि संदेश का अर्थ है या क्या कारण हो सकता है यह?

उत्तर

4

त्रुटि संदेश का अर्थ है कि GDB निष्पादन से DWARF2 डिबग जानकारी पढ़ रही है, और है कि जानकारी के रूप में अमान्य (DWARF2 मानक का पालन नहीं) को खारिज कर रहा है।

अमान्य जानकारी जीसीसी में एक बग, SVN संशोधन 147,187 में तय की वजह से होने की संभावना है:

2009-05-06 Jakub Jelinek <[email protected]> 

    * 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*. 
+1

आईआरसी मैं पर किसी की मदद के साथ अपमानजनक प्रविष्टि की पहचान करने के लिए 'readelf -wi/path/to/debug/lib' का उपयोग करने में सक्षम था:' 2 बाइट ब्लॉक: 53 6 (DW_OP_reg3; DW_OP_deref)। हालांकि, मैं gcc-4.4.4 का उपयोग कर रहा हूं टैग r158895 में ged, तो मुझे लगता है कि यह एक नया या संबंधित बग हो सकता है। –

+0

मुझे 'जीएनयू जीडीबी (जीडीबी) 7.4.1-डेबियन 'पर' gcc संस्करण 4.7.2 (डेबियन 4.7.2-5) 'के साथ एक ही त्रुटि दिखाई देती है। – HAL

1

मैं एक उबंटू 10.10 64 बिट चल ही समस्या मिला है। हालांकि, 10.04 एलटीएस 32 बिट पर एक ही कोड पूरी तरह से काम करता है।

यहाँ दोनों सेटअप के संस्करण उत्पादन होता है उबंटू 10.10:

$ gcc -v 
Using built-in specs. 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) 

10,04 LTS पर जीसीसी:

$ gcc -v 
Using built-in specs. 
Target: i486-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu 
Thread model: posix 
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5 

चीयर्स, आंद्रे