summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-13 14:33:48 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-13 14:33:48 (GMT)
commit2a2cc2e9c41718b29843ddbab8addd95f0371a09 (patch)
tree1b3a910b6b24b0fb13c57aca9ce9363d2c7dccec /.gdbinit
parent36dcff1cf562d095a17fd6251407f37980c7f766 (diff)
* .gdbinit (iseq): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit29
1 files changed, 26 insertions, 3 deletions
diff --git a/.gdbinit b/.gdbinit
index 3ecc8f5..728e739 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,6 +1,3 @@
-if dummy_gdb_enums.special_consts
-end
-
define rp
if (VALUE)$arg0 & RUBY_FIXNUM_FLAG
printf "FIXNUM: %ld\n", $arg0 >> 1
@@ -558,3 +555,29 @@ end
define rb_backtrace
call rb_backtrace()
end
+
+define iseq
+ if $arg0->type == ISEQ_ELEMENT_NONE
+ echo [none]\n
+ end
+ if $arg0->type == ISEQ_ELEMENT_LABEL
+ print *(LABEL*)$arg0
+ end
+ if $arg0->type == ISEQ_ELEMENT_INSN
+ print *(INSN*)$arg0
+ if ((INSN*)$arg0)->insn_id != YARVINSN_jump
+ set $i = 0
+ set $operand_size = ((INSN*)$arg0)->operand_size
+ set $operands = ((INSN*)$arg0)->operands
+ while $i < $operand_size
+ rp $operands[$i++]
+ end
+ end
+ end
+ if $arg0->type == ISEQ_ELEMENT_ADJUST
+ print *(ADJUST*)$arg0
+ end
+end
+
+if dummy_gdb_enums.special_consts
+end