[all-commits] [llvm/llvm-project] 0a7b0c: [lldb][Expression] Remove IR pointer checker (#144...
Michael Buch via All-commits
all-commits at lists.llvm.org
Tue Jun 17 07:24:48 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0a7b0c844c59189ad4f5072b73d7dfdfd78e76b7
https://github.com/llvm/llvm-project/commit/0a7b0c844c59189ad4f5072b73d7dfdfd78e76b7
Author: Michael Buch <michaelbuch12 at gmail.com>
Date: 2025-06-17 (Tue, 17 Jun 2025)
Changed paths:
M lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
M lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.h
M lldb/test/API/tools/lldb-dap/save-core/TestDAP_save_core.py
Log Message:
-----------
[lldb][Expression] Remove IR pointer checker (#144483)
Currently when jitting expressions, LLDB scans the IR instructions of
the `$__lldb_expr` and will insert a call to a utility function for each
load/store instruction. The purpose of the utility funciton is to
dereference the load/store operand. If that operand was an invalid
pointer the utility function would trap and LLDB asks the IR checker
whether it was responsible for the trap, in which case it prints out an
error message saying the expression dereferenced an invalid pointer.
This is a lot of setup for not much gain. In fact, creating/running this
utility expression shows up as ~2% of the expression evaluation time
(though we cache them for subsequent expressions). And the error message
we get out of it is arguably less useful than if we hadn't instrumented
the IR. It was also untested.
Before:
```
(lldb) expr int a = *returns_invalid_ptr()
error: Execution was interrupted, reason: Attempted to dereference an invalid pointer..
The process has been returned to the state before expression evaluation.
```
After:
```
(lldb) expr int a = *returns_invalid_ptr()
error: Expression execution was interrupted: EXC_BAD_ACCESS (code=1, address=0x5).
The process has been returned to the state before expression evaluation.
```
This patch removes this IR checker.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list