From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9660 invoked by alias); 20 Oct 2010 05:33:33 -0000 Received: (qmail 9652 invoked by uid 22791); 20 Oct 2010 05:33:30 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_CB,TW_XC,TW_XD,TW_XF,T_LOTS_OF_MONEY X-Spam-Check-By: sourceware.org Received: from mail-pv0-f169.google.com (HELO mail-pv0-f169.google.com) (74.125.83.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Oct 2010 05:33:22 +0000 Received: by pvf33 with SMTP id 33so866913pvf.0 for ; Tue, 19 Oct 2010 22:33:21 -0700 (PDT) Received: by 10.143.44.1 with SMTP id w1mr5453822wfj.447.1287552801002; Tue, 19 Oct 2010 22:33:21 -0700 (PDT) Received: from [172.16.152.159] ([60.12.143.22]) by mx.google.com with ESMTPS id p8sm26519623wff.4.2010.10.19.22.33.18 (version=SSLv3 cipher=RC4-MD5); Tue, 19 Oct 2010 22:33:20 -0700 (PDT) Message-ID: <4CBE7E37.5040303@gmail.com> Date: Wed, 20 Oct 2010 05:33:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: "gdb@sourceware.org" CC: Tom Tromey Subject: Re: gdb with python support still get crash on showing uninitialized local variables References: <4CB66700.3000907@gmail.com> <4CBE7B08.9060905@gmail.com> In-Reply-To: <4CBE7B08.9060905@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00072.txt.bz2 My test report: Thought my friend Loaden has some build error when he try to cross build the gdb.exe from linux, but finally he the gdb.exe has generated. ( the error my due some other module) (latest weekly 20202018 and with the patch: http://sourceware.org/ml/gdb-patches/2010-10/msg00301.html) I just test it with the same sample code: #include #include #include #include #include #include int main() { wxString wxStr(L"wxString"); wxStr += L" Value"; std::string stdStr("std::string"); stdStr.append(" value"); std::map m; m[0] = "000"; m[1] = "111"; wxString& wxStrRef = wxStr; wxStrRef += L" Ref"; std::string& stdStrRef = stdStr; stdStrRef += " Ref"; std::list l = {"a", "b", "c"}; std::vector v = {"a", "b", "c"}; std::stack s; s.push("a"); s.push("b"); return 0; } Set a breakpoint in the first line of main(), then the result gives below: Breakpoint 2, main () at F:\cb\test_code\gdbpython-demo\main.cpp:10 F:\cb\test_code\gdbpython-demo\main.cpp:10:126:beg:0x4013d3 >>>>>>cb_gdb: > set debugevents off >>>>>>cb_gdb: > bt 30 #0 main () at F:\cb\test_code\gdbpython-demo\main.cpp:10 >>>>>>cb_gdb: > p l Cannot access memory at address 0x50000069 $1 = std::list = { [0] = >>>>>>cb_gdb: > p s Cannot access memory at address 0x80 $2 = std::stack wrapping: std::deque with -521324573 elements = {>>>>>>cb_gdb: > p m $3 = std::map with 2009251885 elementsTraceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 353, in next n = self.rbiter.next() File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 297, in next if node.dereference()['_M_right']: gdb.error: Attempt to dereference a generic pointer. >>>>>>cb_gdb: > p wxStr $4 = UnicodeEncodeError: 'gbk' codec can't encode character u'\uffff' in position 0: illegal multibyte sequence >>>>>>cb_gdb: > p stdStr $5 = Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) OverflowError: long int too large to convert to int >>>>>>cb_gdb: it seems the only failing case is I try to print the vector p v $1 = std::vector of length -37952, capacity -519864265 = {,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "\000u\000r\000r\000e\000n\000t\000V\000e\000r\000s\000i\000o\000n\000 \\\000F\000o\000n\000t\000S\000u\000b\000s\000t\000i\000t\000u\000t \000e\000s\000\000\000悙媅SO\000\000悙癳0}\016f詺\000\000SV\350\n\000 \000 \000\351\f\210\377\377悙悙悑\377U嬱\203%\\>\020]\000V媢\b咑tU\213 ..... [a lot of raw memory dump and gdb crashed.] Compare with my original post http://sourceware.org/ml/gdb/2010-10/msg00045.html the only different is that when I print the vector in an old gdb (20101005 with out your patch), the result is : both stdStr, wxStr, m, works fine. but print vector let gdb crashed either. > p v $5 = std::vector of length -37952, capacity -519864265 = {Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) RuntimeError: Cannot access memory at address 0x90000cb6 , Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) RuntimeError: Cannot access memory at address 0x90909084 , Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) RuntimeError: Cannot access memory at address 0xe77d74 , Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) RuntimeError: Cannot access memory at address 0x458b0e68 , Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) RuntimeError: Cannot access memory at address 0x78b0ffcc , Traceback (most recent call last): File "D:\code\mingw451tdm\bin\libstdcxx\v6\printers.py", line 549, in to_string return self.val['_M_dataplus']['_M_p'].lazy_string (length = len) RuntimeError: Cannot access memory at address 0xe7fffff9 As a conclusion, this issue is still exist and not fixed. asmwarrior