<div dir="ltr">Hi,<div><br></div><div>I'm using the SBTarget.Launch() API in Python:</div><div><br></div><div>process = target.Launch(self.dbg.GetListener(), ['a','b'], env, stdin, 'stdour.txt, 'stderr.txt', os.getcwd(), 0 , True, err)<br></div><div><br></div><div>I got the following error:</div><div><br></div><div><div>...</div><div>  File "/home/media/llvm/lib/python2.7/site-packages/lldb/__init__.py", line 7973, in Launch</div><div>    return _lldb.SBTarget_Launch(self, *args)</div><div>NotImplementedError: Wrong number or type of arguments for overloaded function 'SBTarget_Launch'.</div><div>  Possible C/C++ prototypes are:</div><div>    lldb::SBTarget::Launch(lldb::SBListener &,char const **,char const **,char const *,char const *,char const *,char const *,uint32_t,bool,lldb::SBError &)</div><div>    lldb::SBTarget::Launch(lldb::SBLaunchInfo &,lldb::SBError &)</div></div><div><br></div><div>If I replace the string list ['a','b'] with None, it works.</div><div><br></div><div>I find that all the tests and samples uses None.</div><div><br></div><div>It looks the problem stems from overloaded Launch in SBTarget.i.</div><div><br></div><div>In LLDBWrapPython.cpp:</div><div><br></div><div>_wrap_SBTarget_Launch__SWIG_0 () { ...} // wrapper for Launch(lldb::SBListener &...)<br></div><div>_wrap_SBTarget_Launch__SWIG_1 () { ...} // wrapper for Launch (lldb::SBLaunchInfo &...);<br></div><div><br></div><div>SWIGINTERN PyObject *_wrap_SBTarget_Launch(PyObject *self, PyObject *args) {<br></div><div><div>...</div><div>  if (argc == 3) {</div><div> ....</div><div>  }</div><div>  if (argc == 11) {</div><div>    int _v;</div><div>    void *vptr = 0;</div><div>    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_lldb__SBTarget, 0);</div><div>    _v = SWIG_CheckState(res);</div><div>    if (_v) {</div><div>      void *vptr = 0;</div><div>      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_lldb__SBListener, 0);</div><div>      _v = SWIG_CheckState(res);</div><div>      if (_v) {</div><div>        void *vptr = 0;</div><div>        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_p_char, 0); // ===================== Fails here. unable to cast to char**</div><div>        _v = SWIG_CheckState(res);</div><div>        if (_v) {</div><div>       ....</div><div>                        if (_v) {</div><div>                          return _wrap_SBTarget_Launch__SWIG_0(self, args);   ================> real check here</div><div>               ...</div><div>  }</div><div>  </div><div>fail:</div><div>  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SBTarget_Launch'.\n"</div><div>    "  Possible C/C++ prototypes are:\n"</div><div>    "    lldb::SBTarget::Launch(lldb::SBListener &,char const **,char const **,char const *,char const *,char const *,char const *,uint32_t,bool,lldb::SBError &)\n"</div><div>    "    lldb::SBTarget::Launch(lldb::SBLaunchInfo &,lldb::SBError &)\n");</div><div>  return 0;</div></div><div><br></div><div><br></div><div>It seems to me the swig code does some unnecessary check before it goes into the real wrapper.</div><div>Any inputs?</div><div><br></div><div>Thanks,</div><div>Zephyr</div></div>