| ... | ... | @@ -855,6 +855,18 @@ const StackIterator = union(enum) { |
| 855 | 855 | } |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | /// Some architectures make FP unwinding too impractical. For example, due to its very silly ABI |
| 859 | /// design decisions, it's not possible to do generic FP unwinding on MIPS; we would need to do |
| 860 | /// a complicated code scanning algorithm instead. At that point, we may as well just use DWARF. |
| 861 | const fp_unwind_is_impossible = switch (builtin.cpu.arch) { |
| 862 | .mips, |
| 863 | .mipsel, |
| 864 | .mips64, |
| 865 | .mips64el, |
| 866 | => true, |
| 867 | else => false, |
| 868 | }; |
| 869 | |
| 858 | 870 | /// <https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Respect-the-purpose-of-specific-CPU-registers> |
| 859 | 871 | const fp_unwind_is_safe = builtin.cpu.arch == .aarch64 and builtin.os.tag.isDarwin(); |
| 860 | 872 | |
| ... | ... | @@ -879,7 +891,14 @@ const StackIterator = union(enum) { |
| 879 | 891 | // immediately regardless of anything. But FPs could also be omitted from a different |
| 880 | 892 | // linked object, so it's not guaranteed to be safe, unless the target specifically |
| 881 | 893 | // requires it. |
| 882 | | .fp => abi_requires_backchain or (!builtin.omit_frame_pointer and (fp_unwind_is_safe or allow_unsafe)), |
| 894 | .fp => s: { |
| 895 | if (fp_unwind_is_impossible) break :s false; |
| 896 | if (abi_requires_backchain) break :s true; |
| 897 | if (builtin.omit_frame_pointer) break :s false; |
| 898 | if (fp_unwind_is_safe) break :s true; |
| 899 | if (allow_unsafe) break :s true; |
| 900 | break :s false; |
| 901 | }, |
| 883 | 902 | }; |
| 884 | 903 | } |
| 885 | 904 | |