<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/146983>146983</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            SetKeepInMemory is not exposed on SBExpressionOptions which prevents saving persistent variables across expressions in the Python API
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          BlueFalconHD
      </td>
    </tr>
</table>

<pre>
    In the source for the `expr` command, LLDB sets the `SetKeepInMemory` flag on ExpressionOptions which allows something like:

```
(lldb) expr -l ObjC --
int (^$double)(int) = ^int(int num) {
return num*2;
};

(lldb) expr -l ObjC -- $double(2);
(int) $1 = 4
```

However, doing the same via the Python API is not possible, there is no switch on SBExpressionOptions to keep a variable saved for future expressions.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8kt1O-zgQxZ_GuRm1cp04Hxe5SCkVaFmBxBM4ybQxOHbkcVJ4-5XTsiBW-5cstTOeyfH85igifbaINZN7Jg-JmsPgfL03Mx6V6Zx9OCSt6z_rRwthQCA3-w7h5Pwaspzjx-RZzqFz46hsz8QdPD0d9kAY6KvmFcNfiNOj_RtH5z9j-cmoMzgL9x-TRyLt7PMUtLMEl0F3Ayhj3IWA3Ihh0PYMRr8jSxvG15Pz2-ENE6UxfctEBfEtsDHw3L7dwWbDeKNtACZKJu-ZyHo3twaZqJgotQ2xg6UHYPJ-jWIO7Dyu-WLPeOMxzN5ec41gacyx4nD78ydp-CFXiih57fkWFtluVc9-j8ObB3fBBX1E2bs4-0pejQiLVmvw8hkGZ6F5eQRNYF2AyRHpVe4uVni8XgBddOiGSPp1_1_WwcE74gQKFuW1ak3UWbBfF3yaw-xxnezaRdukr9O-SiuVYL0r5E5WaVbIZKizNJfF7tRJmWPZ9Tn2ZZ8X2BYdiqqSMtG14ELygmd8l2Wp3LYyzXZFdyp4mispe5ZxHJU2W2OWcev8OdFEM9a7LK_KNDGqRUOrTYWweIH1lgkRXevr2LRp5zOxjBtNgb4_E3QwWP-y4Bc2_JgcYf9_fK5enDwuaANFNnEdE3rSFNCGf7ERqM47op-0QNtfy0pmb-ohhImik8WRieNZh2Fut50bmTjGN99-NpN3b9gFJo7rpMTE8YZiqcU_AQAA__95jzEv">