================
@@ -870,7 +871,95 @@ void ProcessWindows::OnUnloadDll(lldb::addr_t module_addr) 
{
     dyld->OnUnloadModule(module_addr);
 }
 
-void ProcessWindows::OnDebugString(const std::string &string) {}
+void ProcessWindows::OnDebugString(lldb::addr_t debug_string_addr,
+                                   bool is_unicode,
+                                   uint16_t length_lower_word) {
+  Log *log = GetLog(WindowsLog::Process);
+
+  llvm::SmallVector<char, 256> buffer;
+  llvm::Error err =
+      ReadDebugString(debug_string_addr, is_unicode, length_lower_word, 
buffer);
+  if (err) {
+    LLDB_LOG_ERROR(log, std::move(err),
+                   "Failed to read debug string at {1:x} (size & 0xffff={2}, "
+                   "unicode={3}): {0}",
+                   debug_string_addr, length_lower_word, is_unicode);
+    return;
+  }
+  if (buffer.empty())
+    return;
+
+  if (is_unicode) {
+    if (buffer.size() % 2 != 0) {
----------------
Nerixyz wrote:

Yes. It's only talked about in the context of -A or -W functions 
[here](https://learn.microsoft.com/en-us/windows/win32/intl/unicode):
> These functions use UTF-16 (wide character) encoding, which is the most 
> common encoding of Unicode and the one used for native Unicode encoding on 
> Windows operating systems.

As far as I know, we can't see any other format.

https://github.com/llvm/llvm-project/pull/196395
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to