| // Copyright 2026 The Fuchsia Authors | |
| // | |
| // Use of this source code is governed by a MIT-style | |
| // license that can be found in the LICENSE file or at | |
| // https://opensource.org/licenses/MIT | |
| #include <lib/backtrace.h> | |
| #include <lib/object-constants.h> | |
| #include <stddef.h> | |
| #include <ktl/type_traits.h> | |
| // The layout is shared with the Rust `Backtrace` in //zircon/kernel/lib/backtrace/src/mod.rs. | |
| struct BacktraceLayoutCheck { | |
| static_assert(ktl::is_standard_layout_v<Backtrace>); | |
| static_assert(ktl::is_trivially_copyable_v<Backtrace>); | |
| static_assert(sizeof(Backtrace) == kBacktraceSize); | |
| static_assert(alignof(Backtrace) == kBacktraceAlign); | |
| static_assert(Backtrace::kMaxSize == 32); | |
| static_assert(offsetof(Backtrace, addr_) == 0); | |
| static_assert(offsetof(Backtrace, size_) == 256); | |
| static_assert(offsetof(Backtrace, first_frame_type_) == 264); | |
| static_assert(sizeof(Backtrace::FrameType) == 4); | |
| static_assert(alignof(Backtrace::FrameType) == 4); | |
| static_assert(Backtrace::FrameType::ReturnAddress == 0); | |
| static_assert(Backtrace::FrameType::PreciseLocation == 1); | |
| }; |