From ffc748f53bc9361552466ec0497ededd7acbb2f2 Mon Sep 17 00:00:00 2001 From: Johnny Shaw Date: Thu, 31 Oct 2024 00:14:06 -0600 Subject: [PATCH] initial debug visualizers --- BUILD.bazel | 7 +++++++ MODULE.bazel.lock | 2 +- default_copts.bzl | 2 +- radiant/Rad.natvis | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 radiant/Rad.natvis diff --git a/BUILD.bazel b/BUILD.bazel index be5d320..61c11c2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -43,6 +43,13 @@ filegroup( ]), ) +filegroup( + name = "radiant-natvis", + srcs = [ + "radiant/Rad.natvis", + ], +) + cc_library( name = "radiant", hdrs = [":radiant-hdrs"], diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 35ed6e5..06e0c7a 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -103,7 +103,7 @@ }, "@@ewdk_cc_toolchain~//:ewdk_extension.bzl%toolchains": { "general": { - "bzlTransitiveDigest": "9JDci1UBSQRcNgV8CaGaG7lk1+ZmfO4FF//420jL10w=", + "bzlTransitiveDigest": "o8jWc/DKL6u/xdGVR7ZVOsdvrJWHczkHwS5vnpdr1b8=", "usagesDigest": "KWfyUyVJ/UQYtoURvUEdG5qx0XigX4CN/NfpTe9J3Ns=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, diff --git a/default_copts.bzl b/default_copts.bzl index b1b2525..22e63d9 100644 --- a/default_copts.bzl +++ b/default_copts.bzl @@ -62,7 +62,7 @@ RAD_DEFAULT_COPTS = select({ }) RAD_DEFAULT_LINKOPTS = select({ - "//:msvc": [], + "//:msvc": ["/NATVIS:radiant/Rad.natvis"], "//:gcc": RAD_GCC_LINKOPTS + RAD_ASAN_LINKOPTS, "//:clang": RAD_GCC_LINKOPTS, }) diff --git a/radiant/Rad.natvis b/radiant/Rad.natvis new file mode 100644 index 0000000..cccefd5 --- /dev/null +++ b/radiant/Rad.natvis @@ -0,0 +1,50 @@ + + + + + + + + + {*($T1 *)this} + + *($T1 *)this + + + + {m_first} + + m_first + + + + + + + + {{ size={size()} }} + + capacity() + m_storage + + size() + m_storage.m_second.m_data + + + + +