[lldb] Update the check for Linux or FreeBSD in SymbolFileDWARF::FindFunctions
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 5 Dec 2016 18:42:21 +0000 (18:42 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 5 Dec 2016 18:42:21 +0000 (18:42 +0000)
commita08ba42f1a7b7fd200563758b0573bb4b2048822
tree9431962a49222df494b3a5e07ebcd58478c3d368
parent44da9decb57c8999c734adf53cb40042b3cf946d
[lldb] Update the check for Linux or FreeBSD in SymbolFileDWARF::FindFunctions

This diff
1. Adds a comment to ObjectFileELF.cpp about the current
approach to determining the OS.
2. Replaces the check in SymbolFileDWARF.cpp with a more robust one.

Test plan:
Built (on Linux) a test binary linked to a c++ shared library
which contains just an implementation of a function TestFunction,
the library (the binary itself) doesn't contain ELF notes
and EI_OSABI is set to System V.
Checked in lldb that now "p TestFunction()" works fine
(and doesn't work without this patch).

Differential revision: https://reviews.llvm.org/D27380

llvm-svn: 288687
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp