vm_dump.c File Reference
`#include "ruby/ruby.h"`
`#include "addr2line.h"`
`#include "vm_core.h"`

Go to the source code of this file.

## Macros

#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)

## Macro Definition Documentation

#define MAX_POSBUF 128

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

References rb_control_frame_t::block_iseq, bp, rb_control_frame_t::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 770 of file vm_dump.c.

References bugreport_backtrace(), feof, free(), GET_VM, i, rb_vm_struct::loaded_features, rb_vm_struct::progname, RARRAY_LEN, RARRAY_PTR, rb_backtrace_each(), SDR, and StringValueCStr.

Referenced by report_bug(), and sdr().

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

Definition at line 382 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 361 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 330 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 191 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 219 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 146 of file vm_dump.c.

References bp, rb_control_frame_t::bp, control_frame_dump(), rb_control_frame_t::dfp, GC_GUARDED_PTR_REF, rb_control_frame_t::lfp, p, 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 184 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 233 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 353 of file vm_dump.c.

References GetThreadPtr, and rb_vmdebug_debug_print_register().

VALUE rb_vmdebug_thread_dump_state | ( | VALUE | self | ) |

Definition at line 556 of file vm_dump.c.

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