pf2 0.13.0 → 1.0.0.alpha1

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.
data/ext/pf2/session.h CHANGED
@@ -3,8 +3,6 @@
3
3
 
4
4
  #include <pthread.h>
5
5
  #include <stdatomic.h>
6
- #include <stdint.h>
7
- #include <limits.h>
8
6
  #include <sys/time.h>
9
7
 
10
8
  #include <ruby.h>
@@ -13,152 +11,6 @@
13
11
  #include "ringbuffer.h"
14
12
  #include "sample.h"
15
13
 
16
- #include "khashl.h"
17
-
18
- // Maps for sample storage
19
-
20
- // BEGIN generic helpers
21
-
22
- static inline khint_t hash_size_t(size_t v)
23
- {
24
- #if SIZE_MAX == UINT_MAX
25
- return kh_hash_uint32((khint_t)v);
26
- #else
27
- return kh_hash_uint64((khint64_t)v);
28
- #endif
29
- }
30
- static inline int eq_size_t(size_t a, size_t b) { return a == b; }
31
-
32
- // END generic helpers
33
-
34
- // BEGIN location_table
35
-
36
- struct pf2_location_key {
37
- VALUE cme;
38
- int lineno;
39
- };
40
- static inline khint_t hash_location_key(struct pf2_location_key key)
41
- {
42
- khint_t h = hash_size_t((size_t)key.cme);
43
- h ^= (khint_t)key.lineno + 0x9e3779b9U + (h << 6) + (h >> 2);
44
- return h;
45
- }
46
- static inline int eq_location_key(struct pf2_location_key a, struct pf2_location_key b)
47
- {
48
- return a.cme == b.cme && a.lineno == b.lineno;
49
- }
50
-
51
- // END location_table
52
-
53
- // BEGIN stack_table (Ruby stack)
54
-
55
- struct pf2_stack_key {
56
- const size_t *frames; // pointer to an immutable array of location_ids
57
- size_t depth;
58
- };
59
- static inline khint_t hash_stack_key(struct pf2_stack_key key)
60
- {
61
- khint_t h = hash_size_t(key.depth);
62
- for (size_t i = 0; i < key.depth; i++) {
63
- h ^= hash_size_t(key.frames[i]) + 0x9e3779b9U + (h << 6) + (h >> 2);
64
- }
65
- return h;
66
- }
67
- static inline int eq_stack_key(struct pf2_stack_key a, struct pf2_stack_key b)
68
- {
69
- if (a.depth != b.depth) return 0;
70
- for (size_t i = 0; i < a.depth; i++) {
71
- if (a.frames[i] != b.frames[i]) return 0;
72
- }
73
- return 1;
74
- }
75
-
76
- // END stack_table
77
-
78
- // BEGIN native_stack_table (raw PCs)
79
-
80
- struct pf2_native_stack_key {
81
- const uintptr_t *frames; // pointer to an immutable array of PCs
82
- size_t depth;
83
- };
84
- static inline khint_t hash_native_stack_key(struct pf2_native_stack_key key)
85
- {
86
- khint_t h = hash_size_t(key.depth);
87
- for (size_t i = 0; i < key.depth; i++) {
88
- h ^= kh_hash_uint64((khint64_t)key.frames[i]) + 0x9e3779b9U + (h << 6) + (h >> 2);
89
- }
90
- return h;
91
- }
92
- static inline int eq_native_stack_key(struct pf2_native_stack_key a, struct pf2_native_stack_key b)
93
- {
94
- if (a.depth != b.depth) return 0;
95
- for (size_t i = 0; i < a.depth; i++) {
96
- if (a.frames[i] != b.frames[i]) return 0;
97
- }
98
- return 1;
99
- }
100
-
101
- // END native_stack_table
102
-
103
- // BEGIN combined_sample_table
104
-
105
- struct pf2_combined_stack_key {
106
- size_t ruby_stack_id;
107
- size_t native_stack_id;
108
- };
109
- static inline khint_t hash_combined_stack_key(struct pf2_combined_stack_key key)
110
- {
111
- khint_t h = hash_size_t(key.ruby_stack_id);
112
- h ^= hash_size_t(key.native_stack_id) + 0x9e3779b9U + (h << 6) + (h >> 2);
113
- return h;
114
- }
115
- static inline int eq_combined_stack_key(struct pf2_combined_stack_key a, struct pf2_combined_stack_key b)
116
- {
117
- return a.ruby_stack_id == b.ruby_stack_id && a.native_stack_id == b.native_stack_id;
118
- }
119
-
120
- // END combined_sample_table
121
-
122
- struct pf2_sample_stats {
123
- // The number of times this sample was observed.
124
- size_t count;
125
- // Timestamps which this sample was observed. This array's length = # of samples.
126
- // TODO: Make timestamp collection optional?
127
- uint64_t *timestamps;
128
- // Thread ids corresponding to each timestamp.
129
- uintptr_t *thread_ids;
130
- // timestamps.length
131
- size_t timestamps_count;
132
- size_t timestamps_capacity;
133
- };
134
-
135
- #pragma GCC diagnostic push
136
- #pragma GCC diagnostic ignored "-Wunused-function"
137
- // location table: key = (cme, lineno), val = location_id
138
- KHASHL_MAP_INIT(static, pf2_location_table, pf2_location_table, struct pf2_location_key, size_t, hash_location_key, eq_location_key)
139
- // stack table: key = array of location_ids, val = stack_id
140
- KHASHL_MAP_INIT(static, pf2_stack_table, pf2_stack_table, struct pf2_stack_key, size_t, hash_stack_key, eq_stack_key)
141
- // native stack table: key = array of PCs, val = native_stack_id
142
- KHASHL_MAP_INIT(static, pf2_native_stack_table, pf2_native_stack_table, struct pf2_native_stack_key, size_t, hash_native_stack_key, eq_native_stack_key)
143
- // sample table: key = (ruby_stack_id, native_stack_id), val = aggregated counts/timestamps
144
- KHASHL_MAP_INIT(static, pf2_sample_table, pf2_sample_table, struct pf2_combined_stack_key, struct pf2_sample_stats, hash_combined_stack_key, eq_combined_stack_key)
145
- #pragma GCC diagnostic pop
146
-
147
- struct pf2_sess_sample {
148
- size_t *stack; // array of location_indexes
149
- size_t stack_count;
150
- size_t *native_stack; // array of location_indexes
151
- size_t native_stack_count;
152
- uintptr_t ruby_thread_id;
153
- uint64_t elapsed_ns;
154
- };
155
-
156
- struct pf2_sess_location {
157
- size_t function_index;
158
- int32_t lineno;
159
- size_t address;
160
- };
161
-
162
14
  struct pf2_session {
163
15
  bool is_running;
164
16
  #ifdef HAVE_TIMER_CREATE
@@ -170,18 +22,14 @@ struct pf2_session {
170
22
  atomic_bool is_marking; // Whether garbage collection is in progress
171
23
  pthread_t *collector_thread;
172
24
 
173
- pf2_location_table *location_table;
174
- pf2_stack_table *stack_table;
175
- pf2_native_stack_table *native_stack_table;
176
- pf2_sample_table *sample_table;
25
+ struct pf2_sample *samples; // Dynamic array of samples
26
+ size_t samples_index;
27
+ size_t samples_capacity; // Current capacity of the samples array
177
28
 
178
29
  struct timespec start_time_realtime;
179
30
  struct timespec start_time; // When profiling started
180
31
  uint64_t duration_ns; // Duration of profiling in nanoseconds
181
32
 
182
- atomic_uint_fast64_t collected_sample_count; // Number of samples copied out of the ringbuffer
183
- atomic_uint_fast64_t dropped_sample_count; // Number of samples dropped for any reason
184
-
185
33
  struct pf2_configuration *configuration;
186
34
  };
187
35
 
@@ -195,14 +43,14 @@ void pf2_session_dfree(void *sess);
195
43
  size_t pf2_session_dsize(const void *sess);
196
44
 
197
45
  static const rb_data_type_t pf2_session_type = {
198
- .wrap_struct_name = "Pf2::Session",
46
+ .wrap_struct_name = "Pf2c::Session",
199
47
  .function = {
200
48
  .dmark = pf2_session_dmark,
201
49
  .dfree = pf2_session_dfree,
202
50
  .dsize = pf2_session_dsize,
203
51
  },
204
52
  .data = NULL,
205
- .flags = 0,
53
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
206
54
  };
207
55
 
208
56
  #endif // PF2_SESSION_H
data/lib/pf2/cli.rb CHANGED
@@ -26,7 +26,7 @@ module Pf2
26
26
  when 'version'
27
27
  puts VERSION
28
28
  return 0
29
- when nil, '--help'
29
+ when '--help'
30
30
  STDERR.puts <<~__EOS__
31
31
  Usage: #{program_name} COMMAND [options]
32
32
 
@@ -82,7 +82,7 @@ module Pf2
82
82
 
83
83
  # If the next function is a vm_exec_core() (= VM_EXEC in vm_exec.h),
84
84
  # we switch to the Ruby stack.
85
- function[:name]&.match?(/\Avm_exec_core(?:\.lto_priv\.\d+)?\z/)
85
+ function[:name] == 'vm_exec_core'
86
86
  end
87
87
  end
88
88
  end
data/lib/pf2/serve.rb CHANGED
@@ -27,9 +27,10 @@ module Pf2
27
27
  server = WEBrick::HTTPServer.new(CONFIG)
28
28
  server.mount_proc('/profile') do |req, res|
29
29
  profile = Pf2.stop
30
+ profile = JSON.parse(profile, symbolize_names: true, max_nesting: false)
30
31
  res.header['Content-Type'] = 'application/json'
31
32
  res.header['Access-Control-Allow-Origin'] = '*'
32
- res.body = JSON.generate(Pf2::Reporter::FirefoxProfilerSer2.new(profile).emit)
33
+ res.body = JSON.generate(Pf2::Reporter::FirefoxProfiler.new((profile)).emit)
33
34
  Pf2.start
34
35
  end
35
36
 
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pf2
4
+ class Session
5
+ attr_reader :configuration
6
+
7
+ # Implementation is in Rust code.
8
+ end
9
+ end
data/lib/pf2/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pf2
4
- VERSION = '0.13.0'
4
+ VERSION = '1.0.0.alpha1'
5
5
  end
data/lib/pf2.rb CHANGED
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'pf2/pf2'
4
+ require_relative 'pf2/session'
4
5
  require_relative 'pf2/version'
5
6
 
6
7
  module Pf2
7
8
  class Error < StandardError; end
8
9
 
9
10
  def self.start(...)
10
- @@session = Session.new(...)
11
+ @@session = Pf2c::Session.new(...)
11
12
  @@session.start
12
13
  end
13
14
 
@@ -15,25 +16,12 @@ module Pf2
15
16
  @@session.stop
16
17
  end
17
18
 
18
- # Profiles the given block of code.
19
- #
20
- # Example:
21
- #
22
- # profile = Pf2.profile(interval_ms: 42) do
23
- # your_code_here
24
- # end
25
- #
26
- def self.profile(**kwargs, &block)
19
+ def self.profile(&block)
27
20
  raise ArgumentError, "block required" unless block_given?
28
- start(**kwargs)
21
+ start(threads: Thread.list)
29
22
  yield
30
23
  result = stop
31
24
  @@session = nil # let GC clean up the session
32
25
  result
33
- ensure
34
- if defined?(@@session) && @@session != nil
35
- stop
36
- @@session = nil
37
- end
38
26
  end
39
27
  end
@@ -103,7 +103,7 @@ backtrace_atomic_store_size_t (size_t *p, size_t v)
103
103
  void
104
104
  backtrace_atomic_store_int (int *p, int v)
105
105
  {
106
- int old;
106
+ size_t old;
107
107
 
108
108
  old = *p;
109
109
  while (!__sync_bool_compare_and_swap (p, old, v))
@@ -812,7 +812,6 @@ enable_darwin_at_rpath
812
812
  enable_largefile
813
813
  enable_werror
814
814
  with_system_libunwind
815
- enable_host_pie
816
815
  enable_host_shared
817
816
  '
818
817
  ac_precious_vars='build_alias
@@ -1462,7 +1461,6 @@ Optional Features:
1462
1461
  rpaths to be added to executables
1463
1462
  --disable-largefile omit support for large files
1464
1463
  --disable-werror disable building with -Werror
1465
- --enable-host-pie build host code as PIE
1466
1464
  --enable-host-shared build host code as shared libraries
1467
1465
 
1468
1466
  Optional Packages:
@@ -11397,7 +11395,7 @@ else
11397
11395
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11398
11396
  lt_status=$lt_dlunknown
11399
11397
  cat > conftest.$ac_ext <<_LT_EOF
11400
- #line 11400 "configure"
11398
+ #line 11398 "configure"
11401
11399
  #include "confdefs.h"
11402
11400
 
11403
11401
  #if HAVE_DLFCN_H
@@ -11503,7 +11501,7 @@ else
11503
11501
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11504
11502
  lt_status=$lt_dlunknown
11505
11503
  cat > conftest.$ac_ext <<_LT_EOF
11506
- #line 11506 "configure"
11504
+ #line 11504 "configure"
11507
11505
  #include "confdefs.h"
11508
11506
 
11509
11507
  #if HAVE_DLFCN_H
@@ -12192,18 +12190,12 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
12192
12190
  fi
12193
12191
  fi
12194
12192
 
12195
- # Enable --enable-host-pie.
12196
- # Check whether --enable-host-pie was given.
12197
- if test "${enable_host_pie+set}" = set; then :
12198
- enableval=$enable_host_pie; PIC_FLAG=-fPIE
12199
- else
12200
- PIC_FLAG=
12201
- fi
12202
-
12203
12193
  # Enable --enable-host-shared.
12204
12194
  # Check whether --enable-host-shared was given.
12205
12195
  if test "${enable_host_shared+set}" = set; then :
12206
12196
  enableval=$enable_host_shared; PIC_FLAG=-fPIC
12197
+ else
12198
+ PIC_FLAG=
12207
12199
  fi
12208
12200
 
12209
12201
 
@@ -176,16 +176,11 @@ else
176
176
  fi
177
177
  fi
178
178
 
179
- # Enable --enable-host-pie.
180
- AC_ARG_ENABLE(host-pie,
181
- [AS_HELP_STRING([--enable-host-pie],
182
- [build host code as PIE])],
183
- [PIC_FLAG=-fPIE], [PIC_FLAG=])
184
179
  # Enable --enable-host-shared.
185
180
  AC_ARG_ENABLE(host-shared,
186
181
  [AS_HELP_STRING([--enable-host-shared],
187
182
  [build host code as shared libraries])],
188
- [PIC_FLAG=-fPIC])
183
+ [PIC_FLAG=-fPIC], [PIC_FLAG=])
189
184
  AC_SUBST(PIC_FLAG)
190
185
 
191
186
  # Test for __sync support.
@@ -160,10 +160,10 @@ dl_iterate_phdr (int (*callback) (struct dl_phdr_info *,
160
160
  #undef EI_CLASS
161
161
  #undef EI_DATA
162
162
  #undef EI_VERSION
163
- #undef ELFMAG0
164
- #undef ELFMAG1
165
- #undef ELFMAG2
166
- #undef ELFMAG3
163
+ #undef ELF_MAG0
164
+ #undef ELF_MAG1
165
+ #undef ELF_MAG2
166
+ #undef ELF_MAG3
167
167
  #undef ELFCLASS32
168
168
  #undef ELFCLASS64
169
169
  #undef ELFDATA2LSB
@@ -47,10 +47,6 @@ POSSIBILITY OF SUCH DAMAGE. */
47
47
  #include <mach-o/dyld.h>
48
48
  #endif
49
49
 
50
- #ifdef __hpux__
51
- #include <dl.h>
52
- #endif
53
-
54
50
  #ifdef HAVE_WINDOWS_H
55
51
  #ifndef WIN32_LEAN_AND_MEAN
56
52
  #define WIN32_LEAN_AND_MEAN
@@ -70,33 +66,6 @@ POSSIBILITY OF SUCH DAMAGE. */
70
66
  #define getexecname() NULL
71
67
  #endif
72
68
 
73
- #ifdef __hpux__
74
- static char *
75
- hpux_get_executable_path (struct backtrace_state *state,
76
- backtrace_error_callback error_callback, void *data)
77
- {
78
- struct shl_descriptor *desc;
79
- size_t len = sizeof (struct shl_descriptor);
80
-
81
- desc = backtrace_alloc (state, len, error_callback, data);
82
- if (desc == NULL)
83
- return NULL;
84
-
85
- if (shl_get_r (0, desc) == -1)
86
- {
87
- backtrace_free (state, desc, len, error_callback, data);
88
- return NULL;
89
- }
90
-
91
- return desc->filename;
92
- }
93
-
94
- #else
95
-
96
- #define hpux_get_executable_path(state, error_callback, data) NULL
97
-
98
- #endif
99
-
100
69
  #if !defined (HAVE_KERN_PROC_ARGS) && !defined (HAVE_KERN_PROC)
101
70
 
102
71
  #define sysctl_exec_name1(state, error_callback, data) NULL
@@ -276,7 +245,7 @@ fileline_initialize (struct backtrace_state *state,
276
245
 
277
246
  descriptor = -1;
278
247
  called_error_callback = 0;
279
- for (pass = 0; pass < 11; ++pass)
248
+ for (pass = 0; pass < 10; ++pass)
280
249
  {
281
250
  int does_not_exist;
282
251
 
@@ -316,9 +285,6 @@ fileline_initialize (struct backtrace_state *state,
316
285
  case 9:
317
286
  filename = windows_get_executable_path (buf, error_callback, data);
318
287
  break;
319
- case 10:
320
- filename = hpux_get_executable_path (state, error_callback, data);
321
- break;
322
288
  default:
323
289
  abort ();
324
290
  }
@@ -3,7 +3,6 @@
3
3
  /^\177ELF\002/ { if (NR == 1) { print "elf64"; exit } }
4
4
  /^\114\001/ { if (NR == 1) { print "pecoff"; exit } }
5
5
  /^\144\206/ { if (NR == 1) { print "pecoff"; exit } }
6
- /^\000\000\377\377/ { if (NR == 1) { print "pecoff"; exit } }
7
6
  /^\001\337/ { if (NR == 1) { print "xcoff32"; exit } }
8
7
  /^\001\367/ { if (NR == 1) { print "xcoff64"; exit } }
9
8
  /^\376\355\372\316/ { if (NR == 1) { print "macho"; exit } }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pf2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 1.0.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Aritomo
@@ -9,20 +9,6 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: logger
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - ">="
17
- - !ruby/object:Gem::Version
18
- version: '0'
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: '0'
26
12
  - !ruby/object:Gem::Dependency
27
13
  name: rake-compiler
28
14
  requirement: !ruby/object:Gem::Requirement
@@ -93,20 +79,6 @@ dependencies:
93
79
  - - ">="
94
80
  - !ruby/object:Gem::Version
95
81
  version: '0'
96
- - !ruby/object:Gem::Dependency
97
- name: rdoc
98
- requirement: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
82
  email:
111
83
  - osyoyu@osyoyu.com
112
84
  executables:
@@ -115,25 +87,20 @@ extensions:
115
87
  - ext/pf2/extconf.rb
116
88
  extra_rdoc_files: []
117
89
  files:
118
- - ".document"
119
- - ".rdoc_options"
120
90
  - CHANGELOG.md
121
91
  - LICENSE.txt
122
92
  - README.md
123
93
  - Rakefile
124
- - THIRD_PARTY_LICENSES.txt
125
94
  - doc/development.md
126
95
  - examples/mandelbrot.rb
127
96
  - examples/mandelbrot_ractor.rb
128
97
  - exe/pf2
129
- - ext/patches/libbacktrace/0001-Support-MACH_O_MH_BUNDLE.patch
130
98
  - ext/pf2/backtrace_state.c
131
99
  - ext/pf2/backtrace_state.h
132
100
  - ext/pf2/configuration.c
133
101
  - ext/pf2/configuration.h
134
102
  - ext/pf2/debug.h
135
103
  - ext/pf2/extconf.rb
136
- - ext/pf2/khashl.h
137
104
  - ext/pf2/pf2.c
138
105
  - ext/pf2/pf2.h
139
106
  - ext/pf2/ringbuffer.c
@@ -151,6 +118,7 @@ files:
151
118
  - lib/pf2/reporter/firefox_profiler_ser2.rb
152
119
  - lib/pf2/reporter/stack_weaver.rb
153
120
  - lib/pf2/serve.rb
121
+ - lib/pf2/session.rb
154
122
  - lib/pf2/version.rb
155
123
  - vendor/libbacktrace/.gitignore
156
124
  - vendor/libbacktrace/Isaac.Newton-Opticks.txt
@@ -244,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
212
  - !ruby/object:Gem::Version
245
213
  version: '0'
246
214
  requirements: []
247
- rubygems_version: 4.0.3
215
+ rubygems_version: 3.8.0.dev
248
216
  specification_version: 4
249
217
  summary: Yet another Ruby profiler
250
218
  test_files: []
data/.document DELETED
@@ -1,3 +0,0 @@
1
- ext/
2
- lib/
3
- *.md
data/.rdoc_options DELETED
@@ -1,6 +0,0 @@
1
- title: Pf2
2
- main_page: README.md
3
- encoding: UTF-8
4
-
5
- autolink_excluded_words:
6
- - Pf2
@@ -1,59 +0,0 @@
1
- This project includes the following third-party software:
2
-
3
- ## khashl
4
-
5
- The MIT License
6
-
7
- Copyright (c) 2019- by Attractive Chaos <attractor@live.co.uk>
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining
10
- a copy of this software and associated documentation files (the
11
- "Software"), to deal in the Software without restriction, including
12
- without limitation the rights to use, copy, modify, merge, publish,
13
- distribute, sublicense, and/or sell copies of the Software, and to
14
- permit persons to whom the Software is furnished to do so, subject to
15
- the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be
18
- included in all copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
24
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
-
29
- ## libbacktrace
30
-
31
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
32
-
33
- Redistribution and use in source and binary forms, with or without
34
- modification, are permitted provided that the following conditions are
35
- met:
36
-
37
- (1) Redistributions of source code must retain the above copyright
38
- notice, this list of conditions and the following disclaimer.
39
-
40
- (2) Redistributions in binary form must reproduce the above copyright
41
- notice, this list of conditions and the following disclaimer in
42
- the documentation and/or other materials provided with the
43
- distribution.
44
-
45
- (3) The name of the author may not be used to
46
- endorse or promote products derived from this software without
47
- specific prior written permission.
48
-
49
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
50
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
51
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
52
- DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
53
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
54
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
55
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
57
- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
58
- IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
59
- POSSIBILITY OF SUCH DAMAGE.
@@ -1,32 +0,0 @@
1
- From 4cd047583bc48ad0617fb6c036174de062573e68 Mon Sep 17 00:00:00 2001
2
- From: Daisuke Aritomo <osyoyu@osyoyu.com>
3
- Date: Wed, 7 Jan 2026 02:50:54 +0900
4
- Subject: [PATCH] Support MACH_O_MH_BUNDLE
5
-
6
- ---
7
- macho.c | 2 ++
8
- 1 file changed, 2 insertions(+)
9
-
10
- diff --git a/macho.c b/macho.c
11
- index 9f8738d..5ea07ae 100644
12
- --- a/macho.c
13
- +++ b/macho.c
14
- @@ -92,6 +92,7 @@ struct macho_header_fat
15
-
16
- #define MACH_O_MH_EXECUTE 0x02
17
- #define MACH_O_MH_DYLIB 0x06
18
- +#define MACH_O_MH_BUNDLE 0x08
19
- #define MACH_O_MH_DSYM 0x0a
20
-
21
- /* A component of a fat file. A fat file starts with a
22
- @@ -1062,6 +1063,7 @@ macho_add (struct backtrace_state *state, const char *filename, int descriptor,
23
- {
24
- case MACH_O_MH_EXECUTE:
25
- case MACH_O_MH_DYLIB:
26
- + case MACH_O_MH_BUNDLE:
27
- case MACH_O_MH_DSYM:
28
- break;
29
- default:
30
- --
31
- 2.39.5 (Apple Git-154)
32
-