Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up debug.zig, particularly stack trace formating #8228

Closed
wants to merge 85 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
ca15a64
out_stream -> writer
rgreenblatt Mar 12, 2021
7020fcd
use name addressToSymbol
rgreenblatt Mar 12, 2021
99cead9
Heavily refactor debug to better handle dumping stack traces
rgreenblatt Mar 12, 2021
c8856e5
rename to detectTTYConfig for consistency
rgreenblatt Mar 13, 2021
846092a
Remove heldWriter and HeldValue struct
rgreenblatt Mar 13, 2021
42ac4c9
added deinit to AddressSymbolMapping (not yet used)
rgreenblatt Mar 13, 2021
cc913cb
AddressSymbolMapping -> SymbolMap
rgreenblatt Mar 13, 2021
24e425f
change stack trace formating
rgreenblatt Mar 13, 2021
cf9ad1a
revert changes to log, use original approach
rgreenblatt Mar 17, 2021
5f05a6a
added compiler error for old function, should be removed eventually
rgreenblatt Mar 17, 2021
c10320b
fix some stderr used bugs (also fix win api colors)
rgreenblatt Mar 17, 2021
54ff4d1
Move location of writeLineFromFileAnyOs
rgreenblatt Mar 17, 2021
0db66a6
detectTTYConfig is private
rgreenblatt Mar 17, 2021
76f2c1a
also change name because no longer pub
rgreenblatt Mar 17, 2021
4b5b3df
windows api bug
rgreenblatt Mar 17, 2021
4a63e18
refactor stack trace api and associated general_purpose_allocator
rgreenblatt Mar 17, 2021
37d9d03
actually deinit arena
rgreenblatt Mar 17, 2021
d7af9b0
fix compiler error with latest updates
rgreenblatt Mar 17, 2021
000e31a
allow captureStackTraceFrom to error
rgreenblatt Mar 17, 2021
1430b7a
fix windows api bug
rgreenblatt Mar 17, 2021
32d1f87
fix name of SymMap
rgreenblatt Mar 17, 2021
99044ce
fix bug
rgreenblatt Mar 17, 2021
6b5fd65
compiler appeasement (mostly for wasm?)
rgreenblatt Mar 17, 2021
9a7b7ef
improve docs
rgreenblatt Mar 17, 2021
6e43037
better docs
rgreenblatt Mar 17, 2021
66b8772
allow for overriding formating
rgreenblatt Mar 17, 2021
49f9d0c
minor cleanup for consistency
rgreenblatt Mar 17, 2021
add16bb
fix deinit bug
rgreenblatt Mar 17, 2021
69fc412
fmt
rgreenblatt Mar 18, 2021
e87f5af
fix windows_api for case when std.fs.File doesn't exist
rgreenblatt Mar 18, 2021
7100ab0
Allow for overriding getCurrentThreadId()
rgreenblatt Mar 18, 2021
6ab6d9d
fmt
rgreenblatt Mar 18, 2021
e7c6730
allow for overriding sleepForever: is there a nicer way to do this?
rgreenblatt Mar 18, 2021
1ac896d
abort -> panicTerm
rgreenblatt Mar 18, 2021
11a9ed4
fix bug with 0 addresses
rgreenblatt Mar 18, 2021
2868bb0
fixed missing newlines in fmt
rgreenblatt Mar 18, 2021
211bdae
added getPanicStage override (gross)
rgreenblatt Mar 18, 2021
2087619
mild improvement using orelse
rgreenblatt Mar 19, 2021
30f070e
fix abort -> panicTerm
rgreenblatt Mar 19, 2021
b577ceb
Use atomic u32 instead of atomic intrinsics directly
rgreenblatt Mar 19, 2021
bddbee7
Improve panic approach to always use panic override
rgreenblatt Mar 19, 2021
b881898
create panic extra function which is useful for formating and printing
rgreenblatt Mar 19, 2021
94993ff
Merge branch 'master' into stack_trace_override
rgreenblatt Mar 19, 2021
82dad0b
fix set cold
rgreenblatt Mar 19, 2021
f342b1e
minor docs fixes
rgreenblatt Mar 19, 2021
158f69a
Remove dead overrides which were accidentally left in.
rgreenblatt Mar 19, 2021
5200b5f
avoid usage of @This()
rgreenblatt Mar 19, 2021
9e289bc
Fix redundant type.
rgreenblatt Mar 19, 2021
c4cced5
remove config value for stack trace color
rgreenblatt Mar 19, 2021
d23d08e
remove haiku code which does nothing
rgreenblatt Mar 20, 2021
5da806a
Substantially shift ModuleDebugInfo approach to be cleaner and properly
rgreenblatt Mar 20, 2021
a1fa811
fix handling of unsupported case
rgreenblatt Mar 20, 2021
874d270
the default panic implementation can be used for wasm now
rgreenblatt Mar 20, 2021
5720212
remove dead unreachable
rgreenblatt Mar 20, 2021
cd679c9
extract out dwarfAddressToSymbolInfo and a bit of cleanup + reorder
rgreenblatt Mar 20, 2021
41ee0b5
fix missing ptr bug
rgreenblatt Mar 20, 2021
462db07
Improve comment
rgreenblatt Mar 20, 2021
b6abac4
remove some pub which is no longer correct
rgreenblatt Mar 20, 2021
51608d6
Added errorInSet helper
rgreenblatt Mar 20, 2021
5421018
use errorInSet to cleanup debug.zig
rgreenblatt Mar 20, 2021
889a574
properly use import
rgreenblatt Mar 20, 2021
7998ea7
properly use import
rgreenblatt Mar 20, 2021
3ba0a6b
fix import
rgreenblatt Mar 20, 2021
14498e6
fix import
rgreenblatt Mar 20, 2021
9145bab
fmt
rgreenblatt Mar 20, 2021
ec86012
added lookupDecl
rgreenblatt Mar 20, 2021
412450d
use lookupDecl helper
rgreenblatt Mar 20, 2021
2302e7c
fix import
rgreenblatt Mar 20, 2021
033871c
break out symbol maps into separate files
rgreenblatt Mar 20, 2021
9e1f726
fix bugs
rgreenblatt Mar 20, 2021
3b33b26
Remove ref all decls (doesn't quite work the way I wanted)
rgreenblatt Mar 20, 2021
7b5beba
fix lookupDecl in non-type case
rgreenblatt Mar 20, 2021
178a6d9
Fix bug where trying to access field on value would just return null
rgreenblatt Mar 20, 2021
2d4d7b8
improve docs for lookupDecl
rgreenblatt Mar 20, 2021
4eb6d8d
added test
rgreenblatt Mar 20, 2021
4c96993
generalize to os.debug and root.debug
rgreenblatt Mar 20, 2021
eef2985
remove overrides other than SymbolMap and captureStackTraceFrom
rgreenblatt Mar 20, 2021
03d0028
TODO on interfaces
rgreenblatt Mar 21, 2021
f576f5e
move comment to correct location
rgreenblatt Mar 21, 2021
0aa3335
better approach to lookupDecl via copy paste
rgreenblatt Mar 27, 2021
b76b38d
interface implementation (anyerror used for now)
rgreenblatt Mar 27, 2021
c3779b9
fix deprecated use of warn
rgreenblatt Mar 27, 2021
9cb93ec
fix compile err
rgreenblatt Mar 27, 2021
5d940fe
fix refAllDecls
rgreenblatt Mar 27, 2021
6c63bef
fix bug
rgreenblatt Mar 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/std/debug.zig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub const default_config = struct {
pub const captureStackTraceFrom = defaultCaptureStackTraceFrom;
};

// TODO(rgreenblatt): make these interfaces, this needs to be done before
// merging the PR
const config = lookupDecl(root, &.{"debug_config"}) orelse struct {};
const os_config = lookupDecl(root, &.{ "os", "debug" }) orelse struct {};

Expand Down