Hacker News new | ask | show | jobs
by dustbunny 361 days ago
Does a stack trace from a crash in a bound function show the line number of where the bind() took place?
2 comments

Assuming the stack trace is generated by walking up the stack at the time when the crash happened, nothing that works like a C function pointer would ever do that. Assigning a a pointer to a memory location doesn't generate a stack frame, so there's no residual left in the stack that could be walked back.

A simple example. If you were to bind a function pointer in one stack frame, and the immediately return it to the parent stack frame which then invokes that bound pointer, the stack that bound the now called function would literally not exist anymore.

No, but neither does the author's solution.