Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Typedefs | Enumerations | Functions
vm_backtrace.c File Reference
`#include "ruby/encoding.h"`
`#include "ruby/debug.h"`
`#include "internal.h"`
`#include "vm_core.h"`
`#include "eval_intern.h"`
`#include "iseq.h"`

Go to the source code of this file.

## Data Structures
struct | rb_backtrace_location_struct
struct | valued_frame_info
struct | rb_backtrace_struct
struct | bt_iter_arg
struct | oldbt_arg
struct | print_to_arg
struct | rb_debug_inspector_struct
struct | collect_caller_bindings_data

## Macros
#define | rb_id2str(id) id2str(id)

## Typedefs
typedef struct rb_backtrace_location_struct | rb_backtrace_location_t
typedef struct rb_backtrace_struct | rb_backtrace_t

## Enumerations
enum | { CALLER_BINDING_SELF, CALLER_BINDING_CLASS, CALLER_BINDING_BINDING, CALLER_BINDING_ISEQ, CALLER_BINDING_CFP }

## Functions
int | rb_vm_get_sourceline (const rb_control_frame_t *cfp)
int | rb_backtrace_p (VALUE obj)
MJIT_FUNC_EXPORTED VALUE | rb_ec_backtrace_object (const rb_execution_context_t *ec)
VALUE | rb_backtrace_to_str_ary (VALUE self)
MJIT_FUNC_EXPORTED void | rb_backtrace_use_iseq_first_lineno_for_last_location (VALUE self)
VALUE | rb_backtrace_to_location_ary (VALUE self)
VALUE | rb_ec_backtrace_str_ary (const rb_execution_context_t *ec, long lev, long n)
VALUE | rb_ec_backtrace_location_ary (const rb_execution_context_t *ec, long lev, long n)
void | rb_backtrace_print_as_bugreport (void)
void | rb_backtrace (void)
void | rb_backtrace_each (VALUE(*iter)(VALUE recv, VALUE str), VALUE output)
VALUE | rb_make_backtrace (void)
VALUE | rb_vm_thread_backtrace (int argc, const VALUE *argv, VALUE thval)
VALUE | rb_vm_thread_backtrace_locations (int argc, const VALUE *argv, VALUE thval)
void | Init_vm_backtrace (void)
VALUE | rb_debug_inspector_open (rb_debug_inspector_func_t func, void *data)
VALUE | rb_debug_inspector_frame_self_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_frame_class_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_frame_binding_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_frame_iseq_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_backtrace_locations (const rb_debug_inspector_t *dc)
int | rb_profile_frames (int start, int limit, VALUE *buff, int *lines)
VALUE | rb_profile_frame_path (VALUE frame)
VALUE | rb_profile_frame_absolute_path (VALUE frame)
VALUE | rb_profile_frame_label (VALUE frame)
VALUE | rb_profile_frame_base_label (VALUE frame)
VALUE | rb_profile_frame_first_lineno (VALUE frame)
VALUE | rb_profile_frame_classpath (VALUE frame)
VALUE | rb_profile_frame_singleton_method_p (VALUE frame)
VALUE | rb_profile_frame_method_name (VALUE frame)
VALUE | rb_profile_frame_qualified_method_name (VALUE frame)
VALUE | rb_profile_frame_full_label (VALUE frame)

## Macro Definition Documentation

## ◆ rb_id2str

#define rb_id2str | ( |  | id | ) | id2str(id)

Definition at line 30 of file vm_backtrace.c.

## Typedef Documentation

## ◆ rb_backtrace_location_t

typedef struct rb_backtrace_location_struct rb_backtrace_location_t

## ◆ rb_backtrace_t

typedef struct rb_backtrace_struct rb_backtrace_t

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
CALLER_BINDING_SELF |
CALLER_BINDING_CLASS |
CALLER_BINDING_BINDING |
CALLER_BINDING_ISEQ |
CALLER_BINDING_CFP |

Definition at line 1129 of file vm_backtrace.c.

## Function Documentation

## ◆ Init_vm_backtrace()

void Init_vm_backtrace | ( | void |  | ) |

Definition at line 1045 of file vm_backtrace.c.

## ◆ rb_backtrace()

void rb_backtrace | ( | void |  | ) |

Definition at line 829 of file vm_backtrace.c.

## ◆ rb_backtrace_each()

void rb_backtrace_each | ( | VALUE(*)(VALUE recv, VALUE str) | iter,
|  | VALUE | output
| ) |  |

Definition at line 855 of file vm_backtrace.c.

## ◆ rb_backtrace_p()

int rb_backtrace_p | ( | VALUE | obj | ) |

Definition at line 446 of file vm_backtrace.c.

References obj, and rb_typeddata_is_kind_of().

## ◆ rb_backtrace_print_as_bugreport()

void rb_backtrace_print_as_bugreport | ( | void |  | ) |

Definition at line 813 of file vm_backtrace.c.

References arg, and i.

Referenced by rb_vm_bugreport().

## ◆ rb_backtrace_to_location_ary()

VALUE rb_backtrace_to_location_ary | ( | VALUE | self | ) |

Definition at line 686 of file vm_backtrace.c.

References GetCoreDataFromValue, and rb_backtrace_struct::locary.

## ◆ rb_backtrace_to_str_ary()

VALUE rb_backtrace_to_str_ary | ( | VALUE | self | ) |

Definition at line 620 of file vm_backtrace.c.

References bt_iter_arg::bt, GetCoreDataFromValue, and rb_backtrace_struct::strary.

## ◆ rb_backtrace_use_iseq_first_lineno_for_last_location()

