3 ms·
Here's an example of that in a lib I've been working on: https://github.com/bluepeppers/libnetfilter_queue/blob/master/src/queue.rs#L47-L102 https://github.com/
by lclarkmichalek 12y ago
Here's an example of that in a lib I've been working on: https://github.com/bluepeppers/libnetfilter_queue/blob/master/src/queue.rs#L47-L102 https://github.com/bluepeppers/libnetfilter_queue/blob/maste...
- cpeterso 12y agoThanks for the example. What is the advantage of using an unmangled extern fn as a C callback? That the user-friendlier unmangled function name will appear in stack traces or can more safely be called from other Rust code?
- lclarkmichalek 12y agoTrue, though it wouldn't be hard to write a GDB extension to unmangle the names (I know D had this from quite early in it's lifetime). In general, I leave unmangled names to things that are part of the external interface: when unmangling the name, I'm explicitly saying "this symbol's name is part of the contract I have with user of this library".
- steveklabnik 12y agoThere's already something that ships with Rust that unmangles some stuff: http://michaelwoerister.github.io/2015/03/27/rust-xxdb.html http://michaelwoerister.github.io/2015/03/27/rust-xxdb.html