From: Alex Langford Date: Thu, 16 Feb 2023 23:38:56 +0000 (-0800) Subject: [lldb] Stop generating swig bindings for SBLaunchInfo copy constructor X-Git-Tag: upstream/17.0.6~17204 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffe982f96bff77c1b326f5109e2dddfbcde4ca2a;p=platform%2Fupstream%2Fllvm.git [lldb] Stop generating swig bindings for SBLaunchInfo copy constructor Given the line ``` launch_info = lldb.SBLaunchInfo(None) ``` We see different behaviors across different versionf of swig. On some older versions of swig (e.g. 3.0.2) this line fails because it attempts to use the copy constructor and blows up with an invalid null reference. On newer versions of swig, this is correctly routed to the constructor taking a pointer. Prior to generating the swig bindings with the API headers, SBLaunchInfo's copy constructor was not exposed so we're effectively going back to the old behavior anyway. Differential Revision: https://reviews.llvm.org/D144228 --- diff --git a/lldb/include/lldb/API/SBLaunchInfo.h b/lldb/include/lldb/API/SBLaunchInfo.h index eb4f4a6..ace448e 100644 --- a/lldb/include/lldb/API/SBLaunchInfo.h +++ b/lldb/include/lldb/API/SBLaunchInfo.h @@ -26,7 +26,14 @@ public: ~SBLaunchInfo(); +#ifndef SWIG + // The copy constructor for SBLaunchInfo presents some problems on some + // supported versions of swig (e.g. 3.0.2). When trying to create an + // SBLaunchInfo from python with the argument `None`, swig will try to call + // the copy constructor instead of SBLaunchInfo(const char **). For that + // reason, we avoid exposing the copy constructor to python. SBLaunchInfo(const SBLaunchInfo &rhs); +#endif SBLaunchInfo &operator=(const SBLaunchInfo &rhs);