MJIT_FUNC_EXPORTED void rb_backtrace_use_iseq_first_lineno_for_last_location | ( | VALUE | self | ) |

Definition at line 632 of file vm_backtrace.c.

References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_size, rb_backtrace_location_struct::body, rb_iseq_struct::body, bt_iter_arg::bt, rb_iseq_location_struct::first_lineno, FIX2INT, GetCoreDataFromValue, rb_backtrace_location_struct::iseq, iseq, rb_iseq_constant_body::location, rb_backtrace_location_struct::type, and VM_ASSERT.

## ◆ rb_debug_inspector_backtrace_locations()

VALUE rb_debug_inspector_backtrace_locations | ( | const rb_debug_inspector_t * | dc | ) |

Definition at line 1302 of file vm_backtrace.c.

References rb_debug_inspector_struct::backtrace.

## ◆ rb_debug_inspector_frame_binding_get()

VALUE rb_debug_inspector_frame_binding_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1286 of file vm_backtrace.c.

## ◆ rb_debug_inspector_frame_class_get()

VALUE rb_debug_inspector_frame_class_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1279 of file vm_backtrace.c.

## ◆ rb_debug_inspector_frame_iseq_get()

VALUE rb_debug_inspector_frame_iseq_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1293 of file vm_backtrace.c.

## ◆ rb_debug_inspector_frame_self_get()

VALUE rb_debug_inspector_frame_self_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1272 of file vm_backtrace.c.

## ◆ rb_debug_inspector_open()

VALUE rb_debug_inspector_open | ( | rb_debug_inspector_func_t | func,
|  | void * | data
| ) |  |

Definition at line 1231 of file vm_backtrace.c.

References GET_EC, and MAYBE_UNUSED.

## ◆ rb_ec_backtrace_location_ary()

VALUE rb_ec_backtrace_location_ary | ( | const rb_execution_context_t * | ec,
|  | long | lev,
|  | long | n
| ) |  |

Definition at line 720 of file vm_backtrace.c.

## ◆ rb_ec_backtrace_object()

MJIT_FUNC_EXPORTED VALUE rb_ec_backtrace_object | ( | const rb_execution_context_t * | ec | ) |

Definition at line 557 of file vm_backtrace.c.

References arg.

## ◆ rb_ec_backtrace_str_ary()

VALUE rb_ec_backtrace_str_ary | ( | const rb_execution_context_t * | ec,
|  | long | lev,
|  | long | n
| ) |  |

Definition at line 714 of file vm_backtrace.c.

Referenced by rb_make_backtrace().

## ◆ rb_make_backtrace()

VALUE rb_make_backtrace | ( | void |  | ) |

Definition at line 872 of file vm_backtrace.c.

References GET_EC, and rb_ec_backtrace_str_ary().

## ◆ rb_profile_frame_absolute_path()

VALUE rb_profile_frame_absolute_path | ( | VALUE | frame | ) |

Definition at line 1375 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_base_label()

VALUE rb_profile_frame_base_label | ( | VALUE | frame | ) |

Definition at line 1389 of file vm_backtrace.c.

References iseq.

Referenced by rb_profile_frame_full_label().

## ◆ rb_profile_frame_classpath()

VALUE rb_profile_frame_classpath | ( | VALUE | frame | ) |

Definition at line 1418 of file vm_backtrace.c.

References klass.

## ◆ rb_profile_frame_first_lineno()

VALUE rb_profile_frame_first_lineno | ( | VALUE | frame | ) |

Definition at line 1396 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_full_label()

VALUE rb_profile_frame_full_label | ( | VALUE | frame | ) |

Definition at line 1481 of file vm_backtrace.c.

References NIL_P, PRIsVALUE, rb_long2int, rb_profile_frame_base_label(), rb_profile_frame_label(), rb_profile_frame_qualified_method_name(), rb_sprintf(), RSTRING_LEN, and RSTRING_PTR.

## ◆ rb_profile_frame_label()

VALUE rb_profile_frame_label | ( | VALUE | frame | ) |

Definition at line 1382 of file vm_backtrace.c.

References iseq.

Referenced by rb_profile_frame_full_label().

## ◆ rb_profile_frame_method_name()

VALUE rb_profile_frame_method_name | ( | VALUE | frame | ) |

Definition at line 1452 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_path()

VALUE rb_profile_frame_path | ( | VALUE | frame | ) |

Definition at line 1368 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_qualified_method_name()

VALUE rb_profile_frame_qualified_method_name | ( | VALUE | frame | ) |

Definition at line 1459 of file vm_backtrace.c.

Referenced by rb_profile_frame_full_label().

## ◆ rb_profile_frame_singleton_method_p()

VALUE rb_profile_frame_singleton_method_p | ( | VALUE | frame | ) |

Definition at line 1439 of file vm_backtrace.c.

References klass.

## ◆ rb_profile_frames()

int rb_profile_frames | ( | int | start,
|  | int | limit,
|  | VALUE * | buff,
|  | int * | lines
| ) |  |

Definition at line 1308 of file vm_backtrace.c.

References rb_execution_context_struct::cfp, cfp, GET_EC, and i.

## ◆ rb_vm_get_sourceline()

int rb_vm_get_sourceline | ( | const rb_control_frame_t * | cfp | ) |

Definition at line 68 of file vm_backtrace.c.

Referenced by rb_sourceline().

## ◆ rb_vm_thread_backtrace()

VALUE rb_vm_thread_backtrace | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | thval
| ) |  |

Definition at line 960 of file vm_backtrace.c.

## ◆ rb_vm_thread_backtrace_locations()

VALUE rb_vm_thread_backtrace_locations | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | thval
| ) |  |

Definition at line 966 of file vm_backtrace.c.