backtracie 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c21fb6f1864cd78c05807151502cbd12e3dfb8a1d5517d05389e2ac29297a69b
|
4
|
+
data.tar.gz: 126edf9c0e78607a9a6029f08e8a1ae0e4d1a02496ac56a0f67aae349f65ca05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbda4c7a47305e4896ff0d39da7f5cf997f766f55e66ea5db0c7c50b2506bb103397f01f58fb2ee3f9b0ea89a975f6d1fdf5b9db91b934cca0c66e51adf96265
|
7
|
+
data.tar.gz: af7c5c55fa5339a60a10a49f69aac02ad35b5e99a14e1de33e7988178e976f382e2c8c9260924741d218c44b030058bbf07264d5a9fd1612195752b56264d21a
|
@@ -582,7 +582,7 @@ static void mod_to_s_singleton(VALUE klass, strbuilder_t *strout) {
|
|
582
582
|
if (singleton_of == rb_cModule || singleton_of == rb_cClass) {
|
583
583
|
// The first case. Use the id_attached symbol to get what this is the
|
584
584
|
// singleton_class _of_.
|
585
|
-
|
585
|
+
singleton_of = rb_ivar_get(klass, id__attached__);
|
586
586
|
}
|
587
587
|
mod_to_s(singleton_of, strout);
|
588
588
|
}
|
@@ -609,9 +609,17 @@ static void mod_to_s(VALUE klass, strbuilder_t *strout) {
|
|
609
609
|
|
610
610
|
VALUE klass_name = rb_mod_name(klass);
|
611
611
|
if (!RTEST(rb_mod_name(klass))) {
|
612
|
-
|
613
|
-
|
614
|
-
|
612
|
+
// If I understood it correctly, a T_ICLASS represents the inclusion of a module into
|
613
|
+
// a class. In this situation, we usually want to use the module name instead.
|
614
|
+
if (RB_TYPE_P(klass, T_ICLASS)) {
|
615
|
+
VALUE included_module = RBASIC(klass)->klass;
|
616
|
+
mod_to_s(included_module, strout);
|
617
|
+
return;
|
618
|
+
} else {
|
619
|
+
mod_to_s_anon(klass, strout);
|
620
|
+
strbuilder_append(strout, "$anonymous");
|
621
|
+
return;
|
622
|
+
}
|
615
623
|
}
|
616
624
|
|
617
625
|
// Non-anonymous module/class.
|
@@ -673,6 +681,9 @@ static void minimal_location_method_qualifier(const minimal_location_t *loc,
|
|
673
681
|
case BACKTRACIE_METHOD_QUALIFIER_CONTENTS_CME_CLASS:
|
674
682
|
method_target = loc->method_qualifier.cme_defined_class;
|
675
683
|
break;
|
684
|
+
default:
|
685
|
+
strbuilder_append(strout, "FIXME_SHOULD_NEVER_HAPPEN");
|
686
|
+
return;
|
676
687
|
}
|
677
688
|
|
678
689
|
mod_to_s(method_target, strout);
|
@@ -20,60 +20,60 @@
|
|
20
20
|
|
21
21
|
if %w[jruby truffleruby].include?(RUBY_ENGINE)
|
22
22
|
raise \
|
23
|
-
"\n#{
|
23
|
+
"\n#{"-" * 80}\nSorry! This gem is unsupported on #{RUBY_ENGINE}. Since it relies on a lot of guts of MRI Ruby, " \
|
24
24
|
"it's impossible to make a direct port.\n" \
|
25
|
-
"Perhaps a #{RUBY_ENGINE} equivalent could be created -- help is welcome! :)\n#{
|
25
|
+
"Perhaps a #{RUBY_ENGINE} equivalent could be created -- help is welcome! :)\n#{"-" * 80}"
|
26
26
|
end
|
27
27
|
|
28
|
-
require
|
28
|
+
require "mkmf"
|
29
29
|
|
30
30
|
# This warning gets really annoying when we include the Ruby mjit header file,
|
31
31
|
# let's omit it
|
32
|
-
$CFLAGS <<
|
32
|
+
$CFLAGS << " " << "-Wno-unused-function"
|
33
33
|
|
34
34
|
# Really dislike the "define everything at the beginning of the function" thing, sorry!
|
35
|
-
$CFLAGS <<
|
35
|
+
$CFLAGS << " " << "-Wno-declaration-after-statement"
|
36
36
|
|
37
37
|
# If we forget to include a Ruby header, the function call may still appear to work, but then
|
38
38
|
# cause a segfault later. Let's ensure that never happens.
|
39
|
-
$CFLAGS <<
|
39
|
+
$CFLAGS << " " << "-Werror-implicit-function-declaration"
|
40
40
|
|
41
41
|
# Enable us to use """modern""" C. Note that Ruby requires GNU extensions; specifically,
|
42
42
|
# NSIG is expected to be defined in signal.h.
|
43
|
-
$CFLAGS <<
|
43
|
+
$CFLAGS << " " << "-std=gnu99" if RUBY_VERSION < "2.4"
|
44
44
|
|
45
|
-
$CFLAGS <<
|
45
|
+
$CFLAGS << " " << "-DPRE_RB_ISEQ_TYPE" if RUBY_VERSION < "3.2"
|
46
46
|
|
47
|
-
$CFLAGS <<
|
47
|
+
$CFLAGS << " " << "-DPRE_GC_MARK_MOVABLE" if RUBY_VERSION < "2.7"
|
48
48
|
|
49
49
|
# Older Rubies don't have the MJIT header, see below for details
|
50
|
-
$defs <<
|
50
|
+
$defs << "-DPRE_MJIT_RUBY" if RUBY_VERSION < "2.6"
|
51
51
|
|
52
|
-
if RUBY_VERSION <
|
53
|
-
$CFLAGS <<
|
54
|
-
$CFLAGS <<
|
55
|
-
$CFLAGS <<
|
52
|
+
if RUBY_VERSION < "2.5"
|
53
|
+
$CFLAGS << " " << "-DPRE_EXECUTION_CONTEXT" # Flag that there's no execution context, we need to use threads instead
|
54
|
+
$CFLAGS << " " << "-DPRE_LOCATION_PATHOBJ"
|
55
|
+
$CFLAGS << " " << "-Wno-attributes" # Silence a few warnings that we can't do anything about
|
56
56
|
end
|
57
57
|
|
58
|
-
if RUBY_VERSION <
|
59
|
-
$CFLAGS <<
|
58
|
+
if RUBY_VERSION < "2.4"
|
59
|
+
$CFLAGS << " " << "-DPRE_VM_ENV_RENAMES" # Flag that it's a really old Ruby, and a few constants were since renamed
|
60
60
|
end
|
61
61
|
|
62
|
-
$CFLAGS <<
|
63
|
-
append_cflags [
|
62
|
+
$CFLAGS << " " << "-DBACKTRACIE_EXPORTS"
|
63
|
+
append_cflags ["-fvisibility=hidden"]
|
64
64
|
create_header
|
65
65
|
|
66
|
-
if RUBY_VERSION <
|
66
|
+
if RUBY_VERSION < "2.6"
|
67
67
|
# Use the debase-ruby_core_source gem to get access to Ruby internal structures (no MJIT header -- the preferred
|
68
68
|
# option -- is available for these older Rubies)
|
69
69
|
|
70
|
-
require
|
71
|
-
dir_config(
|
70
|
+
require "debase/ruby_core_source"
|
71
|
+
dir_config("ruby") # allow user to pass in non-standard core include directory
|
72
72
|
unless Debase::RubyCoreSource.create_makefile_with_core(
|
73
|
-
proc { [
|
74
|
-
|
73
|
+
proc { ["vm_core.h", "method.h", "iseq.h", "regenc.h"].map { |it| have_header(it) }.uniq == [true] },
|
74
|
+
"backtracie_native_extension"
|
75
75
|
)
|
76
|
-
raise
|
76
|
+
raise "Error during native gem setup -- `Debase::RubyCoreSource.create_makefile_with_core` failed"
|
77
77
|
end
|
78
78
|
|
79
79
|
else
|
@@ -84,14 +84,14 @@ else
|
|
84
84
|
# containing the exact file, so that it can be used in a #include in the C code.
|
85
85
|
header_contents =
|
86
86
|
File.read($extconf_h)
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
.sub("#endif",
|
88
|
+
<<~EXTCONF_H.strip
|
89
|
+
#define RUBY_MJIT_HEADER "rb_mjit_min_header-#{RUBY_VERSION}.h"
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
File.open($extconf_h,
|
91
|
+
#endif
|
92
|
+
EXTCONF_H
|
93
|
+
)
|
94
|
+
File.open($extconf_h, "w") { |file| file.puts(header_contents) }
|
95
95
|
|
96
|
-
create_makefile
|
96
|
+
create_makefile "backtracie_native_extension"
|
97
97
|
end
|
@@ -14,7 +14,7 @@ typedef struct {
|
|
14
14
|
} strbuilder_t;
|
15
15
|
|
16
16
|
void strbuilder_append(strbuilder_t *str, const char *cat);
|
17
|
-
void strbuilder_appendf(strbuilder_t *str, const char *fmt, ...);
|
17
|
+
void strbuilder_appendf(strbuilder_t *str, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
18
18
|
void strbuilder_append_value(strbuilder_t *str, VALUE val);
|
19
19
|
VALUE strbuilder_to_value(strbuilder_t *str);
|
20
20
|
void strbuilder_init(strbuilder_t *str, char *buf, size_t bufsize);
|
data/lib/backtracie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backtracie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivo Anjo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase-ruby_core_source
|
@@ -59,7 +59,7 @@ homepage: https://github.com/ivoanjo/backtracie
|
|
59
59
|
licenses:
|
60
60
|
- LGPL-3.0+
|
61
61
|
metadata: {}
|
62
|
-
post_install_message:
|
62
|
+
post_install_message:
|
63
63
|
rdoc_options: []
|
64
64
|
require_paths:
|
65
65
|
- lib
|
@@ -75,8 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.
|
79
|
-
signing_key:
|
78
|
+
rubygems_version: 3.4.1
|
79
|
+
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Ruby gem for beautiful backtraces
|
82
82
|
test_files: []
|