gdb.rb
gdb.rb copied to clipboard
UnicodeDecodeError: 'utf8' codec can't decode byte
I'm trying to debug rails-application (running with webrick).
All works fine, but ruby objects strings
issues error:
(gdb) ruby objects strings
Traceback (most recent call last):
File "/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/gdb.rb-0.1.2/scripts/ruby-gdb.py", line 235, in invoke
self.print_strings()
File "/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/gdb.rb-0.1.2/scripts/ruby-gdb.py", line 288, in print_strings
strings[ ptr.string() ] += 1
File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data
Error occurred in Python command.
I pushed a hacky fix for this last night, http://github.com/tmm1/gdb.rb/commit/656573a57ad920a22681ff4877b9f1f0cebfe340, but am looking for a better way to actually fix it.