From: Jonas Devlieghere Date: Thu, 12 Jan 2023 18:15:51 +0000 (-0800) Subject: [lldb] Limit `nothreadallow` to Python in SWIG bindings X-Git-Tag: upstream/17.0.6~21174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba35c27ec9aa9807f5b4be2a0c33ca9b045accc7;p=platform%2Fupstream%2Fllvm.git [lldb] Limit `nothreadallow` to Python in SWIG bindings SWIG allows you to partially disable thread support for a given function in Python with `nothreadallow`. This functionality is limited to Python, but until SWIG 4.1, it would silently ignore this for other languages, such as Lua. New versions of SWIG are more strict and therefore we need to guard this with `SWIGPYTHON`. For more details on the functionality, I recommend reading the commit message from 070a1d562b30. --- diff --git a/lldb/bindings/interface/SBValueList.i b/lldb/bindings/interface/SBValueList.i index 32543af17413..e03b5c649db9 100644 --- a/lldb/bindings/interface/SBValueList.i +++ b/lldb/bindings/interface/SBValueList.i @@ -105,7 +105,9 @@ public: lldb::SBError GetError(); %extend { +#ifdef SWIGPYTHON %nothreadallow; +#endif std::string lldb::SBValueList::__str__ (){ lldb::SBStream description; const size_t n = $self->GetSize(); @@ -124,7 +126,9 @@ public: --desc_len; return std::string(desc, desc_len); } +#ifdef SWIGPYTHON %clearnothreadallow; +#endif } #ifdef SWIGPYTHON