This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb with python support still get crash on showing uninitialized local variables


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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]