gdb breaking down at printing variable

Vikas Mishra
Thu Aug 26 15:21:00 GMT 2010


On Thu, Aug 26, 2010 at 8:47 PM, Vikas Mishra <> wrote:
> On Thursday 26 August 2010 13:41:29 ext Vikas Mishra wrote:
>> Hello Folks,
>> I am new to C++ but have used gdb in the past. I am using the python
>> pretty print extensions to the GDB to print STL containers. I wanted
>> to check with the mailing list about an issue that I was seeing
>> recently.  I am seeing the issue both on Cygwin as well as in Linux.
>> Problem : Unable to print a vector during debugging.
>> How to reproduce it : I have attached a program which has two
>> functions - main and split, It is a very simple program that takes a
>> string and splits it into words (like Perl's split function). I am not
>> able to print the variable "ret" anywhere in the "split" function.
> This is most likely
> i.e. not gdb's fault.

Thanks a lot for pointing this out. The error of course disappeared if
I did a temporary hack and replaced the return with an assignment and
return. This is good enough for me at the moment.


More information about the Gdb mailing list