python pretty print gdb script error on map
Sat Jun 19 02:40:00 GMT 2010
On 2010-6-18 16:29, Jonathan Wakely wrote:
> On 18 June 2010 09:01, asmwarrior wrote:
>> Hi, all. I have found that the python pretty print script failed to print
>> the map values. Here is the sample code:
>> Here is the gdb log: (I'm using TDM-MinGW 4.5, gdb cvs 0613 selfbuild with
>> python support, python 2.6.5 Windows XP)
>> I use the py script followed from this wiki
> Does MinGW not come with the libstdc++ printers.py script?
Thanks for the reply. Now, MinGW doesn't contains any libstdc++ python
scirpts. The one I used was checked out from the GCC svn trunk.
> It is
> included in GCC 4.5 and might be a more recent version than on the GDB
> Your program displays fine for me with GCC 4.6 and GDB 7.1
I have a MinGW version of GCC 4.4.4 and GCC 4.5. The stdlibc++ python
scirpts (show the map content) works fine with MinGW 4.4.4. and Failed
with MinGW 4.5, so, I guess the internal implementation of GCC has
changed between versions.
>> By the way, I have found when I used python pretty printer to show the local
>> variables, there are some problems. Sometimes, gdb command "info local"
>> shows some variables that are not initialized, then gdb will get crashed,
>> because python script will resolve the wrong address when a variable is not
>> initialized. Is there any way to solve this.
> That's a GDB issue, there's nothing GCC can do about that.
About this question. I personally think that there are some "debug
informations stored in the debugee", the that the gdb can understand
which local variables are initialized or not. Consider the bug report in
The latest poster has a patch to deal with the python errors, but this
is not a perfect way I think.
I also post some replies there, I just thought the "variable initialized
list" should works as C++ exception, but it seems GDB has no way to know
that debug information. So, it is possible to let GCC adding these
mechanisms? Sorry if my idea is wrong, and please correct me.
asmwarrior ollydbg from codeblocks' forum
More information about the Libstdc++