[Lldb-commits] [PATCH] D29256: Do not pass non-trivial type variables through variadic function

Kamil Rytarowski via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Jan 28 16:16:48 PST 2017


krytarowski created this revision.
krytarowski added a project: LLDB.
Herald added a subscriber: ki.stfu.

Cannot pass object of non-trivial type 'const CMIUtilString' through variadic function.

      

Original patch by Tobias Nygren (NetBSD).

      

Sponsored by <The NetBSD Foundation>


Repository:
  rL LLVM

https://reviews.llvm.org/D29256

Files:
  tools/lldb-mi/MICmnBase.cpp
  tools/lldb-mi/MICmnBase.h
  tools/lldb-mi/MIDriver.cpp
  tools/lldb-mi/MIUtilString.cpp
  tools/lldb-mi/MIUtilString.h


Index: tools/lldb-mi/MIUtilString.h
===================================================================
--- tools/lldb-mi/MIUtilString.h
+++ tools/lldb-mi/MIUtilString.h
@@ -30,7 +30,7 @@
 
   // Static method:
 public:
-  static CMIUtilString Format(const CMIUtilString vFormating, ...);
+  static CMIUtilString Format(const char *vFormating, ...);
   static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
   static CMIUtilString FormatValist(const CMIUtilString &vrFormating,
                                     va_list vArgs);
Index: tools/lldb-mi/MIUtilString.cpp
===================================================================
--- tools/lldb-mi/MIUtilString.cpp
+++ tools/lldb-mi/MIUtilString.cpp
@@ -157,7 +157,7 @@
 // Return:  CMIUtilString - Number of splits found in the string data.
 // Throws:  None.
 //--
-CMIUtilString CMIUtilString::Format(const CMIUtilString vFormating, ...) {
+CMIUtilString CMIUtilString::Format(const char *vFormating, ...) {
   va_list args;
   va_start(args, vFormating);
   CMIUtilString strResult = CMIUtilString::FormatPriv(vFormating, args);
Index: tools/lldb-mi/MIDriver.cpp
===================================================================
--- tools/lldb-mi/MIDriver.cpp
+++ tools/lldb-mi/MIDriver.cpp
@@ -509,7 +509,7 @@
     const CMIUtilString errMsg = CMIUtilString::Format(
         MIRSRC(IDS_THREADMGR_ERR_THREAD_FAIL_CREATE),
         CMICmnThreadMgrStd::Instance().GetErrorDescription().c_str());
-    SetErrorDescriptionn(errMsg);
+    SetErrorDescriptionn(errMsg.c_str());
     return MIstatus::failure;
   }
 
Index: tools/lldb-mi/MICmnBase.h
===================================================================
--- tools/lldb-mi/MICmnBase.h
+++ tools/lldb-mi/MICmnBase.h
@@ -28,7 +28,7 @@
   bool HaveErrorDescription() const;
   const CMIUtilString &GetErrorDescription() const;
   void SetErrorDescription(const CMIUtilString &vrTxt) const;
-  void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
+  void SetErrorDescriptionn(const char *vFormat, ...) const;
   void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
   void ClrErrorDescription() const;
 
Index: tools/lldb-mi/MICmnBase.cpp
===================================================================
--- tools/lldb-mi/MICmnBase.cpp
+++ tools/lldb-mi/MICmnBase.cpp
@@ -122,7 +122,7 @@
 // Return:  None.
 // Throws:  None.
 //--
-void CMICmnBase::SetErrorDescriptionn(const CMIUtilString vFormat, ...) const {
+void CMICmnBase::SetErrorDescriptionn(const char *vFormat, ...) const {
   va_list args;
   va_start(args, vFormat);
   CMIUtilString strResult = CMIUtilString::FormatValist(vFormat, args);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29256.86184.patch
Type: text/x-patch
Size: 2656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170129/fa0d9c62/attachment-0001.bin>


More information about the lldb-commits mailing list