mozilla-b2g/B2G — pull request #225 by jld (2013-03-22 19:43:17+00:00)
Title: Fix ARM return addresses so that they addr2line correctly.

The addresses we'll get from NS_StackWalk on ARM will be the saved LR
values, which are for the instruction after the call (with the low bit
set if Thumb). Because we use addr2line and report the innermost of
the stack of inlined functions at the point in question (if any), this
can result in showing a confusingly unrelated function. (Note that it
could also fail in general, if the function ends with a call as result
of noreturn annotation.)

This change uses the address of the last byte in the call instruction,
rather than the start of the instruction, which is generally the correct
way to indicate being in the middle of a call for debug information,
although the difference shouldn't matter for addr2line.

However, it offsets *all* the samples, which isn't quite right; a saved
PC from a fault should be used as-is. It's also not clear if this should
happen here or earlier in the pipeline.