This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //! This whole file is meant to be exposed as `@import("root").debug`. Everything `pub` here is an | |
| //! override which the standard library will use. | |
| /// This is the allocator which `std.debug` will use to allocate debug info. On freestanding you | |
| /// usually just want to use a `std.heap.FixedBufferAllocator` for this---unless you have a proper | |
| /// memory manager working of course! | |
| pub fn getDebugInfoAllocator() Allocator { | |
| const Global = struct { | |
| /// If you see OOM errors in stack traces, try increasing the size of this buffer. This is | |
| /// 16 MiB, which is about 4x what ClashOS has been observed to use. The amount of memory is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //! This is the bespoke script which finds the DWARF sections and copies them all to where we want | |
| //! them in the `.rodata` section. It's quite primitive, but works fine for ClashOS at least! I'm | |
| //! not going to explain this toooo in-depth; if you want to understand it you'll need to know a bit | |
| //! about how ELF files are structured, feel free to ask me. | |
| // zig fmt: off | |
| /// You might need to modify this, since RISC-V binaries might have some slightly different fields | |
| /// here compared to AArch64 binaries. | |
| const expect_e_ident: *const [16]u8 = &.{ | |
| 0x7F, 'E', 'L', 'F', |
OlderNewer