Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
bc131350
Commit
bc131350
authored
Aug 29, 2013
by
take_cheeze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print singleton class name in verbose backtrace
parent
d12b6ab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
src/backtrace.c
src/backtrace.c
+11
-1
No files found.
src/backtrace.c
View file @
bc131350
...
...
@@ -9,6 +9,7 @@
#include "mruby/proc.h"
#include "mruby/array.h"
#include "mruby/string.h"
#include "mruby/class.h"
#include <stdarg.h>
typedef
void
(
*
output_stream_func
)(
mrb_state
*
,
void
*
,
int
,
const
char
*
,
...);
...
...
@@ -104,7 +105,16 @@ mrb_output_backtrace(mrb_state *mrb, struct RObject *exc, output_stream_func fun
method
=
mrb_sym2name
(
mrb
,
ci
->
proc
->
env
->
mid
);
}
if
(
method
)
{
const
char
*
cn
=
mrb_class_name
(
mrb
,
ci
->
proc
->
target_class
);
const
char
*
cn
=
NULL
;
if
(
verbose
&&
ci
->
proc
->
target_class
->
tt
==
MRB_TT_SCLASS
)
{
cn
=
RSTRING_PTR
(
mrb_str_cat_cstr
(
mrb
,
mrb_str_new_cstr
(
mrb
,
"(singleton class of)"
),
mrb_class_name
(
mrb
,
mrb_class_ptr
(
mrb_mod_cv_get
(
mrb
,
ci
->
proc
->
target_class
,
mrb_intern_cstr
(
mrb
,
"__attached__"
))))));
}
else
{
cn
=
mrb_class_name
(
mrb
,
ci
->
proc
->
target_class
);
}
if
(
cn
)
{
func
(
mrb
,
stream
,
1
,
"
\t
[%d] "
,
i
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment