[Lldb-commits] [lldb] [lldb] Add alternative SBThread::GetStopDescription (PR #165379)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 29 02:25:03 PDT 2025


================
@@ -224,6 +224,13 @@ AND call SWIG_fail at the same time, because it will result in a double free.
   }
   $1 = (char *)malloc($2);
 }
+
+// Remove the default type check for this match.
+// because if the match function has an overload and a typemap,
+// it will typecheck against the original function instead of the
+// typemap.
+%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) (char *dst_or_null, size_t dst_len) ""
----------------
Michael137 wrote:

I also see:
```
// For lldb::SBFileSpec::GetPath
%typemap(in) (char *dst_path, size_t dst_len) = (char *dst_or_null, size_t dst_len);
%typemap(argout) (char *dst_path, size_t dst_len) = (char *dst_or_null, size_t dst_len);
```

I'm not too familiar with SWIG, so correct me if I'm wrong. This just copies the typemap, but not the `typecheck` itself? And regardless, is `typecheck` only ever applicable to these dispatch functions? In which case, `GetPath` wouldn't really be affected by that even if it did copy the typecheck?

Unrelated: looks like `SBFileSpec::GetPath` suffers from the same kind of API problem where you have to supply a fixed size. Should we add an `SBStream` overload here too? In which case, copying the typemap would be beneficial anyways.

https://github.com/llvm/llvm-project/pull/165379


More information about the lldb-commits mailing list