[PATCH] D120660: [llvm-symbolizer] Add --approximate-missing-line-numbers Command Line Option

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 10:54:13 PST 2022


MaskRay added a comment.

Suppose we are going to add such an interface:

> @jhenderson: If I'm following this correctly, this ends up in a recursive loop until you find a non-zero line number or address zero? ...

If we want to avoid the loop iteratively calling `SymbolizableObjectFile::symbolizeCode`: `getModuleSectionIndexForAddress`, `DebugInfoContext->getLineInfoForAddress`, and `getNameFromSymbolTable` will need to be taught to skip line==0 lines.
Changing `getNameFromSymbolTable` may be straightforward (it is basically a llvm::upper_bound call), but need to expose a new interface. Changes to the other two functions will be tricky.

Otherwise, a loop is perhaps good enough. If we want to guard against a pessimistic case that calls `symbolizeCode` too many times (for example, try symbolizing 0x2000 but only 0x1000 has a line number; there will be 0x1000 failed trials which can be too slow), we may need to teach the above functions to stop, or set an arbitrary trial limit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120660/new/

https://reviews.llvm.org/D120660



More information about the llvm-commits mailing list