[Lldb-commits] [lldb] Reland "[lldb] Fix TSan report" (PR #181004)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 12 05:43:34 PST 2026
================
@@ -88,8 +88,18 @@ extern "C"
// TODO: dlsym won't work on Windows.
void *dlsym(void* handle, const char* symbol);
int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long idx, const char **object_type);
-}
+)"
+#if defined(__linux__)
----------------
Michael137 wrote:
This ifdef won't work for remote debugging (or cross-compiled toolchains) because we hardcode the constant into the expression text at *LLDB build-time*, whereas we want the switch to happen at *expression runtime*. Not sure how important either of these scenarios is. For remote debugging this would only come up between Darwin<->Linux, not sure if that's set up anywhere). Similarly with cross-compilation.
Putting the ifdef inside of the expression wouldn't work remote debugging (but would for cross-compilation) because the expression gets parsed in the context of the host and only jitted in the target.
This isn't a big deal because I don't think we support either scenario at the moment, but noteworthy.
https://github.com/llvm/llvm-project/pull/181004
More information about the lldb-commits
mailing list