Repository navigation
Commit 6143064
authored
feat: expose Core.SimplifyNameToQualifiedName (Python parity, sret) (#37)
Closes HIGH missing-capi gap #24. The binding declared the
BNRustSimplifyStrToFQN P/Invoke (which returns a BNQualifiedName by value)
but declined to expose it: two TODO notes warned the struct-return (sret)
ABI made the binding "non-trivial" and redirected callers to the
string-only RustSimplifyStrToStr, so Python's
demangle.simplify_name_to_qualified_name (demangle.py:253) had no managed
equivalent.
The sret concern was unfounded: BNQualifiedName is blittable (two IntPtrs
plus a ulong), so the P/Invoke marshaller handles the struct-return ABI
directly -- the same pattern as BNTypeBuilderGetStructureName. Verified
end-to-end: a templated C++ name collapses identically to Python.
Add Core.SimplifyNameToQualifiedName with a string overload (simplify
flag, defaults true) and a QualifiedName overload (Python forces
simplify=true for qualified-name input). Both wrap via
QualifiedName.TakeNative (reads components eagerly, then frees the native
array) and return null when the simplifier yields no components. Removes
the two stale TODO notes.1 parent 539cbf3 commit 6143064
1 file changed
Lines changed: 49 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
735 | | - | |
736 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
737 | 783 | | |
738 | 784 | | |
739 | 785 | | |
| |||
1170 | 1216 | | |
1171 | 1217 | | |
1172 | 1218 | | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | 1219 | | |
1178 | 1220 | | |
1179 | 1221 | | |
| |||
0 commit comments