llvm-project/lldb
Stella Stamenova 67a19dfbcb Retrieve a function PDB symbol correctly from nested blocks
Summary:
This patch fixes a problem with retrieving a function symbol by an address in a nested block. In the current implementation of ResolveSymbolContext function it retrieves a symbol with PDB_SymType::None and then checks if found symbol's tag equals to PDB_SymType::Function. So, if nested block's symbol was found, ResolveSymbolContext does not resolve a function.

It is very simple to reproduce this. For example, in the next program

```
int main() {
  auto r = 0;
  for (auto i = 1; i <= 10; i++) {
    r += i & 1 + (i - 1) & 1 - 1;
  }

  return r;
}
```

if we will stop inside the cycle and will do a backtrace, the top element will be broken. But how we can test this? I thought to add an option to lldb-test to allow search a function by address, but the address may change when the compiler will be changed.

Patch by: Aleksandr Urakov

Reviewers: asmith, labath, zturner

Reviewed By: asmith, labath

Subscribers: stella.stamenova, llvm-commits

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

llvm-svn: 336564
2018-07-09 17:36:33 +00:00
..
cmake [CMake] Simplify a few framework build rules 2018-07-05 22:16:15 +00:00
docs Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
examples Update cmdtemplate.py to use best pratices. 2018-06-22 23:34:24 +00:00
include/lldb Add LLDB_API to SBAddress's operator==. 2018-07-07 18:54:44 +00:00
lit Retrieve a function PDB symbol correctly from nested blocks 2018-07-09 17:36:33 +00:00
lldb.xcodeproj Re-sort the lldb.xcodeproj project file and commit the script 2018-07-03 00:43:57 +00:00
lldb.xcworkspace Fix a typo in the gtest build target for Debug configuration. 2018-04-10 17:49:56 +00:00
packages/Python/lldbsuite [test-suite] Add a decorator for the lack of libstdcxx on the system. 2018-07-06 20:40:00 +00:00
resources Fix up Info.plist when building LLDB.framework with CMake 2018-06-19 02:59:30 +00:00
scripts Fix and simplify lldb.command decorator 2018-07-04 16:11:43 +00:00
source Address a few post facto review comments from Adrian. 2018-07-05 23:23:06 +00:00
test [CMake] Move some variables around 2018-07-04 13:59:25 +00:00
third_party/Python/module *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
tools Fix build on Windows with SDK build version >= 17134. 2018-07-07 14:58:13 +00:00
unittests Refactoring for for the internal command line completion API (NFC) 2018-07-02 21:29:56 +00:00
utils [CMake] Unify and relayer testing 2018-05-03 16:54:10 +00:00
www Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
.arcconfig
.clang-format Updated .clang-format rules so bring LLDB in line with LLVM standards. 2016-09-06 17:19:00 +00:00
.gitignore [dotest] Remove crashinfo hook 2018-01-10 10:18:47 +00:00
CMakeLists.txt [CMake] Remove redundant path component 2018-07-04 14:38:21 +00:00
CODE_OWNERS.txt Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
INSTALL.txt Changed builld-llvm.py to use .json files 2017-02-23 02:21:34 +00:00
LICENSE.TXT
use_lldb_suite_root.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00