From: asmwarrior <asmwarrior@gmail.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Cc: Tom Tromey <tromey@redhat.com>
Subject: Re: gdb with python support still get crash on showing uninitialized local variables
Date: Wed, 20 Oct 2010 05:33:00 -0000 [thread overview]
Message-ID: <4CBE7E37.5040303@gmail.com> (raw)
In-Reply-To: <4CBE7B08.9060905@gmail.com>
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 <wx/wx.h>
#include <string>
#include <map>
#include <list>
#include <stack>
#include <vector>
int main()
{
wxString wxStr(L"wxString");
wxStr += L" Value";
std::string stdStr("std::string");
stdStr.append(" value");
std::map<int, std::string> m;
m[0] = "000";
m[1] = "111";
wxString& wxStrRef = wxStr;
wxStrRef += L" Ref";
std::string& stdStrRef = stdStr;
stdStrRef += " Ref";
std::list<std::string> l = {"a", "b", "c"};
std::vector<std::string> v = {"a", "b", "c"};
std::stack<std::string> 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 = {<error reading
variable: Cannot access memory at address 0x90000cb6>,<error reading
variable: Cannot access memory at address 0x90909084>,<error reading
variable: Cannot access memory at address 0xe77d74>,<error reading
variable: Cannot access memory at address 0x458b0e68>,<error reading
variable: Cannot access memory at address 0x78b0ffcc>,<error reading
variable: Cannot access memory at address 0xe7fffff9>,<error reading
variable: Cannot access memory at address 0xfff91191>,<error reading
variable: Cannot access memory at address 0x909090b7>,<error reading
variable: Cannot access memory at address 0xffffff84>,<error reading
variable: Cannot access memory at address 0xf3>,<error reading
variable: Cannot access memory at address 0x96ff2ef4>,<error reading
variable: Cannot access memory at address 0x70>,<error reading
variable: Cannot access memory at address 0x96fed2f4>,<error reading
variable: Cannot access memory at address 0x96fee670>,<error reading
variable: Cannot access memory at address 0x6c745270>,<error reading
variable: Cannot access memory at address 0x657a6947>,<error reading
variable: Cannot access memory at address 0x7061653c>,<error reading
variable: Cannot access memory at address 0x6c7451f4>,<error reading
variable: Cannot access memory at address 0x657a6947>,<error reading
variable: Cannot access memory at address 0x7061653c>,<error reading
variable: Cannot access memory at address 0xcccccbf4>,<error reading
variable: Cannot access memory at address 0x90ccccc0>,<error reading
variable: Cannot access memory at address 0x90909084>,<error reading
variable: Cannot access memory at address 0x8868205e>,<error reading
variable: Cannot access memory at address 0xe87c96f4>,<error reading
variable: Cannot access memory at address 0xfff9e930>,<error reading
variable: Cannot access memory at address 0x8908757f>,<error reading
variable: Cannot access memory at address 0x45c6d869>,<error reading
variable: Cannot access memory at address 0x46f600db>,<error reading
variable: Cannot access memory at address 0xe740107>,<error reading
variable: Cannot access memory at address 0x560c75f3>,<error reading
variable: Cannot access memory at address 0xffaf99dc>,<error reading
variable: Cannot access memory at address 0xb6e9f3>,<error reading
variable: Cannot access memory at address 0xff32fff4>,<error reading
variable: Cannot access memory at address 0x89e07d7d>,<error reading
variable: Cannot access memory at address 0xdb33fc71>,<error reading
variable: Cannot access memory at address 0xfc5d8937>,<error reading
variable: Cannot access memory at address 0x9700a05c>,<error reading
variable: Cannot access memory at address 0x37e85670>,<error reading
variable: Cannot access memory at address 0x84fffa26>,<error reading
variable: Cannot access memory at address 0x890575b4>,<error reading
variable: Cannot access memory at address 0x3bebe071>,<error reading
variable: Cannot access memory at address 0xd10467f>,<error reading
variable: Cannot access memory at address 0xffffff4>,<error reading
variable: Cannot access memory at address 0x840c44fd>,<error reading
variable: Cannot access memory at address 0x11750c51>,<error reading
variable: Cannot access memory at address 0x578b6f3>,<error reading
variable: Cannot access memory at address 0x16e7fff4>,<error reading
variable: Cannot access memory at address 0x88fff904>,
"\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
next prev parent reply other threads:[~2010-10-20 5:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 2:16 asmwarrior
2010-10-14 18:30 ` André Pönitz
2010-10-15 3:55 ` asmwarrior
2010-10-15 22:38 ` Tom Tromey
2010-11-05 17:14 ` André Pönitz
2010-10-15 22:37 ` Tom Tromey
2010-10-16 1:14 ` asmwarrior
[not found] ` <m3fww2ued0.fsf_-_@fleche.redhat.com>
2010-10-20 5:19 ` asmwarrior
2010-10-20 5:33 ` asmwarrior [this message]
2010-10-22 19:13 ` Tom Tromey
2010-10-22 21:22 ` Eli Zaretskii
2010-10-29 19:18 ` Joel Brobecker
2010-10-29 22:01 ` Eli Zaretskii
2010-10-31 2:24 ` asmwarrior
2010-11-09 2:06 ` asmwarrior
2010-11-12 18:07 ` Tom Tromey
[not found] ` <4CE0C149.6090609@gmail.com>
2010-11-15 18:10 ` Tom Tromey
2010-12-14 2:13 ` asmwarrior
[not found] ` <4D06D1DB.1070501@gmail.com>
2010-12-14 15:00 ` Tom Tromey
2010-12-16 8:48 ` asmwarrior
[not found] ` <AANLkTinsJLTZT0ws=LbpYcq85_Z9_R=fcXz+J+kqScJU@mail.gmail.com>
2010-12-17 19:04 ` RFA: add python exception subclasses Tom Tromey
2010-12-18 2:26 ` asmwarrior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CBE7E37.5040303@gmail.com \
--to=asmwarrior@gmail.com \
--cc=gdb@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox