diff options
author | Stella Stamenova <stilis@microsoft.com> | 2018-07-09 17:36:33 +0000 |
---|---|---|
committer | Stella Stamenova <stilis@microsoft.com> | 2018-07-09 17:36:33 +0000 |
commit | 67a19dfbcb2ac21e4bfc712b211aee32f55e7d7b (patch) | |
tree | 19561125b8539d534bb947d1748a3734cb61df81 | |
parent | 37e2ef5434da078cf2ae28df99982cb5542ae1ea (diff) | |
download | bcm5719-llvm-67a19dfbcb2ac21e4bfc712b211aee32f55e7d7b.tar.gz bcm5719-llvm-67a19dfbcb2ac21e4bfc712b211aee32f55e7d7b.zip |
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
-rw-r--r-- | lldb/lit/SymbolFile/PDB/function-nested-block.test | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/lit/SymbolFile/PDB/function-nested-block.test b/lldb/lit/SymbolFile/PDB/function-nested-block.test index 0118885b706..93543c68113 100644 --- a/lldb/lit/SymbolFile/PDB/function-nested-block.test +++ b/lldb/lit/SymbolFile/PDB/function-nested-block.test @@ -4,4 +4,4 @@ RUN: lld-link /debug:full /nodefaultlib /entry:main %t.obj /out:%t.exe RUN: lldb-test symbols -find=function -file FunctionNestedBlockTest.cpp -line 4 %t.exe | FileCheck %s CHECK: Found 1 functions: -CHECK: name = "{{.*}}", mangled = "_main" +CHECK: name = "{{.*}}", mangled = "{{_?}}main" |