Improve detection of global vs local variables
authorSam McCall <sam.mccall@gmail.com>
Tue, 22 Nov 2016 11:40:25 +0000 (11:40 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 22 Nov 2016 11:40:25 +0000 (11:40 +0000)
commit30621391bc50c1814d00300a994a961b98935b9b
tree3e9907795e519f64ba06a8c56790ff310f5ed67e
parent72e43570b74c4757292f213c9042172f3a3a13f0
Improve detection of global vs local variables

Summary:
Improve detection of global vs local variables.

Currently when a global variable is optimized out or otherwise has an unknown
location (DW_AT_location is empty) it gets reported as local.

I added two new heuristics:
 - if a mangled name is present, the variable is global (or static)
 - if DW_AT_location is present but invalid, the variable is global (or static)

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D26908

llvm-svn: 287636
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp