Open Bug 770880 Opened 12 years ago Updated 2 years ago

C++ name mangling for js-ctypes

Categories

(Core :: js-ctypes, enhancement)

enhancement

Tracking

()

People

(Reporter: Yoric, Unassigned)

References

(Blocks 1 open bug)

Details

Short story: We can probably implement a new js-ctypes abi that includes name mangling for simple symbols.

Long story: I just had to provide some tech support for ochameau (Jetpack team) who needed to call Dalvik code using js-ctypes to enable some form of debugging. His code used to work and suddenly stopped working. As it turns out, this new version of Dalvik is compiled as C++, while the older one was compiled as C, and the sudden mangling broke the code. We eventually managed to find the issue and the corresponding symbol name, but this is something that we could automatize in  js-ctypes, to make it easier for our users. Also, this could serve as a first step towards bug 505907, if we ever decide to reopen it.

So, here is what we could do:
- add a new js-ctypes abi object (say |ctypes.cppabi|);
- have this object cause Itanium mangling on Linux/Android/B2G/BSD/Mac OS X platforms (see http://sourcery.mentor.com/public/cxx-abi/abi.html#mangling);
- have this object cause Microsoft mangling on MS platforms (possibly reusing the algorithm implemented in clang).
Blocks: 505907
Severity: normal → enhancement
What was he trying to do with the ctypes? Was it eventually accomplished? With ctypes?

This bug came up as arai and i were discussing using xpcom from jsctypes:


our chat:
https://gist.github.com/Noitidart/a5dd37346d1461cab659
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.