[Lldb-commits] [PATCH] D128234: Fix build break introduced by https://reviews.llvm.org/D127702

jeffrey tan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 20 17:31:51 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5109de2da2e2: Fix build break introduced by https://reviews.llvm.org/D127702 (authored by yinghuitan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128234/new/

https://reviews.llvm.org/D128234

Files:
  lldb/tools/lldb-vscode/BreakpointBase.cpp
  lldb/tools/lldb-vscode/BreakpointBase.h


Index: lldb/tools/lldb-vscode/BreakpointBase.h
===================================================================
--- lldb/tools/lldb-vscode/BreakpointBase.h
+++ lldb/tools/lldb-vscode/BreakpointBase.h
@@ -20,6 +20,8 @@
 struct BreakpointBase {
   // logMessage part can be either a raw text or an expression.
   struct LogMessagePart {
+    LogMessagePart(llvm::StringRef text, bool is_expr)
+        : text(text), is_expr(is_expr) {}
     llvm::StringRef text;
     bool is_expr;
   };
Index: lldb/tools/lldb-vscode/BreakpointBase.cpp
===================================================================
--- lldb/tools/lldb-vscode/BreakpointBase.cpp
+++ lldb/tools/lldb-vscode/BreakpointBase.cpp
@@ -103,7 +103,8 @@
     last_raw_text_start = curly_braces_range.second + 1;
   }
   // Trailing raw text after close curly brace.
-  if (logMessage.size() > last_raw_text_start)
+  assert(last_raw_text_start >= 0);
+  if (logMessage.size() > (size_t)last_raw_text_start)
     logMessageParts.emplace_back(
         llvm::StringRef(logMessage.c_str() + last_raw_text_start,
                         logMessage.size() - last_raw_text_start),
@@ -127,7 +128,8 @@
     if (messagePart.is_expr) {
       // Try local frame variables first before fall back to expression
       // evaluation
-      const char *expr = messagePart.text.str().c_str();
+      std::string expr_str = messagePart.text.str();
+      const char *expr = expr_str.c_str();
       lldb::SBValue value =
           frame.GetValueForVariablePath(expr, lldb::eDynamicDontRunTarget);
       if (value.GetError().Fail())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128234.438508.patch
Type: text/x-patch
Size: 1584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220621/f18da1a7/attachment.bin>


More information about the lldb-commits mailing list