Dave Lee 3854963854 Recommit [lldb] Change dwim-print to default to disabled persistent results
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Updates: To recommit this, both TestPersistentResult.py and TestPAlias.py needed to be
updated, as well as the changes in D146230.

Differential Revision: https://reviews.llvm.org/D145609
2023-03-21 10:42:24 -07:00

12 lines
341 B
Python

import lldb
from lldbsuite.test.lldbtest import TestBase
from lldbsuite.test import lldbutil
class TestCase(TestBase):
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.c"))
self.expect("p -g", startstr="(int) -41")
self.expect("p -i0 -g", error=True)