Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Defines | Functions

# vm_dump.c File Reference

`#include "ruby/ruby.h"`
`#include "vm_core.h"`
Include dependency graph for vm_dump.c:

Go to the source code of this file.

## Defines
#define | MAX_POSBUF 128
#define | VM_CFP_CNT(th, cfp) ((rb_control_frame_t *)(th->stack + th->stack_size) - (rb_control_frame_t *)(cfp))
## Functions
static void | control_frame_dump (rb_thread_t *th, rb_control_frame_t *cfp)
void | rb_vmdebug_stack_dump_raw (rb_thread_t *th, rb_control_frame_t *cfp)
void | rb_vmdebug_stack_dump_raw_current (void)
void | rb_vmdebug_env_dump_raw (rb_env_t *env, VALUE *lfp, VALUE *dfp)
void | rb_vmdebug_proc_dump_raw (rb_proc_t *proc)
void | rb_vmdebug_stack_dump_th (VALUE thval)
void | rb_vmdebug_debug_print_register (rb_thread_t *th)
void | rb_vmdebug_thread_dump_regs (VALUE thval)
void | rb_vmdebug_debug_print_pre (rb_thread_t *th, rb_control_frame_t *cfp)
void | rb_vmdebug_debug_print_post (rb_thread_t *th, rb_control_frame_t *cfp)
VALUE | rb_vmdebug_thread_dump_state (VALUE self)
static int | bugreport_backtrace (void *arg, VALUE file, int line, VALUE method)
void | rb_vm_bugreport (void)

## Define Documentation

#define MAX_POSBUF 128

Definition at line 15 of file vm_dump.c.

Referenced by control_frame_dump().

#define VM_CFP_CNT | ( |  | th,
|  |  | cfp
| ) |  | ((rb_control_frame_t *)(th->stack + th->stack_size) - (rb_control_frame_t *)(cfp))

Definition at line 17 of file vm_dump.c.

Referenced by rb_vmdebug_debug_print_pre().

## Function Documentation

static int bugreport_backtrace | ( | void * | arg,
|  | VALUE | file,
|  | int | line,
|  | VALUE | method
| ) |  | `[static]`

Definition at line 569 of file vm_dump.c.

References NIL_P, and RSTRING_PTR.

Referenced by rb_vm_bugreport().

static void control_frame_dump | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  | `[static]`

Definition at line 21 of file vm_dump.c.

References rb_control_frame_t::block_iseq, rb_control_frame_t::bp, bp, BUILTIN_TYPE, rb_method_entry_struct::def, rb_control_frame_t::dfp, rb_iseq_struct::filename, rb_control_frame_t::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_t::lfp, MAX_POSBUF, rb_control_frame_t::me, rb_iseq_struct::name, rb_method_definition_struct::original_id, rb_control_frame_t::pc, PRIdPTRDIFF, PRIxPTRDIFF, rb_id2name(), rb_inspect(), rb_vm_get_sourceline(), RSTRING_PTR, RUBY_VM_IFUNC_P, rb_control_frame_t::self, snprintf, rb_control_frame_t::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, StringValueCStr, T_NODE, VM_FRAME_MAGIC_BLOCK, VM_FRAME_MAGIC_CFUNC, VM_FRAME_MAGIC_CLASS, VM_FRAME_MAGIC_EVAL, VM_FRAME_MAGIC_FINISH, VM_FRAME_MAGIC_IFUNC, VM_FRAME_MAGIC_LAMBDA, VM_FRAME_MAGIC_METHOD, VM_FRAME_MAGIC_PROC, VM_FRAME_MAGIC_TOP, and VM_FRAME_TYPE.

Referenced by rb_vmdebug_stack_dump_raw().

void rb_vm_bugreport | ( | void |  | ) |

Definition at line 590 of file vm_dump.c.

References bugreport_backtrace(), free, GET_THREAD, rb_backtrace_each(), and SDR.

Referenced by report_bug(), and sdr().

void rb_vmdebug_debug_print_post | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  |

Definition at line 380 of file vm_dump.c.

References rb_thread_struct::cfp, rb_inspect(), rb_vmdebug_debug_print_register(), SDR2, and StringValueCStr.

void rb_vmdebug_debug_print_pre | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  |

Definition at line 359 of file vm_dump.c.

References rb_iseq_struct::iseq, rb_control_frame_t::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_t::pc, PRIdPTRDIFF, rb_iseq_disasm_insn(), rb_vmdebug_debug_print_register(), VM_CFP_CNT, VM_FRAME_MAGIC_FINISH, and VM_FRAME_TYPE.

void rb_vmdebug_debug_print_register | ( | rb_thread_t * | th | ) |

Definition at line 328 of file vm_dump.c.

References rb_thread_struct::cfp, rb_control_frame_t::dfp, rb_control_frame_t::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_t::lfp, rb_control_frame_t::pc, PRIdPTRDIFF, RUBY_VM_NORMAL_ISEQ_P, rb_control_frame_t::sp, rb_thread_struct::stack, and rb_thread_struct::stack_size.

Referenced by rb_vmdebug_debug_print_post(), rb_vmdebug_debug_print_pre(), and rb_vmdebug_thread_dump_regs().

void rb_vmdebug_env_dump_raw | ( | rb_env_t * | env,
|  | VALUE * | lfp,
|  | VALUE * | dfp
| ) |  |

Definition at line 189 of file vm_dump.c.

References rb_env_t::env, rb_env_t::env_size, GetEnvPtr, rb_env_t::local_size, and rb_env_t::prev_envval.

Referenced by rb_vmdebug_proc_dump_raw().

void rb_vmdebug_proc_dump_raw | ( | rb_proc_t * | proc | ) |

Definition at line 217 of file vm_dump.c.

References rb_proc_t::block, rb_block_struct::dfp, env, rb_proc_t::envval, GetEnvPtr, rb_block_struct::lfp, rb_inspect(), rb_vmdebug_env_dump_raw(), rb_block_struct::self, and StringValueCStr.

void rb_vmdebug_stack_dump_raw | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  |

Definition at line 145 of file vm_dump.c.

References rb_control_frame_t::bp, bp, control_frame_dump(), rb_control_frame_t::dfp, GC_GUARDED_PTR_REF, rb_control_frame_t::lfp, PRIxVALUE, rb_control_frame_t::sp, rb_thread_struct::stack, and rb_thread_struct::stack_size.

Referenced by rb_vmdebug_stack_dump_raw_current(), and rb_vmdebug_stack_dump_th().

void rb_vmdebug_stack_dump_raw_current | ( | void |  | ) |

Definition at line 182 of file vm_dump.c.

References rb_thread_struct::cfp, GET_THREAD, and rb_vmdebug_stack_dump_raw().

void rb_vmdebug_stack_dump_th | ( | VALUE | thval | ) |

Definition at line 231 of file vm_dump.c.

References rb_thread_struct::cfp, GetThreadPtr, and rb_vmdebug_stack_dump_raw().

void rb_vmdebug_thread_dump_regs | ( | VALUE | thval | ) |

Definition at line 351 of file vm_dump.c.

References GetThreadPtr, and rb_vmdebug_debug_print_register().

VALUE rb_vmdebug_thread_dump_state | ( | VALUE | self | ) |

Definition at line 554 of file vm_dump.c.

References rb_thread_struct::cfp, GetThreadPtr, rb_control_frame_t::lfp, rb_control_frame_t::pc, Qnil, and rb_control_frame_t::sp.