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
commit4f1a54d2d7dab455856dd9a64b4ce5659bae8812 (patch)
tree346972046ee2bb7e752e4ac3abd637de094c3a8f /.gdbinit
parent0da52e5626124e70501a1c3f1a27e7fee1e242f5 (diff)
downloadruby-4f1a54d2d7dab455856dd9a64b4ce5659bae8812.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