Add a multi-type version of iterateSymbolsWithType
authorTeng Qin <qinteng@fb.com>
Thu, 9 Nov 2017 04:04:18 +0000 (20:04 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 9 Nov 2017 04:06:49 +0000 (20:06 -0800)
commitfddc63383b0b0c848da3a7147327481c88f6c44e
tree09971c2814718016d220fd4e9fdceeb17c186f45
parent3066914f085865bc104192f3431315be6ea9012a
Add a multi-type version of iterateSymbolsWithType

Summary:
When using `folly::symbolizer`, it's very often that we want to use `iterateSymbolsWithType` iterate through symbols of a few types using the same callback. Current approach would require iterating the section multiple times.

This Diff adds `iterateSymbolsWithTypes`, which is basically just `iterateSymbolsWithType` but accepts symbol types.

This Diff also updated implementation of `getDefinitionByAddress` and `getSymbolByName` which currently does two iterations for `STT_OBJECT` and `STT_FUNC`.

Reviewed By: yfeldblum

Differential Revision: D6279651

fbshipit-source-id: a661dd15f18e4f2f63dbcca615f5a86d92e528ea
folly/experimental/symbolizer/Elf-inl.h
folly/experimental/symbolizer/Elf.cpp
folly/experimental/symbolizer/Elf.h