diff options
| author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2018-12-03 13:31:13 +0000 |
|---|---|---|
| committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2018-12-03 13:31:13 +0000 |
| commit | a5235af980e55774882d6567fa1ca94caaf24ce6 (patch) | |
| tree | 8b6b7b45455d5f32d67748fabdd1b16f5c7827af /lldb/lit/SymbolFile/PDB/Inputs | |
| parent | f1822ec431cded5e50b69152346794d79976a8b2 (diff) | |
| download | bcm5719-llvm-a5235af980e55774882d6567fa1ca94caaf24ce6.tar.gz bcm5719-llvm-a5235af980e55774882d6567fa1ca94caaf24ce6.zip | |
[PDB] Support PDB-backed expressions evaluation (+ fix stuck test)
Summary:
This patch contains several small fixes, which makes it possible to evaluate
expressions on Windows using information from PDB. The changes are:
- several sanitize checks;
- make IRExecutionUnit::MemoryManager::getSymbolAddress to not return a magic
value on a failure, because callers wait 0 in this case;
- entry point required to be a file address, not RVA, in the ObjectFilePECOFF;
- do not crash on a debuggee second chance exception - it may be an expression
evaluation crash. Also fix detection of "crushed" threads in tests;
- create parameter declarations for functions in AST to make it possible to call
debugee functions from expressions;
- relax name searching rules for variables, functions, namespaces and types. Now
it works just like in the DWARF plugin;
- fix endless recursion in SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc.
Reviewers: zturner, asmith, stella.stamenova
Reviewed By: stella.stamenova, asmith
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D53759
llvm-svn: 348136
Diffstat (limited to 'lldb/lit/SymbolFile/PDB/Inputs')
4 files changed, 30 insertions, 0 deletions
diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp new file mode 100644 index 00000000000..3785cd3c64c --- /dev/null +++ b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp @@ -0,0 +1,20 @@ +namespace N0 { +namespace N1 { + +char *buf0 = nullptr; +char buf1[] = {0, 1, 2, 3, 4, 5, 6, 7}; + +char sum(char *buf, int size) { + char result = 0; + for (int i = 0; i < size; i++) + result += buf[i]; + return result; +} + +} // namespace N1 +} // namespace N0 + +int main() { + char result = N0::N1::sum(N0::N1::buf1, sizeof(N0::N1::buf1)); + return 0; +} diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script new file mode 100644 index 00000000000..d31a2abb68a --- /dev/null +++ b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script @@ -0,0 +1,7 @@ +breakpoint set --file ExpressionsTest.cpp --line 19 +run +print result +print N0::N1::sum(N0::N1::buf1, sizeof(N0::N1::buf1)) +print N1::sum(N1::buf1, sizeof(N1::buf1)) +print sum(buf1, sizeof(buf1)) +print sum(buf1, 1000000000) diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script new file mode 100644 index 00000000000..dac887faa5b --- /dev/null +++ b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script @@ -0,0 +1 @@ +print sum(buf0, 1) diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script new file mode 100644 index 00000000000..b19240baf99 --- /dev/null +++ b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script @@ -0,0 +1,2 @@ +print sum(buf0, result - 28) +print sum(buf1 + 3, 3) |

