This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/11407] -stack-list-locals should catch python exceptions and return the error per variable
- From: "asmwarrior at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 19 Jun 2010 08:40:43 -0000
- Subject: [Bug python/11407] -stack-list-locals should catch python exceptions and return the error per variable
- References: <20100320163108.11407.niko.sams@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From asmwarrior at gmail dot com 2010-06-19 08:40 -------
(In reply to comment #23)
> With the test-case posted here it works. If you can post me a test-case I will
> check against my build.
Hi,here is the test code:
#include <string>
#include <map>
#include <list>
#include <stack>
#include <vector>
void test()
{
std::string stdStr("std::string");
stdStr.append(" value");
std::map<int, std::string> m;
m[0] = "000";
m[1] = "111";
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");
}
int main()
{
test();
return 0;
}
In my system(WindowsXP, gdb build from MinGW 4.4.4, python pretty printer enabled)
When I set a breakpoint before" std::string stdStr("std::string");", then
entered the gdb command "info locals", then gdb crashed.
Here is the log:
Breakpoint 2, test () at E:\code\cb\codeblocks_test_code\gdbpython-demo\main.cpp:11
E:\code\cb\codeblocks_test_code\gdbpython-demo\main.cpp:11:111:beg:0x4013dc
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> info locals
stdStr =
m = std::map with 4063232 elements<error applying pretty-printer>{
_M_t = {
_M_impl = {
<std::allocator<std::_Rb_tree_node<std::pair<int const,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >> = {
<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >> =
{<No data fields>}, <No data fields>},
members of std::_Rb_tree<int, std::pair<int const, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<int
const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>, std::less<int>, std::allocator<std::pair<int const, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >
>::_Rb_tree_impl<std::less<int>, false>:
_M_key_compare = {
<std::binary_function<int, int, bool>> = {<No data fields>}, <No data
fields>},
_M_header = {
_M_color = 4072408,
_M_parent = 0x40a050,
_M_left = 0x22fef0,
_M_right = 0x77c2c024
},
_M_node_count = 4063232
}
}
}
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
>
> I do not believe GDB can tell what is initialized and what is not. That might
> be another bug to file. But in the case here, GDB was missing exceptions
> generated and we catch them and deal with them in the pretty-printer case.
>
> It is beginning to sound like we have two bugs here.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11407
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.