Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
vm_dump.c File Reference
`#include "ruby/ruby.h"`
`#include "addr2line.h"`
`#include "vm_core.h"`
`#include "internal.h"`
Include dependency graph for vm_dump.c:

Go to the source code of this file.

## Macros
#define | VMDEBUG 0
#define | MAX_POSBUF 128
#define | VM_CFP_CNT(th, cfp) ((rb_control_frame_t *)((th)->stack + (th)->stack_size) - (rb_control_frame_t *)(cfp))
#define | HAVE_BACKTRACE 0
#define | LIMITED_NAME_LENGTH(s) (((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len)

## 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 *ep)
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)
void | rb_vm_bugreport (void)

## Macro Definition Documentation

#define HAVE_BACKTRACE 0

Definition at line 428 of file vm_dump.c.

#define LIMITED_NAME_LENGTH | ( |  | s | ) | (((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len)

Referenced by rb_vm_bugreport().

#define MAX_POSBUF 128

Definition at line 22 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 24 of file vm_dump.c.

Referenced by rb_vmdebug_debug_print_pre().

#define VMDEBUG 0

Definition at line 19 of file vm_dump.c.

Referenced by rb_vm_make_proc(), vm_pop_frame(), and vm_push_frame().

## Function Documentation

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

Definition at line 28 of file vm_dump.c.

References rb_control_frame_struct::block_iseq, BUILTIN_TYPE, rb_method_entry_struct::def, rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, rb_iseq_location_struct::label, rb_iseq_struct::location, MAX_POSBUF, rb_control_frame_struct::me, rb_method_definition_struct::original_id, rb_iseq_location_struct::path, rb_control_frame_struct::pc, PRIdPTRDIFF, PRIxPTRDIFF, rb_id2name(), rb_inspect(), rb_vm_get_sourceline(), RSTRING_PTR, RUBY_VM_IFUNC_P, rb_control_frame_struct::self, snprintf, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, StringValueCStr, T_NODE, tmp, VM_FRAME_MAGIC_BLOCK, VM_FRAME_MAGIC_CFUNC, VM_FRAME_MAGIC_CLASS, VM_FRAME_MAGIC_EVAL, VM_FRAME_MAGIC_IFUNC, VM_FRAME_MAGIC_LAMBDA, VM_FRAME_MAGIC_METHOD, VM_FRAME_MAGIC_PROC, VM_FRAME_MAGIC_TOP, VM_FRAME_TYPE, and VM_FRAME_TYPE_FINISH_P.

Referenced by rb_vmdebug_stack_dump_raw().

void rb_vm_bugreport | ( | void |  | ) |

Definition at line 609 of file vm_dump.c.

References CLASS_OF, feof, free, GET_VM, i, len, LIMITED_NAME_LENGTH, rb_vm_struct::loaded_features, n, name, rb_vm_struct::progname, RARRAY_LEN, RARRAY_PTR(), rb_backtrace_print_as_bugreport(), rb_class2name(), RB_TYPE_P, RSTRING_PTR, SDR, and T_STRING.

Referenced by report_bug(), and sdr().

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

Definition at line 378 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 352 of file vm_dump.c.

References i, int, rb_iseq_struct::iseq, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_struct::pc, rb_iseq_disasm_insn(), rb_vmdebug_debug_print_register(), and VM_CFP_CNT.

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

Definition at line 323 of file vm_dump.c.

References rb_thread_struct::cfp, rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_struct::pc, PRIdPTRDIFF, RUBY_VM_NORMAL_ISEQ_P, rb_control_frame_struct::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 * | ep
| ) |  |

Definition at line 177 of file vm_dump.c.

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

Referenced by rb_vmdebug_proc_dump_raw().

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

Definition at line 203 of file vm_dump.c.

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

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

Definition at line 138 of file vm_dump.c.

References control_frame_dump(), rb_control_frame_struct::ep, GC_GUARDED_PTR_REF, p, PRIxVALUE, rb_control_frame_struct::sp, st, rb_thread_struct::stack, rb_thread_struct::stack_size, and t.

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 170 of file vm_dump.c.

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

void rb_vmdebug_stack_dump_th | ( | VALUE | thval | ) |

Definition at line 217 of file vm_dump.c.

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

void rb_vmdebug_thread_dump_regs | ( | VALUE | thval | ) |

Definition at line 344 of file vm_dump.c.

References GetThreadPtr, rb_vmdebug_debug_print_register(), and th.

VALUE rb_vmdebug_thread_dump_state | ( | VALUE | self | ) |

Definition at line 413 of file vm_dump.c.

References rb_thread_struct::cfp, rb_control_frame_struct::ep, GetThreadPtr, rb_control_frame_struct::pc, Qnil, rb_control_frame_struct::sp, and th.