================
@@ -0,0 +1,21 @@
+#include <cstring>
+
+int main() {
+  constexpr char SINGLE_INSTANCE_STRING[] = "there_is_only_one_of_me";
+  constexpr size_t single_instance_size = sizeof(SINGLE_INSTANCE_STRING) + 1;
+  char *single_instance = new char[single_instance_size];
+  strcpy(single_instance, SINGLE_INSTANCE_STRING);
----------------
clayborg wrote:

So we don't need lines 5-7 if we want to search the thread stack. You can make 
a local variable that points to this buffer to make sure it is used and stays 
in the program:
```
const char *stack_string_ptr = SINGLE_INSTANCE_STRING;
```

https://github.com/llvm/llvm-project/pull/95007
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to