aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
AgeCommit message (Collapse)Author
2023-07-20debug: fixup base address calculations for machokcbanner
dwarf: fixup x86 register mapping logic dwarf: change the register context update to update in-place instead of copying debug: always print the unwind error type
2023-07-20dwarf: don't dupe function names, as they are backed by the memory mapped ↵kcbanner
sections dwarf: const-correctness fixups dwarf: implement the remaining register rules dwarf: start implmenting the DWARF expression stack machine
2023-07-20debug: rework how unwind errors are printed, and add module name lookup for ↵kcbanner
linux This change enhances stack trace output to include a note that debug info was missing, and therefore the stack trace may not be accurate. For example, if the user is using a libc compiled with -fomit-frame-pointer and doesn't have debug symbols installed, any traces that begin in a libc function may not unwind correctly. This allows the user to notice this and potentially install debug symbols to improve the output.
2023-07-20debug: de-duplicate some code in macos ModuleDebugInfokcbanner
2023-07-20c: fixup getcontextkcbanner
debug: supports_context -> have_ucontext, supports_getcontext -> have_getcontext test: rework dwarf_unwind test case to also test the non-libc path
2023-07-20c: add getcontextkcbanner
debug: make getContext public
2023-07-20debug: fix reading -gdwarf generated debug sections in COFF fileskcbanner
I had accidentally regressed support for -gdwarf in 461fb499f3cff9038a427eae120fb34defc9ab38 when I changed the logic to use the already-mapped exe/dll image instead of loading it from disk. The string table is mapped as all zeroes by the loader, so if a section header's name is longer than 8 bytes (like the ones generated by -gdwarf), then the name can't be read. Now, if any section headers require the string table, the file is mapped from disk. windows: Add NtCreateSection/NtMapViewOfSection/NtUnmapViewOfSection
2023-07-20linux: rework getcontext to closer match the specification (saved IP/SP ↵kcbanner
match the state after it would return) debug: fixup ucontext_t check
2023-07-20debug: x86 unwinding support, more unwinding fixeskcbanner
- Fix unwindFrame using the previous FDE row instead of the current one - Handle unwinding through noreturn functions - Add x86-linux getcontext - Fixup x86_64-linux getcontext not restoring the fp env - Fix start_addr filtering on x86-windows
2023-07-20debug: enhance writeCurrentStackTrace to use context-based unwinding when ↵kcbanner
available
2023-07-20update to new builtin syntaxkcbanner
2023-07-20- rebase and update to lastest masterkcbanner
2023-07-20dwarf: add support for .eh_frame_hdr when unwindingkcbanner
- .eh_frame_hdr contains a binary-searchable data structure for finding an FDE. If present, we can use this section to avoid having to parse the entire FDE/CIE list in the binary, instead only entries that are actually required for unwinding are read. - rework the inputs pc-relative pointer decoding to support both already-mapped sections as well as sections mapped from a file - store the VirtualMachine on UnwindContext so the allocations can be reused
2023-07-20debug: fix memory leak when an error occurs opening a pdb filekcbanner
2023-07-20debug: more fixups for mips linux not having ucontext_tkcbanner
- increase test-std max_rss to 1.1 above the CI observed amount
2023-07-20debug: fixing more compile errors on arches that I hadn't tested on yetkcbanner
2023-07-20debug: use an explicit context type instead of anytype for ↵kcbanner
dumpStackTraceFromBase, update crash_report to use this for exceptions
2023-07-20debug: fixup context detection for wasikcbanner
2023-07-20fmt and cleanupkcbanner
2023-07-20dwarf: implement more register mappings, fix up macos compilekcbanner
2023-07-20dwarf: implement more register number mappingskcbanner
- add dwarf.abi.RegisterContext to handle register numbers changing based on DWARF format
2023-07-20- rework StackIterator to optionally use debug_info to unwind the stackkcbanner
- add abi routines for getting register values - unwding is working!
2023-07-20add CommonInformationEntry parserkcbanner
2023-07-20debug: support loading elf debug info from external fileskcbanner
Some distributions (ie. Ubuntu) have their libc debug info in separate files. This change allows the stack walking code to read that debug info. - add support for reading compressed ELF sections - support reading the build-id from the elf headers in order to lookup external debug info - support reading the .gnu_debuglink section to look up external debug info
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-16migration: std.math.{min, min3, max, max3} -> `@min` & `@max`r00ster91
2023-06-13std.debug: remove `warn` (deprecated in 0.9)Eric Joldasov
Followup to 902df103c6151c257c90de9ba5f29f7f4b9dbea2. Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-29std.debug: disable sporadically failing testAndrew Kelley
This was observed to fail on aarch64-windows as well. See tracking issue #13963
2023-05-24std: Move std.debug.{TTY.Config,detectTTYConfig} to std.io.ttyLinus Groh
Also get rid of the TTY wrapper struct, which was exlusively used as a namespace - this is done by the tty.zig root struct now. detectTTYConfig has been renamed to just detectConfig, which is enough given the new namespace. Additionally, a doc comment had been added.
2023-05-24std.debug: Rename TTY.Color enum values to snake caseLinus Groh
2023-05-23std.sort: add pdqsort and heapsortAli Chraghi
2023-04-28std: update to use `@memcpy` directlyAndrew Kelley
2023-04-26enable debugging infrastructure when using C backendAndrew Kelley
Thanks to @jacobly0's recent enhancements to the C backend, this stuff works now.
2023-04-23Improvements to docs and textzooster
* docs(std.math): elaborate on difference between absCast and absInt * docs(std.rand.Random.weightedIndex): elaborate on likelihood I think this makes it easier to understand. * langref: add small reminder * docs(std.fs.path.extension): brevity * docs(std.bit_set.StaticBitSet): mention the specific types * std.debug.TTY: explain what purpose this struct serves This should also make it clearer that this struct is not supposed to provide unrelated terminal manipulation functionality such as setting the cursor position or something because terminals are complicated and we should keep this struct simple and focused on debugging. * langref(package listing): brevity * langref: explain what exactly `threadlocal` causes to happen * std.array_list: link between swapRemove and orderedRemove Maybe this can serve as a TLDR and make it easier to decide. * PrefetchOptions.locality: clarify docs that this is a range This confused me previously and I thought I can only use either 0 or 3. * fix typos and more * std.builtin.CallingConvention: document some CCs * langref: explain possibly cryptic names I think it helps knowing what exactly these acronyms (@clz and @ctz) and abbreviations (@popCount) mean. * variadic function error: add missing preposition * std.fmt.format docs: nicely hyphenate * help menu: say what to optimize for I think this is slightly more specific than just calling it "optimizations". These are speed optimizations. I used the word "performance" here.
2023-04-21cbe: enable CI for std testsJacob Young
2023-04-18debug: fix missing stack traces during crashes on windowskcbanner
- walk the stack via the method that is aware of unwind info (fixes x86_64 / aarch64 traces) - enhance the output for frames where the debug info isn't available by printing the module name
2023-04-09std.debug: fix segfault/panic race conditionAndrew Kelley
closes #7859 closes #12207
2023-03-15use DEC graphics instead of Unicode for box drawingAndrew Kelley
2023-03-15std.debug.TTY.Config: add yellowAndrew Kelley
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-01-29std.debug: disable sporadically failing testAndrew Kelley
see tracking issue #13963
2023-01-24debug: re-enable resource management test on x86_64 windowskcbanner
2023-01-23std: eliminate pointless meta.assumeSentinel() usageIsaac Freund
This fixes a bug in std.net caused during the introduction of meta.assumeSentinel due to the unfortunate semantics of mem.span() This leaves only 3 remaining uses of meta.assumeSentinel() in the standard library, each of which could be a simple @ptrCast([*:0]T, foo) instead. I think this function should likely be removed.
2023-01-21FreeBSD: add mcontext_t for aarch64Stephen Gregoratto
What isn't disabled for test-std mostly passes, except for the copysign and signbit tests for f16. Seemingly related to #14366.
2023-01-18netbsd: add mcontext_t for aarch64Michael Dusan
- test `lib/std/std.zig` passes - stack traces work
2023-01-08debug: fixup memory managementkcbanner
2023-01-08windows: rework DebugInfo to use less file operations and fix some memory ↵kcbanner
management issues
2023-01-06Implement some more environment functions for WASI.Brendan Burns
2023-01-05std: collect all options under one namespaceVeikka Tuominen