Make file names and line numbers in exceptions inline-aware
Summary:
Previously, the stacktrace portion of the exception was produced using
createBacktrace(), which is inline-aware, but file names and line numbers were
not, so they were pointing to the first non-inlined frame, which could be in
the middle of a stacktrace. E.g., in this example, the same frame is listed
twice (file/line + stacktrace):
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Function C::f requires 2 generics but 1 given' in .../hphp/test/slow/reified_generics/error-function-call-5.php:8
Stack trace:
#0 .../hphp/test/slow/reified_generics/error-function-call-5.php(8): C->f()
#1 (): main()
#2 {main}
Fix this by using the same mechanism to obtain current function and offset as
we use to produce a stacktrace.
Reviewed By: alexeyt
Differential Revision:
D17552359
fbshipit-source-id:
90e51458e32f63c9be14d48ef0860f82007b8a04