Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> [Lambdas] get non-descriptive, auto-generated names. When I look at call stack of a crash I can’t map the auto-generated closure name to a function in my code.

Well, HN lazyweb, how do you override the stupid name in C++? In other languages this is possible:

  $ node --trace-uncaught -e 'const c = function have_name() {throw null}; c()'

  $ perl -d:Confess -MSub::Util=set_subname -E 'my $c = sub() {die}; set_subname have_name => $c; $c->()'


Better solution would be to map to a source location (filename and line) instead.


Not necessary tho, the function already exists in the binary and already has a symbol. All you need is some compiler/language feature to change that symbol.


debug symbols already do that




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: