aboutsummaryrefslogtreecommitdiffstats
path: root/.gdbinit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-25 06:05:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-25 06:05:51 +0000
commit9744ffed96caf35d5f1b10f96d58a36e249fae9d (patch)
tree346972046ee2bb7e752e4ac3abd637de094c3a8f /.gdbinit
parentd9acaf52f7c16ad7e1ec6c41b235c41e1410fbcc (diff)
downloadruby-9744ffed96caf35d5f1b10f96d58a36e249fae9d.tar.gz
.gdbinit: fix on empty strings [ci skip]
* .gdbinit (output_string): get rid of "Invalid number 0 of repetitions" error on empty strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit6
1 files changed, 5 insertions, 1 deletions
diff --git a/.gdbinit b/.gdbinit
index 06a616cf54..09013ab53c 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -446,9 +446,13 @@ define output_string
set $len = ($flags & RUBY_FL_USER1) ? \
((struct RString*)($arg0))->as.heap.len : \
(($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
- output *(char *)(($flags & RUBY_FL_USER1) ? \
+ if $len > 0
+ output *(char *)(($flags & RUBY_FL_USER1) ? \
((struct RString*)($arg0))->as.heap.ptr : \
((struct RString*)($arg0))->as.ary) @ $len
+ else
+ output ""
+ end
end
define rp_string