From 2d87beb200763920dc1b571c338d3cb10212d7d1 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Mon, 7 Feb 2022 10:07:25 +0000 Subject: [PATCH] Add native visualizers for MSVC Currently contains a subset of ast nodes to make it easier to debug. Bug: tint:1331 Change-Id: I27afe3c57aa752bdf823120e31585100c8adbe36 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79460 Auto-Submit: Antonio Maiorano Kokoro: Kokoro Reviewed-by: Ben Clayton Commit-Queue: Ben Clayton --- src/CMakeLists.txt | 6 +++ src/tint.natvis | 120 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 src/tint.natvis diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 352318644c..1ff38d7316 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -537,6 +537,12 @@ if(${TINT_BUILD_HLSL_WRITER}) ) endif() +if(MSVC) + list(APPEND TINT_LIB_SRCS + tint.natvis + ) +endif() + ## Tint IO utilities. Used by tint_val. add_library(tint_utils_io utils/io/command_${TINT_OS_CC_SUFFIX}.cc diff --git a/src/tint.natvis b/src/tint.natvis new file mode 100644 index 0000000000..4490ee91b1 --- /dev/null +++ b/src/tint.natvis @@ -0,0 +1,120 @@ + + + + + + + {debug_name_,sb} + + + + {*lhs} = {*rhs}; + {AstNodeToString(this)} + + *lhs + *rhs + + + + + + {symbol} + + symbol + + + + + {*object}[{*index}] + + *object + *index + + + + + {*structure}.{*member} + + *structure + *member + + + + + let {symbol} : {*type} = {*constructor} + let {symbol} = {*constructor} + var {symbol} = {*constructor} + var {symbol} : {*type} + var {symbol} : {*type} = {*constructor} + + + + {*variable}; + + + + {value} + + + + {value} + + + + ({*lhs} {op,en} {*rhs}) + + + + {target}() + {target}({*args[0]}) + {target}({*args[0]}, {*args[1]}) + {target}({*args[0]}, {*args[1]}, {*args[2]}) + {target}({*args[0]}, {*args[1]}, {*args[2]}, ...) + + + + + {*name} + {*type} + + + + array<{*type},{*count}> + array<{*type}> + + + + {name} + + + + bool + + + + i32 + + + + u32 + + + + f32 + + +