[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 7 Feb 2020 21:23:09 +0000 (22:23 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 7 Feb 2020 21:24:56 +0000 (22:24 +0100)
commitcf1046c716b33ed449aa8fc26376864917c63c25
tree92e3d548a810aab564c22fd553f3557b894f0ab3
parent2491fd0e6f6187a6130103c7d64d59cd3f178d4c
[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux

D73303 was failing on Fedora Linux and so it was disabled by Skip the
AssertFrameRecognizer test for Linux.

On Fedora 30 x86_64 I have:
        $ readelf -Ws /lib64/libc.so.6 |grep '^Symbol\|.*assert_fail'
        Symbol table '.dynsym' contains 2362 entries:
           630: 0000000000030520    70 FUNC    GLOBAL DEFAULT   14 __assert_fail@@GLIBC_2.2.5
        Symbol table '.symtab' contains 22711 entries:
           922: 000000000002275a    15 FUNC    LOCAL  DEFAULT   14 __assert_fail_base.cold
         18044: 0000000000030520    70 FUNC    LOCAL  DEFAULT   14 __GI___assert_fail
         20081: 00000000000303a0   370 FUNC    LOCAL  DEFAULT   14 __assert_fail_base
         21766: 0000000000030520    70 FUNC    GLOBAL DEFAULT   14 __assert_fail

The patch should never expect __GI___assert_fail:

.symtab can be present or not but that should not change that
__assert_fail always wins - it is always present from .dynsym and it can
never be overriden by __GI___assert_fail as __GI___assert_fail has only
local binding. Global binding is preferred since D63540.

External debug info symbols do not matter since D55859 (and DWARF should
never be embedded in system libc.so.6).

Differential Revision: https://reviews.llvm.org/D74252
lldb/source/Target/AssertFrameRecognizer.cpp
lldb/test/Shell/Recognizer/assert.test