diff options
author | Abseil Team <absl-team@google.com> | 2020-06-03 14:03:13 -0700 |
---|---|---|
committer | Gennadiy Rozental <rogeeff@google.com> | 2020-06-03 18:19:47 -0400 |
commit | 1d31b5c365e975d3c8a8f90492c3d9de35ef024f (patch) | |
tree | fbc8093e8aad757b8790fb2688c0e4694e082fa4 /absl/debugging/internal/examine_stack.cc | |
parent | da3a87690c56f965705b6a233d25ba5a3294067c (diff) |
Export of internal Abseil changes
--
9e8b4a286d70df9487bff080816bd07ae38af5f8 by Evan Brown <ezb@google.com>:
Add btree_node::transfer_n/transfer_n_backward and replace usage of uninitialized_move_n and value_destroy_n.
PiperOrigin-RevId: 314600027
--
6c452aa1ee7e46ab941ba7d1fa636da8ea3d7370 by Laramie Leavitt <lar@google.com>:
Remove the MockingBitGenBase base class in favor of type-erasure in BitGenRef.
In Abseil random, mocking was split across two different classes,
MockingBitGenBase and MockingBitGen. This split existed because Google Mock is a
test-only library that we don't link into production, so MockingBitGenBase
provided a low-overhead scaffold used to lookup mocks when in test code, but
which is unused in production code.
That has been replaced by type-erasure which looks for a method named
CallImpl with the correct signature.
Weaken the coupling between MockingBitGen, DistributionCaller, and MockOverloadSet.
Rename CallImpl to InvokeMock()
Previously, the implementation of DistributionCaller was also split across different files using explicit instantiation of the DistributionCaller struct and some details in the Mocking classes. Now Distribution caller uses the presence of the InvokeMock() method to choose whether to use the mockable call path or the default call path.
PiperOrigin-RevId: 314584095
--
07853c47dc98698d67d65a3b9b662a65ab9def0a by Abseil Team <absl-team@google.com>:
Add PC / backtrace / symbolization support for Apple platforms.
Full backtrace support requires iOS 9+
PiperOrigin-RevId: 314415072
--
43889f17a132b31f6558c6482721cbbc776128fd by Gennadiy Rozental <rogeeff@google.com>:
Consolidate all reflection interface in the new module 'reflection' and expose interface to locate reflection handle by name.
PiperOrigin-RevId: 314390358
GitOrigin-RevId: 9e8b4a286d70df9487bff080816bd07ae38af5f8
Change-Id: I8e0910437740cf9ea9da5000adddfcef127e1158
Diffstat (limited to 'absl/debugging/internal/examine_stack.cc')
-rw-r--r-- | absl/debugging/internal/examine_stack.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc index a3dd893a..6e5ff1fb 100644 --- a/absl/debugging/internal/examine_stack.cc +++ b/absl/debugging/internal/examine_stack.cc @@ -20,6 +20,10 @@ #include <unistd.h> #endif +#ifdef __APPLE__ +#include <sys/ucontext.h> +#endif + #include <csignal> #include <cstdio> @@ -66,6 +70,32 @@ void* GetProgramCounter(void* vuc) { #error "Undefined Architecture." #endif } +#elif defined(__APPLE__) + if (vuc != nullptr) { + ucontext_t* signal_ucontext = reinterpret_cast<ucontext_t*>(vuc); +#if defined(__aarch64__) + return reinterpret_cast<void*>( + __darwin_arm_thread_state64_get_pc(signal_ucontext->uc_mcontext->__ss)); +#elif defined(__arm__) +#if __DARWIN_UNIX03 + return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->__ss.__pc); +#else + return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->ss.pc); +#endif +#elif defined(__i386__) +#if __DARWIN_UNIX03 + return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->__ss.__eip); +#else + return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->ss.eip); +#endif +#elif defined(__x86_64__) +#if __DARWIN_UNIX03 + return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->__ss.__rip); +#else + return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->ss.rip); +#endif +#endif + } #elif defined(__akaros__) auto* ctx = reinterpret_cast<struct user_context*>(vuc); return reinterpret_cast<void*>(get_user_ctx_pc(ctx)); |