grpc 1.73.0 → 1.74.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 +4 -4
- data/Makefile +38 -17
- data/include/grpc/create_channel_from_endpoint.h +54 -0
- data/include/grpc/credentials.h +11 -5
- data/include/grpc/event_engine/event_engine.h +74 -17
- data/include/grpc/grpc_posix.h +20 -1
- data/include/grpc/impl/channel_arg_names.h +2 -4
- data/include/grpc/module.modulemap +1 -0
- data/include/grpc/support/json.h +24 -0
- data/src/core/call/interception_chain.h +7 -11
- data/src/core/channelz/channel_trace.cc +213 -115
- data/src/core/channelz/channel_trace.h +380 -86
- data/src/core/channelz/channelz.cc +270 -181
- data/src/core/channelz/channelz.h +168 -55
- data/src/core/channelz/channelz_registry.cc +2 -1
- data/src/core/channelz/channelz_registry.h +24 -0
- data/src/core/channelz/property_list.cc +357 -0
- data/src/core/channelz/property_list.h +202 -0
- data/src/core/channelz/ztrace_collector.h +3 -2
- data/src/core/client_channel/backup_poller.cc +17 -2
- data/src/core/client_channel/client_channel.cc +17 -28
- data/src/core/client_channel/client_channel_filter.cc +19 -29
- data/src/core/client_channel/config_selector.h +8 -2
- data/src/core/client_channel/dynamic_filters.cc +5 -6
- data/src/core/client_channel/dynamic_filters.h +1 -1
- data/src/core/client_channel/global_subchannel_pool.cc +4 -1
- data/src/core/client_channel/retry_filter.cc +21 -27
- data/src/core/client_channel/retry_filter.h +10 -7
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
- data/src/core/client_channel/retry_filter_legacy_call_data.h +1 -1
- data/src/core/client_channel/retry_interceptor.cc +30 -44
- data/src/core/client_channel/retry_interceptor.h +18 -17
- data/src/core/client_channel/retry_throttle.cc +46 -61
- data/src/core/client_channel/retry_throttle.h +17 -39
- data/src/core/client_channel/subchannel.cc +43 -19
- data/src/core/client_channel/subchannel.h +8 -0
- data/src/core/config/config_vars.cc +2 -0
- data/src/core/config/core_configuration.cc +1 -0
- data/src/core/config/core_configuration.h +11 -0
- data/src/core/credentials/call/call_creds_registry.h +125 -0
- data/src/core/credentials/call/call_creds_registry_init.cc +91 -0
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +6 -48
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +86 -0
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.h +74 -0
- data/src/core/credentials/call/jwt_util.cc +70 -0
- data/src/core/credentials/call/jwt_util.h +32 -0
- data/src/core/credentials/transport/channel_creds_registry_init.cc +1 -1
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +72 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +0 -1
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +1 -0
- data/src/core/credentials/transport/xds/xds_credentials.cc +0 -3
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +8 -8
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +16 -16
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -4
- data/src/core/ext/filters/http/message_compress/compression_filter.h +25 -22
- data/src/core/ext/filters/http/server/http_server_filter.h +12 -11
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +120 -35
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +162 -115
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +0 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +1239 -3514
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +1008 -1486
- data/src/core/ext/transport/chttp2/transport/flow_control.h +22 -17
- data/src/core/ext/transport/chttp2/transport/frame.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +299 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +11 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +12 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +1017 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +593 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -22
- data/{third_party/abseil-cpp/absl/strings/cord_buffer.cc → src/core/ext/transport/chttp2/transport/http2_stats_collector.cc} +14 -14
- data/src/core/ext/transport/chttp2/transport/http2_stats_collector.h +33 -0
- data/src/core/ext/transport/chttp2/transport/http2_status.h +6 -1
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +43 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +65 -0
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +0 -29
- data/src/core/ext/transport/chttp2/transport/internal.h +18 -8
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +105 -0
- data/src/core/ext/transport/chttp2/transport/keepalive.h +138 -0
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +185 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +19 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +151 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +180 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +5 -9
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +11 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +39 -1
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +19 -0
- data/src/core/ext/transport/chttp2/transport/transport_common.h +27 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +37 -11
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +571 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +120 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +1272 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +312 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +50 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +984 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +226 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +44 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +175 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +82 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +135 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +67 -0
- data/src/core/filter/auth/auth_filters.h +0 -25
- data/src/core/filter/auth/client_auth_filter.cc +0 -118
- data/src/core/filter/filter_args.h +9 -23
- data/src/core/handshaker/handshaker.cc +23 -14
- data/src/core/handshaker/handshaker.h +3 -0
- data/src/core/handshaker/http_connect/http_connect_handshaker.cc +3 -1
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +6 -5
- data/src/core/handshaker/security/secure_endpoint.cc +70 -25
- data/src/core/handshaker/security/security_handshaker.cc +4 -1
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +7 -1
- data/src/core/lib/channel/channel_args.cc +15 -0
- data/src/core/lib/channel/channel_args.h +3 -0
- data/src/core/lib/channel/channel_stack.cc +22 -23
- data/src/core/lib/channel/channel_stack.h +9 -7
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +2 -7
- data/src/core/lib/channel/promise_based_filter.h +5 -5
- data/src/core/lib/debug/trace_impl.h +0 -1
- data/src/core/lib/event_engine/ares_resolver.cc +165 -46
- data/src/core/lib/event_engine/ares_resolver.h +48 -2
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -4
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +2 -6
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.cc +40 -0
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.h +60 -0
- data/src/core/lib/event_engine/event_engine.cc +7 -0
- data/src/core/lib/event_engine/extensions/channelz.h +10 -6
- data/src/core/lib/event_engine/grpc_polled_fd.h +5 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +130 -162
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +11 -15
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +75 -117
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -9
- data/src/core/lib/event_engine/posix_engine/event_poller.h +18 -15
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +0 -18
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +124 -0
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.h +243 -0
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +29 -19
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +6 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +145 -92
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -19
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +333 -116
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +61 -18
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +45 -37
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +6 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +32 -142
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -5
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +211 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +1083 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +281 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.cc +154 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +174 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -719
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -170
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +33 -22
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +13 -11
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +117 -151
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +26 -94
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +26 -25
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +36 -62
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +7 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +12 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -1
- data/src/core/lib/event_engine/shim.cc +9 -0
- data/src/core/lib/event_engine/shim.h +3 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool.h +7 -3
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +0 -17
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +4 -2
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -2
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +4 -0
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +2 -6
- data/src/core/lib/event_engine/windows/windows_engine.cc +0 -1
- data/src/core/lib/event_engine/windows/windows_engine.h +1 -3
- data/src/core/lib/event_engine/windows/windows_listener.cc +14 -2
- data/src/core/lib/experiments/experiments.cc +45 -93
- data/src/core/lib/experiments/experiments.h +21 -51
- data/src/core/lib/iomgr/endpoint.cc +4 -3
- data/src/core/lib/iomgr/endpoint.h +7 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +7 -2
- data/src/core/lib/iomgr/ev_poll_posix.cc +7 -2
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +4 -6
- data/src/core/lib/iomgr/tcp_posix.cc +12 -6
- data/src/core/lib/iomgr/tcp_windows.cc +3 -2
- data/src/core/lib/promise/activity.h +1 -0
- data/src/core/lib/promise/arena_promise.h +23 -7
- data/src/core/lib/promise/detail/promise_factory.h +10 -0
- data/src/core/lib/promise/detail/promise_like.h +118 -11
- data/src/core/lib/promise/detail/promise_variant.h +50 -0
- data/src/core/lib/promise/detail/seq_state.h +687 -548
- data/src/core/lib/promise/if.h +20 -0
- data/src/core/lib/promise/inter_activity_latch.h +147 -0
- data/src/core/lib/promise/inter_activity_mutex.h +547 -0
- data/src/core/lib/promise/loop.h +65 -3
- data/src/core/lib/promise/map.h +24 -0
- data/src/core/lib/promise/match_promise.h +103 -0
- data/src/core/lib/promise/mpsc.cc +425 -0
- data/src/core/lib/promise/mpsc.h +490 -0
- data/src/core/lib/promise/party.cc +50 -1
- data/src/core/lib/promise/party.h +66 -1
- data/src/core/lib/promise/race.h +31 -0
- data/src/core/lib/promise/seq.h +4 -1
- data/src/core/lib/promise/status_flag.h +7 -0
- data/src/core/lib/promise/try_seq.h +4 -1
- data/src/core/lib/promise/wait_set.cc +28 -0
- data/src/core/lib/promise/wait_set.h +86 -0
- data/src/core/lib/resource_quota/arena.h +19 -0
- data/src/core/lib/slice/slice.h +5 -0
- data/src/core/lib/surface/channel_create.cc +88 -13
- data/src/core/lib/surface/channel_create.h +4 -0
- data/src/core/lib/surface/channel_init.cc +164 -47
- data/src/core/lib/surface/channel_init.h +64 -1
- data/src/core/lib/surface/filter_stack_call.cc +18 -9
- data/src/core/lib/surface/init.cc +6 -15
- data/src/core/lib/surface/legacy_channel.cc +3 -5
- data/src/core/lib/surface/legacy_channel.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +110 -0
- data/src/core/lib/transport/promise_endpoint.h +307 -0
- data/src/core/load_balancing/child_policy_handler.cc +2 -4
- data/src/core/load_balancing/delegating_helper.h +2 -3
- data/src/core/load_balancing/health_check_client.cc +1 -5
- data/src/core/load_balancing/lb_policy.h +1 -3
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +3 -0
- data/src/core/load_balancing/xds/cds.cc +10 -1
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
- data/src/core/resolver/xds/xds_config.cc +6 -3
- data/src/core/resolver/xds/xds_config.h +9 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +21 -6
- data/src/core/resolver/xds/xds_dependency_manager.h +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +31 -11
- data/src/core/server/server.cc +83 -12
- data/src/core/server/server.h +21 -2
- data/src/core/server/xds_server_config_fetcher.cc +63 -25
- data/src/core/service_config/service_config.h +1 -1
- data/src/core/service_config/service_config_impl.h +1 -1
- data/src/core/telemetry/context_list_entry.cc +38 -0
- data/src/core/telemetry/context_list_entry.h +42 -12
- data/src/core/telemetry/stats_data.cc +233 -207
- data/src/core/telemetry/stats_data.h +250 -153
- data/src/core/telemetry/tcp_tracer.h +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +11 -3
- data/src/core/tsi/fake_transport_security.cc +17 -0
- data/src/core/tsi/ssl_transport_security.cc +2 -0
- data/src/core/tsi/transport_security_grpc.cc +8 -0
- data/src/core/tsi/transport_security_grpc.h +15 -0
- data/src/core/util/backoff.cc +1 -5
- data/src/core/util/backoff.h +1 -0
- data/src/core/util/down_cast.h +1 -1
- data/src/core/util/function_signature.h +15 -1
- data/src/core/util/http_client/httpcli.cc +12 -5
- data/src/core/util/http_client/httpcli.h +4 -1
- data/src/core/util/latent_see.h +8 -5
- data/src/core/util/log.cc +4 -0
- data/src/core/util/memory_usage.h +268 -0
- data/src/core/util/per_cpu.cc +2 -0
- data/src/core/util/per_cpu.h +7 -0
- data/src/core/util/shared_bit_gen.h +20 -0
- data/src/core/util/single_set_ptr.h +2 -2
- data/src/core/util/upb_utils.h +42 -0
- data/src/core/util/uri.cc +3 -2
- data/src/core/util/useful.h +53 -2
- data/src/core/util/wait_for_single_owner.cc +31 -0
- data/src/core/util/wait_for_single_owner.h +24 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +5 -0
- data/src/core/xds/grpc/xds_client_grpc.cc +6 -2
- data/src/core/xds/grpc/xds_common_types_parser.cc +138 -50
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_filter.h +7 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +22 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -0
- data/src/core/xds/grpc/xds_route_config_parser.cc +15 -38
- data/src/core/xds/grpc/xds_server_grpc.cc +63 -13
- data/src/core/xds/grpc/xds_server_grpc.h +10 -2
- data/src/core/xds/grpc/xds_server_grpc_interface.h +4 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +18 -0
- data/src/core/xds/xds_client/xds_bootstrap.h +2 -0
- data/src/core/xds/xds_client/xds_client.cc +26 -5
- data/src/ruby/ext/grpc/extconf.rb +2 -0
- data/src/ruby/ext/grpc/rb_call.c +1 -8
- data/src/ruby/ext/grpc/rb_channel.c +72 -568
- data/src/ruby/ext/grpc/rb_channel.h +0 -3
- data/src/ruby/ext/grpc/rb_completion_queue.c +26 -14
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -7
- data/src/ruby/ext/grpc/rb_grpc.c +9 -5
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/ext/grpc/rb_loader.c +0 -4
- data/src/ruby/ext/grpc/rb_server.c +31 -50
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/core_spec.rb +22 -0
- data/src/ruby/spec/generic/active_call_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +2 -19
- data/third_party/abseil-cpp/absl/base/attributes.h +76 -7
- data/third_party/abseil-cpp/absl/base/call_once.h +11 -12
- data/third_party/abseil-cpp/absl/base/config.h +20 -129
- data/third_party/abseil-cpp/absl/base/{internal/fast_type_id.h → fast_type_id.h} +11 -16
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +0 -5
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +7 -7
- data/third_party/abseil-cpp/absl/base/internal/endian.h +34 -38
- data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +71 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -5
- data/third_party/abseil-cpp/absl/base/internal/{nullability_impl.h → nullability_deprecated.h} +45 -8
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +0 -9
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -13
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +6 -6
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +8 -3
- data/third_party/abseil-cpp/absl/base/no_destructor.h +11 -32
- data/third_party/abseil-cpp/absl/base/nullability.h +84 -72
- data/third_party/abseil-cpp/absl/base/options.h +3 -80
- data/third_party/abseil-cpp/absl/base/policy_checks.h +7 -7
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +1 -3
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -4
- data/third_party/abseil-cpp/absl/container/btree_map.h +4 -2
- data/third_party/abseil-cpp/absl/container/btree_set.h +4 -2
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -14
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -1
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +8 -5
- data/third_party/abseil-cpp/absl/container/internal/btree.h +132 -29
- data/third_party/abseil-cpp/absl/container/internal/btree_container.h +175 -71
- data/third_party/abseil-cpp/absl/container/internal/common.h +43 -0
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -2
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +9 -10
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +1 -8
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +0 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +20 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +31 -12
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +2 -7
- data/third_party/abseil-cpp/absl/container/internal/layout.h +26 -42
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +199 -68
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +1354 -183
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +881 -1424
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +80 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +0 -4
- data/third_party/abseil-cpp/absl/crc/crc32c.h +7 -5
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +0 -22
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +45 -74
- data/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +5 -5
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +8 -35
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +16 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +40 -37
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +16 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +14 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +10 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +27 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +13 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +4 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +15 -28
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +144 -27
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +73 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +25 -6
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/flag.h +4 -3
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +7 -6
- data/third_party/abseil-cpp/absl/flags/internal/registry.h +4 -3
- data/third_party/abseil-cpp/absl/flags/reflection.cc +2 -3
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +8 -10
- data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -9
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +110 -226
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +10 -12
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -5
- data/third_party/abseil-cpp/absl/hash/hash.h +18 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -5
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -61
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +25 -68
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +2 -6
- data/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
- data/third_party/abseil-cpp/absl/log/check.h +2 -1
- data/third_party/abseil-cpp/absl/log/globals.h +4 -5
- data/third_party/abseil-cpp/absl/log/internal/append_truncated.h +28 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +22 -22
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +65 -62
- data/third_party/abseil-cpp/absl/log/internal/conditions.cc +5 -3
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +7 -2
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +85 -43
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +84 -59
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -0
- data/third_party/abseil-cpp/absl/log/internal/proto.cc +3 -2
- data/third_party/abseil-cpp/absl/log/internal/proto.h +3 -3
- data/third_party/abseil-cpp/absl/log/internal/strip.h +4 -12
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +8 -6
- data/third_party/abseil-cpp/absl/log/internal/voidify.h +10 -4
- data/third_party/abseil-cpp/absl/log/log.h +48 -35
- data/third_party/abseil-cpp/absl/log/log_sink_registry.h +2 -2
- data/third_party/abseil-cpp/absl/meta/type_traits.h +46 -175
- data/third_party/abseil-cpp/absl/numeric/bits.h +68 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -52
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +7 -3
- data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +1 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +10 -11
- data/third_party/abseil-cpp/absl/random/distributions.h +6 -8
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/{pool_urbg.cc → entropy_pool.cc} +22 -90
- data/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +1 -1
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +20 -12
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +5 -5
- data/third_party/abseil-cpp/absl/random/random.h +88 -53
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +6 -2
- data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +3 -4
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +3 -4
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -3
- data/third_party/abseil-cpp/absl/status/status.cc +4 -8
- data/third_party/abseil-cpp/absl/status/status.h +8 -8
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.cc +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +6 -6
- data/third_party/abseil-cpp/absl/strings/ascii.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/ascii.h +18 -18
- data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -22
- data/third_party/abseil-cpp/absl/strings/charconv.h +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +54 -58
- data/third_party/abseil-cpp/absl/strings/cord.h +94 -83
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +11 -11
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +3 -3
- data/third_party/abseil-cpp/absl/strings/escaping.cc +130 -149
- data/third_party/abseil-cpp/absl/strings/escaping.h +9 -10
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +6 -8
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +7 -63
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +0 -22
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +5 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +0 -5
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +96 -1
- data/third_party/abseil-cpp/absl/strings/internal/utf8.h +15 -1
- data/third_party/abseil-cpp/absl/strings/numbers.cc +53 -32
- data/third_party/abseil-cpp/absl/strings/numbers.h +87 -58
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +6 -7
- data/third_party/abseil-cpp/absl/strings/str_cat.h +32 -32
- data/third_party/abseil-cpp/absl/strings/str_format.h +18 -18
- data/third_party/abseil-cpp/absl/strings/str_replace.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/str_replace.h +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.cc +4 -9
- data/third_party/abseil-cpp/absl/strings/string_view.h +27 -32
- data/third_party/abseil-cpp/absl/strings/strip.h +4 -4
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -4
- data/third_party/abseil-cpp/absl/strings/substitute.h +66 -64
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +0 -5
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +97 -69
- data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +12 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +90 -111
- data/third_party/abseil-cpp/absl/time/time.h +20 -15
- data/third_party/abseil-cpp/absl/types/optional.h +7 -747
- data/third_party/abseil-cpp/absl/types/span.h +13 -11
- data/third_party/abseil-cpp/absl/types/variant.h +5 -784
- data/third_party/abseil-cpp/absl/utility/utility.h +10 -185
- metadata +72 -20
- data/src/core/lib/event_engine/forkable.cc +0 -105
- data/src/core/lib/event_engine/forkable.h +0 -67
- data/src/core/lib/iomgr/python_util.h +0 -46
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +0 -108
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +0 -241
- data/third_party/abseil-cpp/absl/log/log_entry.cc +0 -41
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +0 -131
- data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +0 -66
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +0 -78
- data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +0 -82
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +0 -82
- data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -352
- data/third_party/abseil-cpp/absl/types/internal/variant.h +0 -1622
@@ -84,7 +84,7 @@ class RustSymbolParser {
|
|
84
84
|
// structure was not recognized or exceeded implementation limits, such as by
|
85
85
|
// nesting structures too deep. In either case *this should not be used
|
86
86
|
// again.
|
87
|
-
|
87
|
+
[[nodiscard]] bool Parse() && {
|
88
88
|
// Recursively parses the grammar production named by callee, then resumes
|
89
89
|
// execution at the next statement.
|
90
90
|
//
|
@@ -564,7 +564,7 @@ class RustSymbolParser {
|
|
564
564
|
|
565
565
|
// If the next input character is the given character, consumes it and returns
|
566
566
|
// true; otherwise returns false without consuming a character.
|
567
|
-
|
567
|
+
[[nodiscard]] bool Eat(char want) {
|
568
568
|
if (encoding_[pos_] != want) return false;
|
569
569
|
++pos_;
|
570
570
|
return true;
|
@@ -573,7 +573,7 @@ class RustSymbolParser {
|
|
573
573
|
// Provided there is enough remaining output space, appends c to the output,
|
574
574
|
// writing a fresh NUL terminator afterward, and returns true. Returns false
|
575
575
|
// if the output buffer had less than two bytes free.
|
576
|
-
|
576
|
+
[[nodiscard]] bool EmitChar(char c) {
|
577
577
|
if (silence_depth_ > 0) return true;
|
578
578
|
if (out_end_ - out_ < 2) return false;
|
579
579
|
*out_++ = c;
|
@@ -584,7 +584,7 @@ class RustSymbolParser {
|
|
584
584
|
// Provided there is enough remaining output space, appends the C string token
|
585
585
|
// to the output, followed by a NUL character, and returns true. Returns
|
586
586
|
// false if not everything fit into the output buffer.
|
587
|
-
|
587
|
+
[[nodiscard]] bool Emit(const char* token) {
|
588
588
|
if (silence_depth_ > 0) return true;
|
589
589
|
const size_t token_length = std::strlen(token);
|
590
590
|
const size_t bytes_to_copy = token_length + 1; // token and final NUL
|
@@ -598,7 +598,7 @@ class RustSymbolParser {
|
|
598
598
|
// of disambiguator (if it's nonnegative) or "?" (if it's negative) to the
|
599
599
|
// output, followed by a NUL character, and returns true. Returns false if
|
600
600
|
// not everything fit into the output buffer.
|
601
|
-
|
601
|
+
[[nodiscard]] bool EmitDisambiguator(int disambiguator) {
|
602
602
|
if (disambiguator < 0) return EmitChar('?'); // parsed but too large
|
603
603
|
if (disambiguator == 0) return EmitChar('0');
|
604
604
|
// Convert disambiguator to decimal text. Three digits per byte is enough
|
@@ -618,7 +618,7 @@ class RustSymbolParser {
|
|
618
618
|
// On success returns true and fills value with the encoded value if it was
|
619
619
|
// not too big, otherwise with -1. If the optional disambiguator was omitted,
|
620
620
|
// value is 0. On parse failure returns false and sets value to -1.
|
621
|
-
|
621
|
+
[[nodiscard]] bool ParseDisambiguator(int& value) {
|
622
622
|
value = -1;
|
623
623
|
|
624
624
|
// disambiguator = s base-62-number
|
@@ -639,7 +639,7 @@ class RustSymbolParser {
|
|
639
639
|
// On success returns true and fills value with the encoded value if it was
|
640
640
|
// not too big, otherwise with -1. On parse failure returns false and sets
|
641
641
|
// value to -1.
|
642
|
-
|
642
|
+
[[nodiscard]] bool ParseBase62Number(int& value) {
|
643
643
|
value = -1;
|
644
644
|
|
645
645
|
// base-62-number = (digit | lower | upper)* _
|
@@ -686,7 +686,7 @@ class RustSymbolParser {
|
|
686
686
|
// A nonzero uppercase_namespace specifies the character after the N in a
|
687
687
|
// nested-identifier, e.g., 'C' for a closure, allowing ParseIdentifier to
|
688
688
|
// write out the name with the conventional decoration for that namespace.
|
689
|
-
|
689
|
+
[[nodiscard]] bool ParseIdentifier(char uppercase_namespace = '\0') {
|
690
690
|
// identifier -> disambiguator? undisambiguated-identifier
|
691
691
|
int disambiguator = 0;
|
692
692
|
if (!ParseDisambiguator(disambiguator)) return false;
|
@@ -703,7 +703,7 @@ class RustSymbolParser {
|
|
703
703
|
//
|
704
704
|
// At other appearances of undisambiguated-identifier in the grammar, this
|
705
705
|
// treatment is not applicable, and the call site omits both arguments.
|
706
|
-
|
706
|
+
[[nodiscard]] bool ParseUndisambiguatedIdentifier(
|
707
707
|
char uppercase_namespace = '\0', int disambiguator = 0) {
|
708
708
|
// undisambiguated-identifier -> u? decimal-number _? bytes
|
709
709
|
const bool is_punycoded = Eat('u');
|
@@ -766,7 +766,7 @@ class RustSymbolParser {
|
|
766
766
|
// Consumes a decimal number like 0 or 123 from the input. On success returns
|
767
767
|
// true and fills value with the encoded value. If the encoded value is too
|
768
768
|
// large or otherwise unparsable, returns false and sets value to -1.
|
769
|
-
|
769
|
+
[[nodiscard]] bool ParseDecimalNumber(int& value) {
|
770
770
|
value = -1;
|
771
771
|
if (!IsDigit(Peek())) return false;
|
772
772
|
int encoded_number = Take() - '0';
|
@@ -788,7 +788,7 @@ class RustSymbolParser {
|
|
788
788
|
// Consumes a binder of higher-ranked lifetimes if one is present. On success
|
789
789
|
// returns true and discards the encoded lifetime count. On parse failure
|
790
790
|
// returns false.
|
791
|
-
|
791
|
+
[[nodiscard]] bool ParseOptionalBinder() {
|
792
792
|
// binder -> G base-62-number
|
793
793
|
if (!Eat('G')) return true;
|
794
794
|
int ignored_binding_count;
|
@@ -802,7 +802,7 @@ class RustSymbolParser {
|
|
802
802
|
// things we omit from output, such as the entire contents of generic-args.
|
803
803
|
//
|
804
804
|
// On parse failure returns false.
|
805
|
-
|
805
|
+
[[nodiscard]] bool ParseOptionalLifetime() {
|
806
806
|
// lifetime -> L base-62-number
|
807
807
|
if (!Eat('L')) return true;
|
808
808
|
int ignored_de_bruijn_index;
|
@@ -811,14 +811,14 @@ class RustSymbolParser {
|
|
811
811
|
|
812
812
|
// Consumes a lifetime just like ParseOptionalLifetime, but returns false if
|
813
813
|
// there is no lifetime here.
|
814
|
-
|
814
|
+
[[nodiscard]] bool ParseRequiredLifetime() {
|
815
815
|
if (Peek() != 'L') return false;
|
816
816
|
return ParseOptionalLifetime();
|
817
817
|
}
|
818
818
|
|
819
819
|
// Pushes ns onto the namespace stack and returns true if the stack is not
|
820
820
|
// full, else returns false.
|
821
|
-
|
821
|
+
[[nodiscard]] bool PushNamespace(char ns) {
|
822
822
|
if (namespace_depth_ == kNamespaceStackSize) return false;
|
823
823
|
namespace_stack_[namespace_depth_++] = ns;
|
824
824
|
return true;
|
@@ -830,7 +830,7 @@ class RustSymbolParser {
|
|
830
830
|
|
831
831
|
// Pushes position onto the position stack and returns true if the stack is
|
832
832
|
// not full, else returns false.
|
833
|
-
|
833
|
+
[[nodiscard]] bool PushPosition(int position) {
|
834
834
|
if (position_depth_ == kPositionStackSize) return false;
|
835
835
|
position_stack_[position_depth_++] = position;
|
836
836
|
return true;
|
@@ -845,7 +845,7 @@ class RustSymbolParser {
|
|
845
845
|
// beginning of the backref target. Returns true on success. Returns false
|
846
846
|
// if parsing failed, the stack is exhausted, or the backref target position
|
847
847
|
// is out of range.
|
848
|
-
|
848
|
+
[[nodiscard]] bool BeginBackref() {
|
849
849
|
// backref = B base-62-number (B already consumed)
|
850
850
|
//
|
851
851
|
// Reject backrefs that don't parse, overflow int, or don't point backward.
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
#include "absl/base/attributes.h"
|
20
20
|
#include "absl/debugging/internal/address_is_readable.h"
|
21
|
+
#include "absl/debugging/internal/addresses.h"
|
21
22
|
#include "absl/debugging/internal/vdso_support.h" // a no-op on non-elf or non-glibc systems
|
22
23
|
#include "absl/debugging/stacktrace.h"
|
23
24
|
|
@@ -101,7 +102,8 @@ static bool InsideSignalStack(void** ptr, const StackInfo* stack_info) {
|
|
101
102
|
// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned.
|
102
103
|
template<bool STRICT_UNWINDING, bool WITH_CONTEXT>
|
103
104
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
104
|
-
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY
|
105
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
106
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
105
107
|
static void **NextStackFrame(void **old_frame_pointer, const void *uc,
|
106
108
|
const StackInfo *stack_info) {
|
107
109
|
void **new_frame_pointer = reinterpret_cast<void**>(*old_frame_pointer);
|
@@ -124,6 +126,7 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
|
|
124
126
|
if (pre_signal_frame_pointer >= old_frame_pointer) {
|
125
127
|
new_frame_pointer = pre_signal_frame_pointer;
|
126
128
|
}
|
129
|
+
}
|
127
130
|
}
|
128
131
|
#endif
|
129
132
|
|
@@ -131,17 +134,13 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
|
|
131
134
|
if ((reinterpret_cast<uintptr_t>(new_frame_pointer) & 7) != 0)
|
132
135
|
return nullptr;
|
133
136
|
|
134
|
-
|
135
|
-
// prevent "double fault" in case we hit the first fault due to e.g.
|
136
|
-
// stack corruption.
|
137
|
-
if (!absl::debugging_internal::AddressIsReadable(
|
138
|
-
new_frame_pointer))
|
139
|
-
return nullptr;
|
140
|
-
}
|
141
|
-
|
137
|
+
uintptr_t new_fp_comparable = reinterpret_cast<uintptr_t>(new_frame_pointer);
|
142
138
|
// Only check the size if both frames are in the same stack.
|
143
|
-
|
144
|
-
InsideSignalStack(old_frame_pointer, stack_info)
|
139
|
+
const bool old_inside_signal_stack =
|
140
|
+
InsideSignalStack(old_frame_pointer, stack_info);
|
141
|
+
const bool new_inside_signal_stack =
|
142
|
+
InsideSignalStack(new_frame_pointer, stack_info);
|
143
|
+
if (new_inside_signal_stack == old_inside_signal_stack) {
|
145
144
|
// Check frame size. In strict mode, we assume frames to be under
|
146
145
|
// 100,000 bytes. In non-strict mode, we relax the limit to 1MB.
|
147
146
|
const size_t max_size = STRICT_UNWINDING ? 100000 : 1000000;
|
@@ -155,16 +154,15 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
|
|
155
154
|
if (frame_size > max_size) {
|
156
155
|
size_t stack_low = stack_info->stack_low;
|
157
156
|
size_t stack_high = stack_info->stack_high;
|
158
|
-
if (
|
157
|
+
if (new_inside_signal_stack) {
|
159
158
|
stack_low = stack_info->sig_stack_low;
|
160
159
|
stack_high = stack_info->sig_stack_high;
|
161
160
|
}
|
162
161
|
if (stack_high < kUnknownStackEnd &&
|
163
162
|
static_cast<size_t>(getpagesize()) < stack_low) {
|
164
|
-
const uintptr_t new_fp_u =
|
165
|
-
reinterpret_cast<uintptr_t>(new_frame_pointer);
|
166
163
|
// Stack bounds are known.
|
167
|
-
if (!(stack_low <
|
164
|
+
if (!(stack_low < new_fp_comparable &&
|
165
|
+
new_fp_comparable <= stack_high)) {
|
168
166
|
// new_frame_pointer is not within a known stack.
|
169
167
|
return nullptr;
|
170
168
|
}
|
@@ -174,24 +172,19 @@ static void **NextStackFrame(void **old_frame_pointer, const void *uc,
|
|
174
172
|
}
|
175
173
|
}
|
176
174
|
}
|
175
|
+
// New frame pointer is valid if it is inside either known stack or readable.
|
176
|
+
// This assumes that everything within either known stack is readable. Outside
|
177
|
+
// either known stack but readable is unexpected, and possibly corrupt, but
|
178
|
+
// for now assume it is valid. If it isn't actually valid, the next frame will
|
179
|
+
// be corrupt and we will detect that next iteration.
|
180
|
+
if (new_inside_signal_stack ||
|
181
|
+
(new_fp_comparable >= stack_info->stack_low &&
|
182
|
+
new_fp_comparable < stack_info->stack_high) ||
|
183
|
+
absl::debugging_internal::AddressIsReadable(new_frame_pointer)) {
|
184
|
+
return new_frame_pointer;
|
185
|
+
}
|
177
186
|
|
178
|
-
return
|
179
|
-
}
|
180
|
-
|
181
|
-
// When PAC-RET (-mbranch-protection=pac-ret) is enabled, return addresses
|
182
|
-
// stored on the stack will be signed, which means that pointer bits outside of
|
183
|
-
// the VA range are potentially set. Since the stacktrace code is expected to
|
184
|
-
// return normal code pointers, this function clears those bits.
|
185
|
-
inline void* ClearPacBits(void* ptr) {
|
186
|
-
register void* x30 __asm__("x30") = ptr;
|
187
|
-
// The normal instruction for clearing PAC bits is XPACI, but for
|
188
|
-
// compatibility with ARM platforms that do not support pointer
|
189
|
-
// authentication, we use the hint space instruction XPACLRI instead. Hint
|
190
|
-
// space instructions behave as NOPs on unsupported platforms.
|
191
|
-
#define ABSL_XPACLRI_HINT "hint #0x7;"
|
192
|
-
asm(ABSL_XPACLRI_HINT : "+r"(x30)); // asm("xpaclri" : "+r"(x30));
|
193
|
-
#undef ABSL_XPACLRI_HINT
|
194
|
-
return x30;
|
187
|
+
return nullptr;
|
195
188
|
}
|
196
189
|
|
197
190
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
@@ -200,8 +193,10 @@ template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
|
200
193
|
ABSL_ATTRIBUTE_NOINLINE
|
201
194
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
202
195
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
203
|
-
|
204
|
-
|
196
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
197
|
+
static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
198
|
+
int max_depth, int skip_count, const void *ucp,
|
199
|
+
int *min_dropped_frames) {
|
205
200
|
#ifdef __GNUC__
|
206
201
|
void **frame_pointer = reinterpret_cast<void**>(__builtin_frame_address(0));
|
207
202
|
#else
|
@@ -235,10 +230,18 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
|
|
235
230
|
if (skip_count > 0) {
|
236
231
|
skip_count--;
|
237
232
|
} else {
|
238
|
-
result[n] =
|
233
|
+
result[n] = reinterpret_cast<void *>(
|
234
|
+
absl::debugging_internal::StripPointerMetadata(prev_return_address));
|
239
235
|
if (IS_STACK_FRAMES) {
|
240
|
-
|
241
|
-
|
236
|
+
if (frames != nullptr) {
|
237
|
+
frames[n] = absl::debugging_internal::StripPointerMetadata(
|
238
|
+
prev_frame_pointer) +
|
239
|
+
2 * sizeof(void *) /* go past the return address */;
|
240
|
+
}
|
241
|
+
if (sizes != nullptr) {
|
242
|
+
sizes[n] = static_cast<int>(
|
243
|
+
ComputeStackFrameSize(prev_frame_pointer, frame_pointer));
|
244
|
+
}
|
242
245
|
}
|
243
246
|
n++;
|
244
247
|
}
|
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
#include <cstdint>
|
21
21
|
|
22
|
+
#include "absl/debugging/internal/addresses.h"
|
22
23
|
#include "absl/debugging/stacktrace.h"
|
23
24
|
|
24
25
|
// WARNING:
|
@@ -67,8 +68,9 @@ void StacktraceArmDummyFunction() { __asm__ volatile(""); }
|
|
67
68
|
#endif
|
68
69
|
|
69
70
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
70
|
-
static int UnwindImpl(void**
|
71
|
-
const void * /* ucp */,
|
71
|
+
static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
72
|
+
int max_depth, int skip_count, const void * /* ucp */,
|
73
|
+
int *min_dropped_frames) {
|
72
74
|
#ifdef __GNUC__
|
73
75
|
void **sp = reinterpret_cast<void**>(__builtin_frame_address(0));
|
74
76
|
#else
|
@@ -97,11 +99,18 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
|
|
97
99
|
result[n] = *sp;
|
98
100
|
|
99
101
|
if (IS_STACK_FRAMES) {
|
100
|
-
if (
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
if (frames != nullptr) {
|
103
|
+
frames[n] = absl::debugging_internal::StripPointerMetadata(sp) +
|
104
|
+
1 * sizeof(void *) /* go past the return address */;
|
105
|
+
}
|
106
|
+
if (sizes != nullptr) {
|
107
|
+
if (next_sp > sp) {
|
108
|
+
sizes[n] = absl::debugging_internal::StripPointerMetadata(next_sp) -
|
109
|
+
absl::debugging_internal::StripPointerMetadata(sp);
|
110
|
+
} else {
|
111
|
+
// A frame-size of 0 is used to indicate unknown frame size.
|
112
|
+
sizes[n] = 0;
|
113
|
+
}
|
105
114
|
}
|
106
115
|
}
|
107
116
|
n++;
|
@@ -21,8 +21,10 @@
|
|
21
21
|
#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_EMSCRIPTEN_INL_H_
|
22
22
|
|
23
23
|
#include <emscripten.h>
|
24
|
+
#include <stdint.h>
|
24
25
|
|
25
26
|
#include <atomic>
|
27
|
+
#include <cstddef>
|
26
28
|
#include <cstring>
|
27
29
|
|
28
30
|
#include "absl/base/attributes.h"
|
@@ -62,8 +64,9 @@ ABSL_ATTRIBUTE_UNUSED static int stacktraces_enabler = []() {
|
|
62
64
|
}();
|
63
65
|
|
64
66
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
65
|
-
static int UnwindImpl(void **result,
|
66
|
-
const void *ucp,
|
67
|
+
static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
68
|
+
int max_depth, int skip_count, const void *ucp,
|
69
|
+
int *min_dropped_frames) {
|
67
70
|
if (recursive || disable_stacktraces.load(std::memory_order_relaxed)) {
|
68
71
|
return 0;
|
69
72
|
}
|
@@ -75,7 +78,8 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
|
|
75
78
|
|
76
79
|
int size;
|
77
80
|
uintptr_t pc = emscripten_stack_snapshot();
|
78
|
-
size =
|
81
|
+
size =
|
82
|
+
static_cast<int>(emscripten_stack_unwind_buffer(pc, stack, kStackLength));
|
79
83
|
|
80
84
|
int result_count = size - skip_count;
|
81
85
|
if (result_count < 0) result_count = 0;
|
@@ -83,8 +87,13 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
|
|
83
87
|
for (int i = 0; i < result_count; i++) result[i] = stack[i + skip_count];
|
84
88
|
|
85
89
|
if (IS_STACK_FRAMES) {
|
86
|
-
// No implementation for finding out the stack
|
87
|
-
|
90
|
+
// No implementation for finding out the stack frames yet.
|
91
|
+
if (frames != nullptr) {
|
92
|
+
memset(frames, 0, sizeof(*frames) * static_cast<size_t>(result_count));
|
93
|
+
}
|
94
|
+
if (sizes != nullptr) {
|
95
|
+
memset(sizes, 0, sizeof(*sizes) * static_cast<size_t>(result_count));
|
96
|
+
}
|
88
97
|
}
|
89
98
|
if (min_dropped_frames != nullptr) {
|
90
99
|
if (size - skip_count - max_depth > 0) {
|
@@ -56,8 +56,9 @@ ABSL_ATTRIBUTE_UNUSED static int stacktraces_enabler = []() {
|
|
56
56
|
}();
|
57
57
|
|
58
58
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
59
|
-
static int UnwindImpl(void** result,
|
60
|
-
|
59
|
+
static int UnwindImpl(void** result, uintptr_t* frames, int* sizes,
|
60
|
+
int max_depth, int skip_count, const void* ucp,
|
61
|
+
int* min_dropped_frames) {
|
61
62
|
if (recursive || disable_stacktraces.load(std::memory_order_relaxed)) {
|
62
63
|
return 0;
|
63
64
|
}
|
@@ -79,8 +80,13 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
|
|
79
80
|
result[i] = stack[i + skip_count];
|
80
81
|
|
81
82
|
if (IS_STACK_FRAMES) {
|
82
|
-
// No implementation for finding out the stack
|
83
|
-
|
83
|
+
// No implementation for finding out the stack frames yet.
|
84
|
+
if (frames != nullptr) {
|
85
|
+
memset(frames, 0, sizeof(*frames) * static_cast<size_t>(result_count));
|
86
|
+
}
|
87
|
+
if (sizes != nullptr) {
|
88
|
+
memset(sizes, 0, sizeof(*sizes) * static_cast<size_t>(result_count));
|
89
|
+
}
|
84
90
|
}
|
85
91
|
if (min_dropped_frames != nullptr) {
|
86
92
|
if (size - skip_count - max_depth > 0) {
|
@@ -21,6 +21,7 @@
|
|
21
21
|
#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_POWERPC_INL_H_
|
22
22
|
#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_POWERPC_INL_H_
|
23
23
|
|
24
|
+
#include "absl/debugging/internal/addresses.h"
|
24
25
|
#if defined(__linux__)
|
25
26
|
#include <asm/ptrace.h> // for PT_NIP.
|
26
27
|
#include <ucontext.h> // for ucontext_t
|
@@ -40,22 +41,22 @@
|
|
40
41
|
|
41
42
|
// Given a stack pointer, return the saved link register value.
|
42
43
|
// Note that this is the link register for a callee.
|
43
|
-
static inline void
|
44
|
+
static inline void **StacktracePowerPCGetLRPtr(void **sp) {
|
44
45
|
// PowerPC has 3 main ABIs, which say where in the stack the
|
45
46
|
// Link Register is. For DARWIN and AIX (used by apple and
|
46
47
|
// linux ppc64), it's in sp[2]. For SYSV (used by linux ppc),
|
47
48
|
// it's in sp[1].
|
48
49
|
#if defined(_CALL_AIX) || defined(_CALL_DARWIN)
|
49
|
-
return
|
50
|
+
return (sp + 2);
|
50
51
|
#elif defined(_CALL_SYSV)
|
51
|
-
return
|
52
|
+
return (sp + 1);
|
52
53
|
#elif defined(__APPLE__) || defined(__FreeBSD__) || \
|
53
54
|
(defined(__linux__) && defined(__PPC64__))
|
54
55
|
// This check is in case the compiler doesn't define _CALL_AIX/etc.
|
55
|
-
return
|
56
|
+
return (sp + 2);
|
56
57
|
#elif defined(__linux)
|
57
58
|
// This check is in case the compiler doesn't define _CALL_SYSV.
|
58
|
-
return
|
59
|
+
return (sp + 1);
|
59
60
|
#else
|
60
61
|
#error Need to specify the PPC ABI for your architecture.
|
61
62
|
#endif
|
@@ -68,6 +69,7 @@ static inline void *StacktracePowerPCGetLR(void **sp) {
|
|
68
69
|
template<bool STRICT_UNWINDING, bool IS_WITH_CONTEXT>
|
69
70
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
70
71
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
72
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
71
73
|
static void **NextStackFrame(void **old_sp, const void *uc) {
|
72
74
|
void **new_sp = (void **) *old_sp;
|
73
75
|
enum { kStackAlignment = 16 };
|
@@ -125,9 +127,8 @@ static void **NextStackFrame(void **old_sp, const void *uc) {
|
|
125
127
|
}
|
126
128
|
}
|
127
129
|
|
128
|
-
if (new_sp != nullptr &&
|
129
|
-
|
130
|
-
StacktracePowerPCGetLR(new_sp) == kernel_sigtramp_rt64_address) {
|
130
|
+
if (new_sp != nullptr && kernel_symbol_status == kAddressValid &&
|
131
|
+
*StacktracePowerPCGetLRPtr(new_sp) == kernel_sigtramp_rt64_address) {
|
131
132
|
const ucontext_t* signal_context =
|
132
133
|
reinterpret_cast<const ucontext_t*>(uc);
|
133
134
|
void **const sp_before_signal =
|
@@ -164,8 +165,10 @@ ABSL_ATTRIBUTE_NOINLINE static void AbslStacktracePowerPCDummyFunction() {
|
|
164
165
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
165
166
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
166
167
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
167
|
-
|
168
|
-
|
168
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
169
|
+
static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
170
|
+
int max_depth, int skip_count, const void *ucp,
|
171
|
+
int *min_dropped_frames) {
|
169
172
|
void **sp;
|
170
173
|
// Apple macOS uses an old version of gnu as -- both Darwin 7.9.0 (Panther)
|
171
174
|
// and Darwin 8.8.1 (Tiger) use as 1.38. This means we have to use a
|
@@ -211,13 +214,21 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count,
|
|
211
214
|
if (skip_count > 0) {
|
212
215
|
skip_count--;
|
213
216
|
} else {
|
214
|
-
|
217
|
+
void **lr = StacktracePowerPCGetLRPtr(sp);
|
218
|
+
result[n] = *lr;
|
215
219
|
if (IS_STACK_FRAMES) {
|
216
|
-
if (
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
220
|
+
if (frames != nullptr) {
|
221
|
+
frames[n] = absl::debugging_internal::StripPointerMetadata(lr) +
|
222
|
+
1 * sizeof(void *) /* go past the return address */;
|
223
|
+
}
|
224
|
+
if (sizes != nullptr) {
|
225
|
+
if (next_sp > sp) {
|
226
|
+
sizes[n] = absl::debugging_internal::StripPointerMetadata(next_sp) -
|
227
|
+
absl::debugging_internal::StripPointerMetadata(sp);
|
228
|
+
} else {
|
229
|
+
// A frame-size of 0 is used to indicate unknown frame size.
|
230
|
+
sizes[n] = 0;
|
231
|
+
}
|
221
232
|
}
|
222
233
|
}
|
223
234
|
n++;
|
@@ -20,6 +20,7 @@
|
|
20
20
|
#include <sys/ucontext.h>
|
21
21
|
|
22
22
|
#include "absl/base/config.h"
|
23
|
+
#include "absl/debugging/internal/addresses.h"
|
23
24
|
#if defined(__linux__)
|
24
25
|
#include <sys/mman.h>
|
25
26
|
#include <ucontext.h>
|
@@ -55,6 +56,7 @@ static inline ptrdiff_t ComputeStackFrameSize(const T *low, const T *high) {
|
|
55
56
|
template <bool STRICT_UNWINDING, bool WITH_CONTEXT>
|
56
57
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
57
58
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
59
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
58
60
|
static void ** NextStackFrame(void **old_frame_pointer, const void *uc,
|
59
61
|
const std::pair<size_t, size_t> range) {
|
60
62
|
// .
|
@@ -117,8 +119,10 @@ static void ** NextStackFrame(void **old_frame_pointer, const void *uc,
|
|
117
119
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
118
120
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
119
121
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
120
|
-
|
121
|
-
|
122
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
123
|
+
static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
124
|
+
int max_depth, int skip_count, const void *ucp,
|
125
|
+
int *min_dropped_frames) {
|
122
126
|
// The `frame_pointer` that is computed here points to the top of the frame.
|
123
127
|
// The two words preceding the address are the return address and the previous
|
124
128
|
// frame pointer.
|
@@ -153,8 +157,13 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
|
|
153
157
|
result[n] = return_address;
|
154
158
|
if (IS_STACK_FRAMES) {
|
155
159
|
// NextStackFrame() has already checked that frame size fits to int
|
156
|
-
|
157
|
-
|
160
|
+
if (frames != nullptr) {
|
161
|
+
frames[n] =
|
162
|
+
absl::debugging_internal::StripPointerMetadata(frame_pointer);
|
163
|
+
}
|
164
|
+
if (sizes != nullptr) {
|
165
|
+
sizes[n] = ComputeStackFrameSize(frame_pointer, next_frame_pointer);
|
166
|
+
}
|
158
167
|
}
|
159
168
|
n++;
|
160
169
|
}
|
@@ -2,9 +2,10 @@
|
|
2
2
|
#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_UNIMPLEMENTED_INL_H_
|
3
3
|
|
4
4
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
5
|
-
static int UnwindImpl(void** /* result */,
|
6
|
-
int /*
|
7
|
-
const void* /* ucp */,
|
5
|
+
static int UnwindImpl(void** /* result */, uintptr_t* /* frames */,
|
6
|
+
int* /* sizes */, int /* max_depth */,
|
7
|
+
int /* skip_count */, const void* /* ucp */,
|
8
|
+
int* min_dropped_frames) {
|
8
9
|
if (min_dropped_frames != nullptr) {
|
9
10
|
*min_dropped_frames = 0;
|
10
11
|
}
|
@@ -37,42 +37,29 @@
|
|
37
37
|
#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_WIN32_INL_H_
|
38
38
|
#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_WIN32_INL_H_
|
39
39
|
|
40
|
-
#include <windows.h>
|
41
|
-
#include <cassert>
|
42
|
-
|
43
|
-
typedef USHORT NTAPI RtlCaptureStackBackTrace_Function(
|
44
|
-
IN ULONG frames_to_skip,
|
45
|
-
IN ULONG frames_to_capture,
|
46
|
-
OUT PVOID *backtrace,
|
47
|
-
OUT PULONG backtrace_hash);
|
40
|
+
#include <windows.h> // CaptureStackBackTrace
|
48
41
|
|
49
|
-
|
50
|
-
// UWP. CaptureStackBackTrace is the public version of RtlCaptureStackBackTrace
|
51
|
-
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
|
52
|
-
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
53
|
-
static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn =
|
54
|
-
&::CaptureStackBackTrace;
|
55
|
-
#else
|
56
|
-
// Load the function we need at static init time, where we don't have
|
57
|
-
// to worry about someone else holding the loader's lock.
|
58
|
-
static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn =
|
59
|
-
(RtlCaptureStackBackTrace_Function*)GetProcAddress(
|
60
|
-
GetModuleHandleA("ntdll.dll"), "RtlCaptureStackBackTrace");
|
61
|
-
#endif // WINAPI_PARTITION_APP && !WINAPI_PARTITION_DESKTOP
|
42
|
+
#include <cassert>
|
62
43
|
|
63
44
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
64
|
-
static int UnwindImpl(void** result,
|
65
|
-
|
45
|
+
static int UnwindImpl(void** result, uintptr_t* frames, int* sizes,
|
46
|
+
int max_depth, int skip_count, const void*,
|
47
|
+
int* min_dropped_frames) {
|
66
48
|
USHORT n = 0;
|
67
|
-
if (
|
49
|
+
if (skip_count < 0 || max_depth < 0) {
|
68
50
|
// can't get a stacktrace with no function/invalid args
|
69
51
|
} else {
|
70
|
-
n =
|
71
|
-
|
52
|
+
n = CaptureStackBackTrace(static_cast<ULONG>(skip_count) + 2,
|
53
|
+
static_cast<ULONG>(max_depth), result, 0);
|
72
54
|
}
|
73
55
|
if (IS_STACK_FRAMES) {
|
74
|
-
// No implementation for finding out the stack
|
75
|
-
|
56
|
+
// No implementation for finding out the stack frames yet.
|
57
|
+
if (frames != nullptr) {
|
58
|
+
memset(frames, 0, sizeof(*frames) * n);
|
59
|
+
}
|
60
|
+
if (sizes != nullptr) {
|
61
|
+
memset(sizes, 0, sizeof(*sizes) * n);
|
62
|
+
}
|
76
63
|
}
|
77
64
|
if (min_dropped_frames != nullptr) {
|
78
65
|
// Not implemented.
|