getStringGeneric
Function parameters
Parameters
- opt_str:?[]const u8
- offset:u64
Type definitions in this namespace
Types
- ExceptionFrameHeader
- This represents the decoded .eh_frame_hdr header
Initialize DWARF info.
Functions
- open
- Initialize DWARF info.
- findCompileUnit
- TODO: change this to binary searching the sorted compile unit list
- scanAllUnwindInfo
- If `.eh_frame_hdr` is present, then only the header needs to be parsed.
- scanCieFdeInfo
- Scan `.eh_frame` and `.debug_frame` and build a sorted list of FDEs for binary searching during
- compactUnwindToDwarfRegNumber
- Returns the DWARF register number for an x86_64 register number found in compact unwind info
- bad
- This function is to make it handy to comment out the return and make it
Error sets in this namespace
Error Sets
= [_]?Section{null} ** num_sections
Values
- null_section_array
- = [_]?Section{null} ** num_sections
Source
Implementation
fn getStringGeneric(opt_str: ?[]const u8, offset: u64) ![:0]const u8 {
const str = opt_str orelse return bad();
if (offset > str.len) return bad();
const casted_offset = cast(usize, offset) orelse return bad();
// Valid strings always have a terminating zero byte
const last = std.mem.indexOfScalarPos(u8, str, casted_offset, 0) orelse return bad();
return str[casted_offset..last :0];
}