Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3c94ba6d70070d52a469c04ece16da7d0edb467b
https://github.com/WebKit/WebKit/commit/3c94ba6d70070d52a469c04ece16da7d0edb467b
Author: Yusuke Suzuki <[email protected]>
Date: 2025-04-06 (Sun, 06 Apr 2025)
Changed paths:
M Source/WTF/WTF.xcodeproj/project.pbxproj
M Source/WTF/wtf/CMakeLists.txt
A Source/WTF/wtf/StructDump.h
Log Message:
-----------
[WTF] Add StructDump for debugging
https://bugs.webkit.org/show_bug.cgi?id=291127
rdar://problem/148664792
Reviewed by Keith Miller.
This adds `structDump` debugging helper function for `dataLog`.
If you are using clang, then it dumps *any* kind of struct / class
fields without adding explicit dump code by using clang's __builtin_dump_struct.
For example, if you run the code like,
DFG::Node* node = ...;
dataLogLn(structDump(*node));
Then you can get the output like this.
JSC::DFG::Node {
NodeOrigin origin = *0x10631d800
NodeType m_op = 59
unsigned int m_index = 323
AdjacencyList children = *0x10631d818
VirtualRegister m_virtualRegister = *0x10631d830
unsigned int m_refCount = 1
NodeFlags m_flags = 344069
SpeculatedType m_prediction = 206158430208
OpInfoWrapper m_opInfo = *0x10631d848
OpInfoWrapper m_opInfo2 = *0x10631d850
union (unnamed) m_misc = {
Node * replacement = 0x0
unsigned int epoch = 0
}
BasicBlock * owner = 0x1061177b0
}
* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/CMakeLists.txt:
* Source/WTF/wtf/StructDump.h: Added.
(WTF::StructDump::StructDump):
(WTF::StructDump::dump const):
(WTF::structDump):
Canonical link: https://commits.webkit.org/293332@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes