@@ -225,10 +225,21 @@ AND call SWIG_fail at the same time, because it will result in a double free.
225225 $1 = (char *)malloc ($2 );
226226}
227227
228- // Remove the default type check for this match.
229- // because if the match function has an overload and a typemap,
230- // it will typecheck against the original function instead of the
231- // typemap.
228+ // Disable default type checking for this method to avoid SWIG dispatch issues.
229+ //
230+ // Problem: SBThread::GetStopDescription has two overloads:
231+ // 1. GetStopDescription(char* dst_or_null, size_t dst_len)
232+ // 2. GetStopDescription(lldb::SBStream& stream)
233+ //
234+ // SWIG generates a dispatch function to select the correct overload based on argument types.
235+ // see https://www.swig.org/Doc4.0/SWIGDocumentation.html#Typemaps_overloading.
236+ // However, this dispatcher doesn't consider typemaps that transform function signatures.
237+ //
238+ // In Python, our typemap converts GetStopDescription(char*, size_t) to GetStopDescription(int).
239+ // The dispatcher still checks against the original (char*, size_t) signature instead of
240+ // the transformed (int) signature, causing type matching to fail.
241+ // This only affects SBThread::GetStopDescription since the type check also matches
242+ // the argument name, which is unique to this function.
232243%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) (char *dst_or_null, size_t dst_len) " "
233244
234245%typemap(argout) (char *dst_or_null, size_t dst_len) {
0 commit comments