diff --git a/lldb/test/API/commands/expression/call-function/TestCallStdStringFunction.py b/lldb/test/API/commands/expression/call-function/TestCallStdStringFunction.py --- a/lldb/test/API/commands/expression/call-function/TestCallStdStringFunction.py +++ b/lldb/test/API/commands/expression/call-function/TestCallStdStringFunction.py @@ -19,7 +19,7 @@ self.build() lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp")) - self.expect("print str", + self.expect("expression str", substrs=['Hello world']) # Calling this function now succeeds, but we follow the typedef return type through to @@ -32,5 +32,5 @@ if triple in ["arm64-apple-ios", "arm64e-apple-ios", "arm64-apple-tvos", "armv7k-apple-watchos", "arm64-apple-bridgeos", "arm64_32-apple-watchos"]: do_cstr_test = False if do_cstr_test: - self.expect("print str.c_str()", + self.expect("expression str.c_str()", substrs=['Hello world']) diff --git a/lldb/test/API/commands/expression/codegen-crash-typedefdecl-not-in_declcontext/main.cpp b/lldb/test/API/commands/expression/codegen-crash-typedefdecl-not-in_declcontext/main.cpp --- a/lldb/test/API/commands/expression/codegen-crash-typedefdecl-not-in_declcontext/main.cpp +++ b/lldb/test/API/commands/expression/codegen-crash-typedefdecl-not-in_declcontext/main.cpp @@ -23,7 +23,7 @@ E(B &b) : b_ref(b) {} NS::DW f() { return {}; }; void g() { - return; //%self.expect("p b_ref", substrs=['(B) $0 =', '(spd = NS::DW', 'a = 0)']) + return; //%self.expect("expression b_ref", substrs=['(B) $0 =', '(spd = NS::DW', 'a = 0)']) } B &b_ref; diff --git a/lldb/test/API/commands/expression/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/lldb/test/API/commands/expression/persist_objc_pointeetype/TestPersistObjCPointeeType.py --- a/lldb/test/API/commands/expression/persist_objc_pointeetype/TestPersistObjCPointeeType.py +++ b/lldb/test/API/commands/expression/persist_objc_pointeetype/TestPersistObjCPointeeType.py @@ -38,11 +38,16 @@ self.runCmd("run", RUN_SUCCEEDED) - self.expect("p *self", substrs=['_sc_name = nil', - '_sc_name2 = nil', - '_sc_name3 = nil', - '_sc_name4 = nil', - '_sc_name5 = nil', - '_sc_name6 = nil', - '_sc_name7 = nil', - '_sc_name8 = nil']) + self.expect( + "expression *self", + substrs=[ + "_sc_name = nil", + "_sc_name2 = nil", + "_sc_name3 = nil", + "_sc_name4 = nil", + "_sc_name5 = nil", + "_sc_name6 = nil", + "_sc_name7 = nil", + "_sc_name8 = nil", + ], + ) diff --git a/lldb/test/API/commands/expression/rdar44436068/main.c b/lldb/test/API/commands/expression/rdar44436068/main.c --- a/lldb/test/API/commands/expression/rdar44436068/main.c +++ b/lldb/test/API/commands/expression/rdar44436068/main.c @@ -2,7 +2,7 @@ { __int128_t n = 1; n = n + n; - return n; //%self.expect("p n", substrs=['(__int128_t) $0 = 2']) - //%self.expect("p n + 6", substrs=['(__int128_t) $1 = 8']) - //%self.expect("p n + n", substrs=['(__int128_t) $2 = 4']) + return n; //%self.expect("expression n", substrs=['(__int128_t) $0 = 2']) + //%self.expect("expression n + 6", substrs=['(__int128_t) $1 = 8']) + //%self.expect("expression n + n", substrs=['(__int128_t) $2 = 4']) } diff --git a/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/TestSVERegisters.py b/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/TestSVERegisters.py --- a/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/TestSVERegisters.py +++ b/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/TestSVERegisters.py @@ -163,7 +163,7 @@ self.check_sve_regs_read(z_reg_size) # Evaluate simple expression and print function expr_eval_func address. - self.expect("p expr_eval_func", substrs=["= 0x"]) + self.expect("expression expr_eval_func", substrs=["= 0x"]) # Evaluate expression call function expr_eval_func. self.expect_expr("expr_eval_func()", diff --git a/lldb/test/API/commands/target/dump-pcm-info/TestDumpPCMInfo.py b/lldb/test/API/commands/target/dump-pcm-info/TestDumpPCMInfo.py --- a/lldb/test/API/commands/target/dump-pcm-info/TestDumpPCMInfo.py +++ b/lldb/test/API/commands/target/dump-pcm-info/TestDumpPCMInfo.py @@ -27,7 +27,7 @@ self.runCmd(f"settings set symbols.clang-modules-cache-path '{mod_cache}'") # Cause lldb to generate a Darwin-*.pcm - self.runCmd("p @import Darwin") + self.runCmd("expression @import Darwin") # root//-.pcm pcm_paths = glob.glob(os.path.join(mod_cache, '*', 'Darwin-*.pcm')) diff --git a/lldb/test/API/functionalities/alias/Makefile b/lldb/test/API/functionalities/alias/Makefile new file mode 100644 --- /dev/null +++ b/lldb/test/API/functionalities/alias/Makefile @@ -0,0 +1,4 @@ +C_SOURCES := main.c +CFLAGS_EXTRAS := -std=c99 + +include Makefile.rules diff --git a/lldb/test/API/functionalities/alias/TestPAlias.py b/lldb/test/API/functionalities/alias/TestPAlias.py new file mode 100644 --- /dev/null +++ b/lldb/test/API/functionalities/alias/TestPAlias.py @@ -0,0 +1,11 @@ +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", substrs=["$0 = -"]) + self.expect("p -i0 -g", error=True) diff --git a/lldb/test/API/functionalities/alias/main.c b/lldb/test/API/functionalities/alias/main.c new file mode 100644 --- /dev/null +++ b/lldb/test/API/functionalities/alias/main.c @@ -0,0 +1,4 @@ +int main() { + int g = 41; + return 0; +} diff --git a/lldb/test/API/functionalities/backticks/TestBackticksWithoutATarget.py b/lldb/test/API/functionalities/backticks/TestBackticksWithoutATarget.py --- a/lldb/test/API/functionalities/backticks/TestBackticksWithoutATarget.py +++ b/lldb/test/API/functionalities/backticks/TestBackticksWithoutATarget.py @@ -15,5 +15,5 @@ @no_debug_info_test def test_backticks_no_target(self): """A simple test of backticks without a target.""" - self.expect("print `1+2-3`", + self.expect("expression `1+2-3`", substrs=[' = 0']) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/lldb/test/API/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py @@ -260,13 +260,13 @@ "type summary add Shape -w BaseCategory --summary-string \"AShape\"") self.runCmd("type category enable BaseCategory") - self.expect("print (Shape*)&c1", + self.expect("expression (Shape*)&c1", substrs=['AShape']) - self.expect("print (Shape*)&r1", + self.expect("expression (Shape*)&r1", substrs=['AShape']) - self.expect("print (Shape*)c_ptr", + self.expect("expression (Shape*)c_ptr", substrs=['AShape']) - self.expect("print (Shape*)r_ptr", + self.expect("expression (Shape*)r_ptr", substrs=['AShape']) self.runCmd( diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -102,17 +102,17 @@ # check that rdar://problem/10011145 (Standard summary format for # char[] doesn't work as the result of "expr".) is solved - self.expect("p strarr", + self.expect("expression strarr", substrs=['arr = "Hello world!']) self.expect("frame variable strptr", substrs=['ptr = "Hello world!"']) - self.expect("p strptr", + self.expect("expression strptr", substrs=['ptr = "Hello world!"']) self.expect( - "p (char*)\"1234567890123456789012345678901234567890123456789012345678901234ABC\"", + "expression (char*)\"1234567890123456789012345678901234567890123456789012345678901234ABC\"", substrs=[ '(char *) $', ' = ptr = ', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/lldb/test/API/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py @@ -45,10 +45,10 @@ # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) - self.expect('p *(int (*)[3])foo', + self.expect('expression *(int (*)[3])foo', substrs=['(int[3]) $', '[0] = 1', '[1] = 2', '[2] = 3']) - self.expect('p *(int (*)[3])foo', matching=False, + self.expect('expression *(int (*)[3])foo', matching=False, substrs=['01 00 00 00 02 00 00 00 03 00 00 00']) - self.expect('p *(int (*)[3])foo', matching=False, + self.expect('expression *(int (*)[3])foo', matching=False, substrs=['0x000000030000000200000001']) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/lldb/test/API/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py @@ -76,11 +76,11 @@ substrs=['arr = \"', 'Nested Hello world!']) - self.expect("p strarr", + self.expect("expression strarr", substrs=['arr = \"', 'Hello world!']) - self.expect("p other.strarr", + self.expect("expression other.strarr", substrs=['arr = \"', 'Nested Hello world!']) @@ -96,11 +96,11 @@ substrs=['ptr = \"', 'Nested Hello world!']) - self.expect("p strptr", + self.expect("expression strptr", substrs=['ptr = \"', 'Hello world!']) - self.expect("p other.strptr", + self.expect("expression other.strptr", substrs=['ptr = \"', 'Nested Hello world!']) @@ -115,11 +115,11 @@ substrs=['arr = \"', 'Nested Hello world!']) - self.expect("p strarr", + self.expect("expression strarr", substrs=['arr = \"', 'Hello world!']) - self.expect("p other.strarr", + self.expect("expression other.strarr", substrs=['arr = \"', 'Nested Hello world!']) @@ -135,11 +135,11 @@ substrs=['arr = ', 'Nested Hello world!']) - self.expect("p strarr", + self.expect("expression strarr", substrs=['arr = \"', 'Hello world!']) - self.expect("p other.strarr", + self.expect("expression other.strarr", substrs=['arr = ', 'Nested Hello world!']) @@ -154,11 +154,11 @@ substrs=['ptr = \"', 'Nested Hello world!']) - self.expect("p strptr", + self.expect("expression strptr", substrs=['ptr = \"', 'Hello world!']) - self.expect("p other.strptr", + self.expect("expression other.strptr", substrs=['ptr = \"', 'Nested Hello world!']) @@ -174,11 +174,11 @@ substrs=['arr = ', 'Nested Hello world!']) - self.expect("p strarr", + self.expect("expression strarr", substrs=['arr = \"', 'Hello world!']) - self.expect("p other.strarr", + self.expect("expression other.strarr", substrs=['arr = ', 'Nested Hello world!']) @@ -193,11 +193,11 @@ substrs=['ptr = \"', 'Nested Hello world!']) - self.expect("p strptr", + self.expect("expression strptr", substrs=['ptr = \"', 'Hello world!']) - self.expect("p other.strptr", + self.expect("expression other.strptr", substrs=['ptr = \"', 'Nested Hello world!']) @@ -214,11 +214,11 @@ substrs=['ptr = \"', 'Nested Hello world!']) - self.expect("p strptr", matching=False, + self.expect("expression strptr", matching=False, substrs=['ptr = \"', 'Hello world!']) - self.expect("p other.strptr", matching=False, + self.expect("expression other.strptr", matching=False, substrs=['ptr = \"', 'Nested Hello world!']) @@ -234,11 +234,11 @@ substrs=['ptr = ', '[{N},{e}]']) - self.expect("p strptr", + self.expect("expression strptr", substrs=['ptr = ', '[{H},{e}]']) - self.expect("p other.strptr", + self.expect("expression other.strptr", substrs=['ptr = ', '[{N},{e}]']) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py @@ -73,7 +73,7 @@ substrs=['size=0', '{}']) - self.expect("p numbers_list", + self.expect("expression numbers_list", substrs=['size=0', '{}']) @@ -114,7 +114,7 @@ '[5] =', '0x0cab0cab']) - self.expect("p numbers_list", + self.expect("expression numbers_list", substrs=['size=6', '[0] = ', '0x12345678', @@ -186,7 +186,7 @@ '[2]', 'smart', '[3]', '!!!']) - self.expect("p text_list", + self.expect("expression text_list", substrs=['size=4', '\"goofy\"', '\"is\"', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py @@ -119,7 +119,7 @@ self.check("ii", 8) - self.expect("p ii", + self.expect("expression ii", substrs=[multimap, 'size=8', '[5] = ', 'first = 5', @@ -180,7 +180,7 @@ '[3] = (first = "zero", second = 0)', ]) - self.expect("p si", + self.expect("expression si", substrs=[multimap, 'size=4', '[0] = (first = "one", second = 1)', '[1] = (first = "three", second = 3)', @@ -232,7 +232,7 @@ ]) self.expect( - "p is", + "expression is", substrs=[ multimap, 'size=4', @@ -291,7 +291,7 @@ self.check("ss", 3) self.expect( - "p ss", + "expression ss", substrs=[ multimap, 'size=3', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multiset/TestDataFormatterGenericMultiSet.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multiset/TestDataFormatterGenericMultiSet.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multiset/TestDataFormatterGenericMultiSet.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multiset/TestDataFormatterGenericMultiSet.py @@ -107,7 +107,7 @@ ]) self.check("ss", 4) self.expect( - "p ss", + "expression ss", substrs=[ "size=4", '[0] = "a"', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py @@ -101,7 +101,7 @@ '[2] = "b"', '[3] = "c"']) self.expect( - "p ss", + "expression ss", substrs=["size=4", '[0] = "a"', '[1] = "a very long string is right here"', @@ -147,4 +147,4 @@ @add_test_categories(["libc++"]) def test_ref_and_ptr_libcpp(self): - self.do_test_ref_and_ptr(USE_LIBCPP) \ No newline at end of file + self.do_test_ref_and_ptr(USE_LIBCPP) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -90,7 +90,7 @@ lldbutil.continue_to_breakpoint(self.process(), bkpt) - self.expect("p ii", + self.expect("expression ii", substrs=['%s::map' % ns, 'size=8', '[5] = ', 'first = 5', @@ -171,7 +171,7 @@ ]) self.expect( - "p si", + "expression si", substrs=[ '%s::map' % ns, 'size=4', @@ -225,7 +225,7 @@ ]) self.expect( - "p is", + "expression is", substrs=[ '%s::map' % ns, 'size=4', @@ -278,7 +278,7 @@ ]) self.expect( - "p ss", + "expression ss", substrs=[ '%s::map' % ns, 'size=3', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py @@ -88,7 +88,7 @@ '[3] = 1234', '}']) - self.expect("p numbers", + self.expect("expression numbers", substrs=['$', 'size=4', '[0] = 1', '[1] = 12', @@ -135,7 +135,7 @@ 'is', 'smart']) - self.expect("p strings", + self.expect("expression strings", substrs=['goofy', 'is', 'smart']) @@ -149,7 +149,7 @@ 'is', 'smart']) - self.expect("p strings", + self.expect("expression strings", substrs=['vector has 3 items', 'goofy', 'is', @@ -185,4 +185,4 @@ self.expect("frame variable ptr", substrs=['ptr =', ' size=7']) - self.expect("p ptr", substrs=['$', 'size=7']) + self.expect("expression ptr", substrs=['$', 'size=7']) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py @@ -91,7 +91,7 @@ 'first = 7', 'second = 1']) - self.expect("p ii", + self.expect("expression ii", substrs=['map has 9 items', '[5] = ', 'first = 5', @@ -158,7 +158,7 @@ ]) self.expect( - "p si", + "expression si", substrs=[ 'map has 5 items', '[0] = (first = "four", second = 4)', @@ -210,7 +210,7 @@ ]) self.expect( - "p is", + "expression is", substrs=[ 'map has 4 items', '[0] = (first = 1, second = "is")', '[1] = (first = 2, second = "smart")', @@ -261,7 +261,7 @@ ]) self.expect( - "p ss", + "expression ss", substrs=[ 'map has 4 items', '[0] = (first = "a Mac..", second = "..is always a Mac!")', diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py @@ -72,7 +72,7 @@ '[3] = 1234', '}']) - self.expect("p numbers", + self.expect("expression numbers", substrs=['$', 'size=4', '[0] = 1', '[1] = 12', @@ -110,7 +110,7 @@ '[6] = 1234567', '}']) - self.expect("p numbers", + self.expect("expression numbers", substrs=['$', 'size=7', '[0] = 1', '[1] = 12', @@ -164,7 +164,7 @@ 'is', 'smart']) - self.expect("p strings", + self.expect("expression strings", substrs=['goofy', 'is', 'smart']) @@ -178,7 +178,7 @@ 'is', 'smart']) - self.expect("p strings", + self.expect("expression strings", substrs=['vector has 3 items', 'goofy', 'is', diff --git a/lldb/test/API/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/API/functionalities/inferior-assert/TestInferiorAssert.py --- a/lldb/test/API/functionalities/inferior-assert/TestInferiorAssert.py +++ b/lldb/test/API/functionalities/inferior-assert/TestInferiorAssert.py @@ -240,10 +240,10 @@ if 'main' == frame.GetFunctionName(): frame_id = frame.GetFrameID() self.runCmd("frame select " + str(frame_id), RUN_SUCCEEDED) - self.expect("p argc", substrs=['(int)', ' = 1']) - self.expect("p hello_world", substrs=['Hello']) - self.expect("p argv[0]", substrs=['a.out']) - self.expect("p null_ptr", substrs=['= 0x0']) + self.expect("expression argc", substrs=['(int)', ' = 1']) + self.expect("expression hello_world", substrs=['Hello']) + self.expect("expression argv[0]", substrs=['a.out']) + self.expect("expression null_ptr", substrs=['= 0x0']) return True return False diff --git a/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashing.py --- a/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashing.py +++ b/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -124,8 +124,8 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p argc", + self.expect("expression argc", startstr='(int) $0 = 1') - self.expect("p hello_world", + self.expect("expression hello_world", substrs=['Hello']) diff --git a/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashingStep.py b/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashingStep.py --- a/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashingStep.py +++ b/lldb/test/API/functionalities/inferior-crashing/TestInferiorCrashingStep.py @@ -145,9 +145,9 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p argc", startstr='(int) $0 = 1') + self.expect("expression argc", startstr='(int) $0 = 1') - self.expect("p hello_world", substrs=['Hello']) + self.expect("expression hello_world", substrs=['Hello']) def inferior_crashing_step(self): """Test that lldb functions correctly after stepping through a crash.""" @@ -167,8 +167,8 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p argv[0]", substrs=['a.out']) - self.expect("p null_ptr", substrs=['= 0x0']) + self.expect("expression argv[0]", substrs=['a.out']) + self.expect("expression null_ptr", substrs=['= 0x0']) # lldb should be able to read from registers from the inferior after # crashing. @@ -212,11 +212,11 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p argv[0]", substrs=['a.out']) + self.expect("expression argv[0]", substrs=['a.out']) self.runCmd("next") self.check_stop_reason() # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p argv[0]", substrs=['a.out']) + self.expect("expression argv[0]", substrs=['a.out']) diff --git a/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py --- a/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ b/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -134,5 +134,5 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p i", + self.expect("expression i", startstr='(int) $0 =') diff --git a/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py b/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py --- a/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py +++ b/lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py @@ -68,7 +68,7 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p i", substrs=['(int) $0 =']) + self.expect("expression i", substrs=['(int) $0 =']) # lldb should be able to read from registers from the inferior after # crashing. @@ -111,12 +111,12 @@ # The lldb expression interpreter should be able to read from addresses # of the inferior after a crash. - self.expect("p null", startstr='(char *) $0 = 0x0') + self.expect("expression null", startstr='(char *) $0 = 0x0') self.runCmd("next") # The lldb expression interpreter should be able to read from addresses # of the inferior after a step. - self.expect("p null", startstr='(char *) $1 = 0x0') + self.expect("expression null", startstr='(char *) $1 = 0x0') self.check_stop_reason() diff --git a/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py b/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py --- a/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py +++ b/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py @@ -31,8 +31,8 @@ # View the first element of `first` and `second` while # they have no load address set. - self.expect("p/d ((int*)&first)[0]", substrs=['= 5']) - self.expect("p/d ((int*)&second)[0]", substrs=['= 6']) + self.expect("expression/d ((int*)&first)[0]", substrs=['= 5']) + self.expect("expression/d ((int*)&second)[0]", substrs=['= 6']) self.assertEqual(first_sym.GetStartAddress().GetLoadAddress(target), lldb.LLDB_INVALID_ADDRESS) self.assertEqual(second_sym.GetStartAddress().GetLoadAddress(target), lldb.LLDB_INVALID_ADDRESS) @@ -44,8 +44,8 @@ # 0x1000 - 0x17ff first[] # 0x1800 - 0x1fff second[] target.SetModuleLoadAddress(module, 0) - self.expect("p/d ((int*)&first)[0]", substrs=['= 5']) - self.expect("p/d ((int*)&second)[0]", substrs=['= 6']) + self.expect("expression/d ((int*)&first)[0]", substrs=['= 5']) + self.expect("expression/d ((int*)&second)[0]", substrs=['= 6']) self.assertEqual(first_sym.GetStartAddress().GetLoadAddress(target), first_sym.GetStartAddress().GetFileAddress()) self.assertEqual(second_sym.GetStartAddress().GetLoadAddress(target), @@ -61,8 +61,8 @@ # the beginning address of second[] will get a load address # of 0x1800, instead of 0x17c0 (0x1800-64) as we need to get. target.SetModuleLoadAddress(module, first_size - 64) - self.expect("p/d ((int*)&first)[0]", substrs=['= 5']) - self.expect("p/d ((int*)&second)[0]", substrs=['= 6']) + self.expect("expression/d ((int*)&first)[0]", substrs=['= 5']) + self.expect("expression/d ((int*)&second)[0]", substrs=['= 6']) self.assertNotEqual(first_sym.GetStartAddress().GetLoadAddress(target), first_sym.GetStartAddress().GetFileAddress()) self.assertNotEqual(second_sym.GetStartAddress().GetLoadAddress(target), @@ -70,8 +70,8 @@ # Slide it back to the original vmaddr. target.SetModuleLoadAddress(module, 0) - self.expect("p/d ((int*)&first)[0]", substrs=['= 5']) - self.expect("p/d ((int*)&second)[0]", substrs=['= 6']) + self.expect("expression/d ((int*)&first)[0]", substrs=['= 5']) + self.expect("expression/d ((int*)&second)[0]", substrs=['= 6']) self.assertEqual(first_sym.GetStartAddress().GetLoadAddress(target), first_sym.GetStartAddress().GetFileAddress()) self.assertEqual(second_sym.GetStartAddress().GetLoadAddress(target), diff --git a/lldb/test/API/functionalities/set-data/TestSetData.py b/lldb/test/API/functionalities/set-data/TestSetData.py --- a/lldb/test/API/functionalities/set-data/TestSetData.py +++ b/lldb/test/API/functionalities/set-data/TestSetData.py @@ -24,7 +24,7 @@ self.runCmd("run", RUN_SUCCEEDED) - self.expect("p myFoo.x", VARIABLES_DISPLAYED_CORRECTLY, + self.expect("expression myFoo.x", VARIABLES_DISPLAYED_CORRECTLY, substrs=['2']) process = self.dbg.GetSelectedTarget().GetProcess() @@ -40,7 +40,7 @@ self.runCmd("continue") - self.expect("p myFoo.x", VARIABLES_DISPLAYED_CORRECTLY, + self.expect("expression myFoo.x", VARIABLES_DISPLAYED_CORRECTLY, substrs=['4']) frame = process.GetSelectedThread().GetFrameAtIndex(0) diff --git a/lldb/test/API/functionalities/ubsan/user-expression/TestUbsanUserExpression.py b/lldb/test/API/functionalities/ubsan/user-expression/TestUbsanUserExpression.py --- a/lldb/test/API/functionalities/ubsan/user-expression/TestUbsanUserExpression.py +++ b/lldb/test/API/functionalities/ubsan/user-expression/TestUbsanUserExpression.py @@ -38,7 +38,7 @@ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', 'stop reason = breakpoint']) - self.expect("p foo()", substrs=["(int) $0 = 42"]) + self.expect("expression foo()", substrs=["(int) $0 = 42"]) self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', 'stop reason = breakpoint']) diff --git a/lldb/test/API/lang/c/enum_types/TestEnumTypes.py b/lldb/test/API/lang/c/enum_types/TestEnumTypes.py --- a/lldb/test/API/lang/c/enum_types/TestEnumTypes.py +++ b/lldb/test/API/lang/c/enum_types/TestEnumTypes.py @@ -42,7 +42,7 @@ # Test the behavior in case have a variable of a type considered # 'bitfield' by the heuristic, but the value isn't actually fully # covered by the enumerators. - self.expect("p (enum bitfield)nonsense", DATA_TYPES_DISPLAYED_CORRECTLY, + self.expect("expression (enum bitfield)nonsense", DATA_TYPES_DISPLAYED_CORRECTLY, patterns=[' = B | C | 0x10$']) # Break inside the main. diff --git a/lldb/test/API/lang/c/strings/TestCStrings.py b/lldb/test/API/lang/c/strings/TestCStrings.py --- a/lldb/test/API/lang/c/strings/TestCStrings.py +++ b/lldb/test/API/lang/c/strings/TestCStrings.py @@ -40,14 +40,14 @@ substrs=['[0] = \'h\'', '[5] = \'\\0\'']) - self.expect("p \"hello\"", + self.expect("expression \"hello\"", substrs=['[6]) $', 'hello']) - self.expect("p (char*)\"hello\"", + self.expect("expression (char*)\"hello\"", substrs=['(char *) $', ' = 0x', 'hello']) - self.expect("p (int)strlen(\"\")", + self.expect("expression (int)strlen(\"\")", substrs=['(int) $', ' = 0']) self.expect("expression !z", diff --git a/lldb/test/API/lang/cpp/namespace/TestNamespace.py b/lldb/test/API/lang/cpp/namespace/TestNamespace.py --- a/lldb/test/API/lang/cpp/namespace/TestNamespace.py +++ b/lldb/test/API/lang/cpp/namespace/TestNamespace.py @@ -220,8 +220,8 @@ # global namespace qualification with function in anonymous namespace self.expect_expr("myanonfunc(4)", result_value="8") - self.expect("p myanonfunc", + self.expect("expression myanonfunc", patterns=['\(anonymous namespace\)::myanonfunc\(int\)']) - self.expect("p variadic_sum", patterns=[ + self.expect("expression variadic_sum", patterns=[ '\(anonymous namespace\)::variadic_sum\(int, ...\)']) diff --git a/lldb/test/API/lang/cpp/unique-types4/TestUniqueTypes4.py b/lldb/test/API/lang/cpp/unique-types4/TestUniqueTypes4.py --- a/lldb/test/API/lang/cpp/unique-types4/TestUniqueTypes4.py +++ b/lldb/test/API/lang/cpp/unique-types4/TestUniqueTypes4.py @@ -13,12 +13,12 @@ self.build(dictionary=debug_flags) lldbutil.run_to_source_breakpoint(self, "// Set breakpoint here", lldb.SBFileSpec("main.cpp")) # FIXME: these should successfully print the values - self.expect("print ns::Foo::value", substrs=["no member named"], error=True) - self.expect("print ns::Foo::value", substrs=["no member named"], error=True) - self.expect("print ns::Bar::value", substrs=["no member named"], error=True) - self.expect("print ns::Bar::value", substrs=["no member named"], error=True) - self.expect("print ns::FooDouble::value", substrs=["Couldn't lookup symbols"], error=True) - self.expect("print ns::FooInt::value", substrs=["Couldn't lookup symbols"], error=True) + self.expect("expression ns::Foo::value", substrs=["no member named"], error=True) + self.expect("expression ns::Foo::value", substrs=["no member named"], error=True) + self.expect("expression ns::Bar::value", substrs=["no member named"], error=True) + self.expect("expression ns::Bar::value", substrs=["no member named"], error=True) + self.expect("expression ns::FooDouble::value", substrs=["Couldn't lookup symbols"], error=True) + self.expect("expression ns::FooInt::value", substrs=["Couldn't lookup symbols"], error=True) @skipIf(compiler=no_match("clang")) @skipIf(compiler_version=["<", "15.0"]) diff --git a/lldb/test/API/lang/objc/foundation/TestObjCMethodsNSError.py b/lldb/test/API/lang/objc/foundation/TestObjCMethodsNSError.py --- a/lldb/test/API/lang/objc/foundation/TestObjCMethodsNSError.py +++ b/lldb/test/API/lang/objc/foundation/TestObjCMethodsNSError.py @@ -41,6 +41,6 @@ self.target, process, thread, bkpt = lldbutil.run_to_source_breakpoint( self, '// Set break point at this line', lldb.SBFileSpec('main.m', False)) - self.expect("p [NSError thisMethodIsntImplemented:0]", error=True, patterns=[ + self.expect("expression [NSError thisMethodIsntImplemented:0]", error=True, patterns=[ "no known method", "cast the message send to the method's return type"]) self.runCmd("process continue") diff --git a/lldb/test/API/lang/objc/modules-auto-import/TestModulesAutoImport.py b/lldb/test/API/lang/objc/modules-auto-import/TestModulesAutoImport.py --- a/lldb/test/API/lang/objc/modules-auto-import/TestModulesAutoImport.py +++ b/lldb/test/API/lang/objc/modules-auto-import/TestModulesAutoImport.py @@ -39,5 +39,5 @@ self.runCmd("settings set target.auto-import-clang-modules true") - self.expect("p getpid()", VARIABLES_DISPLAYED_CORRECTLY, + self.expect("expression getpid()", VARIABLES_DISPLAYED_CORRECTLY, substrs=["pid_t"]) diff --git a/lldb/test/API/lang/objc/modules/TestObjCModules.py b/lldb/test/API/lang/objc/modules/TestObjCModules.py --- a/lldb/test/API/lang/objc/modules/TestObjCModules.py +++ b/lldb/test/API/lang/objc/modules/TestObjCModules.py @@ -60,7 +60,7 @@ substrs=["NSUInteger", "3"]) self.expect( - "p *[NSURL URLWithString:@\"http://lldb.llvm.org\"]", + "expression *[NSURL URLWithString:@\"http://lldb.llvm.org\"]", VARIABLES_DISPLAYED_CORRECTLY, substrs=[ "NSURL", @@ -68,7 +68,7 @@ "_urlString"]) self.expect( - "p [NSURL URLWithString:@\"http://lldb.llvm.org\"].scheme", + "expression [NSURL URLWithString:@\"http://lldb.llvm.org\"].scheme", VARIABLES_DISPLAYED_CORRECTLY, substrs=["http"]) # Test that the NULL macro still works with a loaded module. diff --git a/lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py --- a/lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py +++ b/lldb/test/API/lang/objc/objc-struct-argument/TestObjCStructArgument.py @@ -52,7 +52,7 @@ frame = thread_list[0].GetFrameAtIndex(0) self.assertTrue(frame, "Got a valid frame 0 frame.") - self.expect("p [summer sumThings:tts]", substrs=['9']) + self.expect("expression [summer sumThings:tts]", substrs=['9']) self.expect( "po [NSValue valueWithRect:rect]", diff --git a/lldb/test/API/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py b/lldb/test/API/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py --- a/lldb/test/API/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py +++ b/lldb/test/API/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py @@ -43,4 +43,4 @@ ]) # rdar://problem/9691614 - self.runCmd('p (int)[my isValid]') + self.runCmd('expression (int)[my isValid]') diff --git a/lldb/test/API/linux/aarch64/non_address_bit_memory_access/TestAArch64LinuxNonAddressBitMemoryAccess.py b/lldb/test/API/linux/aarch64/non_address_bit_memory_access/TestAArch64LinuxNonAddressBitMemoryAccess.py --- a/lldb/test/API/linux/aarch64/non_address_bit_memory_access/TestAArch64LinuxNonAddressBitMemoryAccess.py +++ b/lldb/test/API/linux/aarch64/non_address_bit_memory_access/TestAArch64LinuxNonAddressBitMemoryAccess.py @@ -153,10 +153,10 @@ # This should fill the cache by doing a read of buf_with_non_address # with the non-address bits removed (which is == buf). - self.runCmd("p buf_with_non_address") + self.runCmd("expression buf_with_non_address") # This will read from the cache since the two pointers point to the # same place. - self.runCmd("p buf") + self.runCmd("expression buf") # Open log ignoring utf-8 decode errors with open(log_file, 'r', errors='ignore') as f: diff --git a/lldb/test/API/linux/builtin_trap/TestBuiltinTrap.py b/lldb/test/API/linux/builtin_trap/TestBuiltinTrap.py --- a/lldb/test/API/linux/builtin_trap/TestBuiltinTrap.py +++ b/lldb/test/API/linux/builtin_trap/TestBuiltinTrap.py @@ -46,4 +46,4 @@ self.runCmd("up", RUN_SUCCEEDED) # evaluate a local - self.expect('p foo', substrs=['= 5']) + self.expect('expression foo', substrs=['= 5']) diff --git a/lldb/test/API/lua_api/TestFileHandle.lua b/lldb/test/API/lua_api/TestFileHandle.lua --- a/lldb/test/API/lua_api/TestFileHandle.lua +++ b/lldb/test/API/lua_api/TestFileHandle.lua @@ -16,7 +16,7 @@ function _T:TestLegacyFileOut() local f = io.open(self.output, 'w') self.debugger:SetOutputFile(f) - self:handle_command('p/x 3735928559', false) + self:handle_command('expression/x 3735928559', false) f:close() f = io.open(self.output, 'r') diff --git a/lldb/test/API/macosx/early-process-launch/TestEarlyProcessLaunch.py b/lldb/test/API/macosx/early-process-launch/TestEarlyProcessLaunch.py --- a/lldb/test/API/macosx/early-process-launch/TestEarlyProcessLaunch.py +++ b/lldb/test/API/macosx/early-process-launch/TestEarlyProcessLaunch.py @@ -40,14 +40,14 @@ logfile_early = os.path.join(self.getBuildDir(), "types-log-early.txt") self.addTearDownHook(lambda: self.runCmd("log disable lldb types")) self.runCmd("log enable -f %s lldb types" % logfile_early) - self.runCmd("p global = 15") + self.runCmd("expression global = 15") err = process.Continue() self.assertTrue(err.Success()) logfile_later = os.path.join(self.getBuildDir(), "types-log-later.txt") self.runCmd("log enable -f %s lldb types" % logfile_later) - self.runCmd("p global = 25") + self.runCmd("expression global = 25") self.assertTrue(os.path.exists(logfile_early)) self.assertTrue(os.path.exists(logfile_later)) diff --git a/lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py b/lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py --- a/lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py +++ b/lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py @@ -21,7 +21,7 @@ patterns=[self.getArchitecture() + r'.*-apple-ios.*-macabi a\.out']) self.expect("fr v s", substrs=["Hello macCatalyst"]) - self.expect("p s", substrs=["Hello macCatalyst"]) + self.expect("expression s", substrs=["Hello macCatalyst"]) self.check_debugserver(log) def check_debugserver(self, log): diff --git a/lldb/test/API/macosx/macCatalystAppMacOSFramework/TestMacCatalystAppWithMacOSFramework.py b/lldb/test/API/macosx/macCatalystAppMacOSFramework/TestMacCatalystAppWithMacOSFramework.py --- a/lldb/test/API/macosx/macCatalystAppMacOSFramework/TestMacCatalystAppWithMacOSFramework.py +++ b/lldb/test/API/macosx/macCatalystAppMacOSFramework/TestMacCatalystAppWithMacOSFramework.py @@ -24,7 +24,7 @@ patterns=[arch + r'.*-apple-ios.*-macabi a\.out', arch + r'.*-apple-macosx.* libfoo.dylib[^(]']) self.expect("fr v s", "Hello macCatalyst") - self.expect("p s", "Hello macCatalyst") + self.expect("expression s", "Hello macCatalyst") self.check_debugserver(log) def check_debugserver(self, log): diff --git a/lldb/test/API/python_api/file_handle/TestFileHandle.py b/lldb/test/API/python_api/file_handle/TestFileHandle.py --- a/lldb/test/API/python_api/file_handle/TestFileHandle.py +++ b/lldb/test/API/python_api/file_handle/TestFileHandle.py @@ -135,7 +135,7 @@ def test_legacy_file_out(self): with open(self.out_filename, 'w') as f: self.dbg.SetOutputFileHandle(f, False) - self.handleCmd('p/x 3735928559', collect_result=False, check=False) + self.handleCmd('expression/x 3735928559', collect_result=False, check=False) with open(self.out_filename, 'r') as f: self.assertIn('deadbeef', f.read()) @@ -359,7 +359,7 @@ def test_string_inout(self): - inf = io.StringIO("help help\np/x ~0\n") + inf = io.StringIO("help help\nexpression/x ~0\n") outf = io.StringIO() status = self.dbg.SetOutputFile(lldb.SBFile(outf)) self.assertSuccess(status) diff --git a/lldb/test/API/types/TestRecursiveTypes.py b/lldb/test/API/types/TestRecursiveTypes.py --- a/lldb/test/API/types/TestRecursiveTypes.py +++ b/lldb/test/API/types/TestRecursiveTypes.py @@ -48,5 +48,5 @@ self.runCmd("run", RUN_SUCCEEDED) - self.runCmd("print tpi") - self.runCmd("print *tpi") + self.runCmd("expression tpi") + self.runCmd("expression *tpi")