public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: asmwarrior <asmwarrior@gmail.com>
Cc: gdb@sourceware.org, Xun Xun <xunxun1982@gmail.com>
Subject: Re: gdb crash when I try to print a std::queue (Windows)
Date: Sun, 30 Oct 2011 18:17:00 -0000	[thread overview]
Message-ID: <4EAD56D4.5020709@gmail.com> (raw)
In-Reply-To: <4EAD4FE7.9050102@gmail.com>

On 2011-10-30 21:23, asmwarrior wrote:
> Is it possible just add a condition check like:
> 
> if(type_name==0)
>     return NULL;
> 
> 
I just test this code change by adding the above condition check, and this time, gdb does not crash, but no good information is show, it looks like:

(gdb) r
Starting program: e:\code\test_gdb\a1.exe
[New Thread 268.0x1098]

Program received signal SIGTRAP, Trace/breakpoint trap.
main () at e:\code\cb\test_code\gdbpython-demo\main.cpp:41
41          return 0;
(gdb) p q
$1 = {
  c = {<std::_Deque_base<std::basic_string<char, std::char_traits<char>, std::al
locator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >> = {
      _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>,
 std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data
 fields>}, _M_map = 0xb89e98, _M_map_size = 8, _M_start = "a", _M_finish =
    <error reading variable: Cannot access memory at address 0xbaadf001>}}, <No
data fields>}}
(gdb) python print 1
1
(gdb) p v
$2 = {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::al
locator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >> = {
    _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, s
td::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, st
d::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data f
ields>}, _M_start = 0xb89e70, _M_finish = 0xb89e7c,
      _M_end_of_storage = 0xb89e7c}}, <No data fields>}
(gdb) p a
No symbol "a" in current context.
(gdb) p stdStr
$3 = "std::string value Ref"
(gdb)

You can see, both the queue and the vector does not shown quite well. but std::string can still work well.


> --------------------------------------------------------------------
> BTW: if I build my test code under mingw gcc 4.6.2, then there's no crash here, and "p q" can correctly show the std::queue's contents from pretty printer.
> 
> BTW2: my friend xunxun can test the code under Win7, and it seems  there's no crash.

My friend xunxun is a gdb20111027 cvs version, and it has no crash under Win7.
I just use this gdb20111027 cvs on my WinXP, and it works quite well.

So, the conclusion should be:
This bug is introduced after 20111027, so it is nearly the last week. I hope the developers can find the regression introduced the last week. I'm not familiar with the gdb's source code, but I would like to test for you.

Thanks.
asmwarrior
ollydbg from codeblocks' forum

  reply	other threads:[~2011-10-30 13:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-30 13:30 asmwarrior
2011-10-30 18:17 ` asmwarrior [this message]
2011-10-31  8:50   ` 陳韋任
2011-10-31  8:52     ` asmwarrior
2011-10-31  9:42     ` xunxun
2011-11-01  1:46       ` 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=4EAD56D4.5020709@gmail.com \
    --to=asmwarrior@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=xunxun1982@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).