Skip to content

Commit d875838

Browse files
committed
[lldb][test] Replace use of p with expression in Shell tests (NFC)
In Shell tests, replace use of the `p` alias with the `expression` command. To avoid conflating tests of the alias with tests of the expression command, this patch canonicalizes to the use `expression`. See also D141539 which made the same change to API tests. Differential Revision: https://reviews.llvm.org/D146230
1 parent 147b609 commit d875838

27 files changed

+105
-105
lines changed

lldb/test/Shell/Commands/command-source.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# RUN: %lldb -x -b -o 'settings set interpreter.stop-command-source-on-error false' -o "command source %s" 2>&1 | FileCheck %s --check-prefix CONTINUE
77

88
bogus
9-
p 10+1
9+
expression 10+1
1010

1111
# CONTINUE: $0 = 11
1212
# STOP-NOT: $0 = 11
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# RUN: %clang_host -g %S/Inputs/main.c -o %t
2-
# RUN: %lldb -b -o 'target stop-hook add --name test --shlib test -o "p 95000 + 126"' -o 'file %t' -o 'b main' -o 'r' 2>&1 | FileCheck %s
2+
# RUN: %lldb -b -o 'target stop-hook add --name test --shlib test -o "expression 95000 + 126"' -o 'file %t' -o 'b main' -o 'r' 2>&1 | FileCheck %s
33
# CHECK: Stop hook #1 added
44
# CHECK-NOT: 95126

lldb/test/Shell/Expr/nodefaultlib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
// XFAIL: system-netbsd || system-freebsd || system-darwin
88

99
// RUN: %build %s --nodefaultlib -o %t
10-
// RUN: %lldb %t -o "b main" -o run -o "p call_me(5, 6)" -o exit \
10+
// RUN: %lldb %t -o "b main" -o run -o "expression call_me(5, 6)" -o exit \
1111
// RUN: | FileCheck %s
1212

13-
// CHECK: p call_me(5, 6)
13+
// CHECK: expression call_me(5, 6)
1414
// CHECK: (int) $0 = 30
1515

1616
int call_me(int x, long y) { return x * y; }

lldb/test/Shell/Register/x86-64-fp-read.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ process launch
99
# CHECK: Process {{.*}} stopped
1010

1111
# fdiv (%rbx) gets encoded into 2 bytes, int3 into 1 byte
12-
print (void*)($pc-3)
12+
expression (void*)($pc-3)
1313
# CHECK: (void *) $0 = [[FDIV:0x[0-9a-f]*]]
14-
print &zero
14+
expression &zero
1515
# CHECK: (uint32_t *) $1 = [[ZERO:0x[0-9a-f]*]]
1616

1717
register read --all
@@ -32,9 +32,9 @@ register read --all
3232
# CHECK-DAG: st{{(mm)?}}7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
3333

3434
# legacy approach, superseded by fip/fdp registers
35-
print (void*)($fiseg*0x100000000 + $fioff)
35+
expression (void*)($fiseg*0x100000000 + $fioff)
3636
# CHECK: (void *) $2 = [[FDIV]]
37-
print (uint32_t*)($foseg * 0x100000000 + $fooff)
37+
expression (uint32_t*)($foseg * 0x100000000 + $fooff)
3838
# CHECK: (uint32_t *) $3 = [[ZERO]]
3939

4040
process continue

lldb/test/Shell/Register/x86-db-read.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ watchpoint set variable -w write g_32w
1515
watchpoint set variable -w read_write g_32rw
1616
# CHECK: Watchpoint created: Watchpoint 4: addr = 0x{{[0-9a-f]*}} size = 4 state = enabled type = rw
1717

18-
print &g_8w
18+
expression &g_8w
1919
# CHECK: (uint8_t *) $0 = [[VAR8W:0x[0-9a-f]*]]
20-
print &g_16rw
20+
expression &g_16rw
2121
# CHECK: (uint16_t *) $1 = [[VAR16RW:0x[0-9a-f]*]]
22-
print &g_32w
22+
expression &g_32w
2323
# CHECK: (uint32_t *) $2 = [[VAR32W:0x[0-9a-f]*]]
24-
print &g_32rw
24+
expression &g_32rw
2525
# CHECK: (uint32_t *) $3 = [[VAR64RW:0x[0-9a-f]*]]
2626

2727
register read --all

lldb/test/Shell/Register/x86-fp-read.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ process launch
99
# CHECK: Process {{.*}} stopped
1010

1111
# fdiv (%rbx) gets encoded into 2 bytes, int3 into 1 byte
12-
print (void*)($pc-3)
12+
expression (void*)($pc-3)
1313
# CHECK: (void *) $0 = [[FDIV:0x[0-9a-f]*]]
14-
print &zero
14+
expression &zero
1515
# CHECK: (uint32_t *) $1 = [[ZERO:0x[0-9a-f]*]]
1616

1717
register read --all
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
settings set interpreter.stop-command-source-on-error false
22
bogus
3-
print 123400000 + 56789
3+
expression 123400000 + 56789
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
settings set interpreter.stop-command-source-on-error true
22
bogus
3-
print 123400000 + 56789
3+
expression 123400000 + 56789

lldb/test/Shell/Settings/TestStopCommandSourceOnError.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %S/Inputs/StopCommandSource.in | FileCheck %s --check-prefix CONTINUE
1313

1414
# FIXME: Should continue
15-
# RUN: not %lldb -b -s %S/Inputs/DontStopCommandSource.in -o 'bogus' -o 'print 111100000 + 11111' | FileCheck %s --check-prefix STOP
15+
# RUN: not %lldb -b -s %S/Inputs/DontStopCommandSource.in -o 'bogus' -o 'expression 111100000 + 11111' | FileCheck %s --check-prefix STOP
1616

1717
# FIXME: Should continue
18-
# RUN: not %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -o 'bogus' -o 'print 123400000 + 56789' | FileCheck %s --check-prefix STOP
18+
# RUN: not %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -o 'bogus' -o 'expression 123400000 + 56789' | FileCheck %s --check-prefix STOP
1919

2020
# FIXME: Should continue
2121
# RUN: not %lldb -b -s %S/Inputs/DontStopCommandSource.in | FileCheck %s --check-prefix STOP

lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ frame variable *a
4040
# CHECK-NEXT: j = 42
4141
# CHECK-NEXT: }
4242

43-
print a->f()
44-
# CHECK-LABEL: print a->f()
43+
expression a->f()
44+
# CHECK-LABEL: expression a->f()
4545
# CHECK: (int) $0 = 47
4646

47-
print ns::A()
48-
# CHECK-LABEL: print ns::A()
47+
expression ns::A()
48+
# CHECK-LABEL: expression ns::A()
4949
# CHECK: (ns::A) $1 = (i = 147)
5050

51-
print ns::A().i + a->i
52-
# CHECK-LABEL: print ns::A().i + a->i
51+
expression ns::A().i + a->i
52+
# CHECK-LABEL: expression ns::A().i + a->i
5353
# CHECK: (int) $2 = 194
5454

55-
print ns::A().getA()
55+
expression ns::A().getA()
5656
# CHECK-LABEL: ns::A().getA()
5757
# CHECK: (A) $3 = (i = 146)

lldb/test/Shell/SymbolFile/DWARF/split-dwarf-expression-eval-bug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// RUN: %clang_host -c -gsplit-dwarf -g %s -o %t2.o -DTWO
1212
// RUN: %clang_host -c -gsplit-dwarf -g %s -o %t3.o -DTHREE
1313
// RUN: %clang_host %t1.o %t2.o %t3.o -o %t
14-
// RUN: %lldb %t -o "br set -n foo" -o run -o "p bool_in_first_cu" -o exit \
14+
// RUN: %lldb %t -o "br set -n foo" -o run -o "expression bool_in_first_cu" -o exit \
1515
// RUN: | FileCheck %s
1616

17-
// CHECK: (lldb) p bool_in_first_cu
17+
// CHECK: (lldb) expression bool_in_first_cu
1818
// CHECK: (bool) $0 = true
1919

2020

lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_GNU_call_site-DW_AT_low_pc.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# REQUIRES: target-x86_64, system-linux, lld
1212

1313
# RUN: %clang_host -o %t %s
14-
# RUN: %lldb %t -o r -o 'p p' -o exit | FileCheck %s
14+
# RUN: %lldb %t -o r -o 'expression p' -o exit | FileCheck %s
1515

1616
# CHECK: (int) $0 = 1
1717

lldb/test/Shell/SymbolFile/DWARF/x86/DW_TAG_variable-DW_AT_const_value.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This tests that lldb is able to print DW_TAG_variable using DW_AT_const_value.
22

33
# RUN: llvm-mc -triple x86_64-unknown-linux-gnu %s -filetype=obj > %t.o
4-
# RUN: %lldb %t.o -o "p/x magic64" -o exit | FileCheck %s
4+
# RUN: %lldb %t.o -o "expression/x magic64" -o exit | FileCheck %s
55

66
# CHECK: (const long) $0 = 0xed9a924c00011151
77

lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-basic.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ type lookup EC
5151
# CHECK-NEXT: e3
5252
# CHECK-NEXT: }
5353

54-
print (E) 1
55-
# CHECK-LABEL: print (E) 1
54+
expression (E) 1
55+
# CHECK-LABEL: expression (E) 1
5656
# CHECK: (E) $0 = e2
5757

58-
print (EC) 1
59-
# CHECK-LABEL: print (EC) 1
58+
expression (EC) 1
59+
# CHECK-LABEL: expression (EC) 1
6060
# CHECK: (EC) $1 = e2
6161

6262
target variable a e ec

lldb/test/Shell/SymbolFile/DWARF/x86/debug-types-missing-signature.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ LOOKUPE: no type was found matching 'E'
1414
RUN: %lldb %t -b -o "type lookup EC" | FileCheck --check-prefix=LOOKUPEC %s
1515
LOOKUPEC: no type was found matching 'EC'
1616

17-
RUN: not %lldb %t -b -o "print (E) 1" 2>&1 | FileCheck --check-prefix=PRINTE %s
17+
RUN: not %lldb %t -b -o "expression (E) 1" 2>&1 | FileCheck --check-prefix=PRINTE %s
1818
PRINTE: use of undeclared identifier 'E'
1919

20-
RUN: not %lldb %t -b -o "print (EC) 1" 2>&1 | FileCheck --check-prefix=PRINTEC %s
20+
RUN: not %lldb %t -b -o "expression (EC) 1" 2>&1 | FileCheck --check-prefix=PRINTEC %s
2121
PRINTEC: use of undeclared identifier 'EC'
2222

2323
RUN: %lldb %t -b -o "target variable a e ec" | FileCheck --check-prefix=VARS %s

lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-line-strp.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# UNSUPPORTED: system-darwin, system-windows
44

55
# RUN: llvm-mc -filetype=obj -o %t -triple x86_64-pc-linux %s
6-
# RUN: %lldb %t -o "p main" \
6+
# RUN: %lldb %t -o "expression main" \
77
# RUN: -o exit | FileCheck %s
88

99
# CHECK: (void (*)()) $0 = 0x0000000000000000

lldb/test/Shell/SymbolFile/DWARF/x86/limit-debug-info.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# RUN: llvm-mc --triple=x86_64-pc-windows --filetype=obj --defsym EXE=0 %s >%t.exe.o
44
# RUN: lld-link /OUT:%t.dll %t.dll.o /SUBSYSTEM:console /dll /noentry /debug
55
# RUN: lld-link /OUT:%t.exe %t.exe.o /SUBSYSTEM:console /debug /force
6-
# RUN: %lldb %t.exe -o "target modules add %t.dll" -o "p var" \
6+
# RUN: %lldb %t.exe -o "target modules add %t.dll" -o "expression var" \
77
# RUN: -o exit 2>&1 | FileCheck %s
88

9-
# CHECK: (lldb) p var
9+
# CHECK: (lldb) expression var
1010
# CHECK: (A) $0 = (member = 47)
1111

1212
.section .debug_abbrev,"dr"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
br set -p BP_bar -f inline_sites_live.cpp
22
br set -p BP_foo -f inline_sites_live.cpp
33
run
4-
p param
4+
expression param
55
continue
6-
p param
7-
p local
6+
expression param
7+
expression local

lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
break set -f local-variables.cpp -l 17
22
run a b c d e f g
3-
p argc
3+
expression argc
44
step
5-
p SomeLocal
5+
expression SomeLocal
66
step
7-
p Param1
8-
p Param2
7+
expression Param1
8+
expression Param2
99
step
10-
p Param1
11-
p Param2
12-
p Local1
10+
expression Param1
11+
expression Param2
12+
expression Local1
1313
step
14-
p Param1
15-
p Param2
16-
p Local1
17-
p Local2
14+
expression Param1
15+
expression Param2
16+
expression Local1
17+
expression Local2
1818
step
19-
p Param1
20-
p Param2
21-
p Local1
22-
p Local2
19+
expression Param1
20+
expression Param2
21+
expression Local1
22+
expression Local2
2323
step
24-
p Param1
25-
p Param2
26-
p Local1
27-
p Local2
24+
expression Param1
25+
expression Param2
26+
expression Local1
27+
expression Local2
2828
continue
2929

3030
target modules dump ast

lldb/test/Shell/SymbolFile/NativePDB/incomplete-tag-type.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
// RUN: lld-link /debug:full /nodefaultlib /entry:main %t1.obj %t2.obj /out:%t.exe /pdb:%t.pdb
77
// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o \
88
// RUN: "settings set interpreter.stop-command-source-on-error false" \
9-
// RUN: -o "p b" -o "p d" -o "p static_e_ref" -o "exit" 2>&1 | FileCheck %s
9+
// RUN: -o "expression b" -o "expr d" -o "expr static_e_ref" -o "exit" 2>&1 | FileCheck %s
1010

11-
// CHECK: (lldb) p b
11+
// CHECK: (lldb) expression b
1212
// CHECK: (B) $0 = {}
13-
// CHECK: (lldb) p d
13+
// CHECK: (lldb) expression d
1414
// CHECK: (D) $1 = {}
15-
// CHECK: (lldb) p static_e_ref
15+
// CHECK: (lldb) expression static_e_ref
1616
// CHECK: error: expression failed to parse:
1717
// CHECK: error: {{.*}}: incomplete type 'E' where a complete type is required
1818
// CHECK: static_e_ref

lldb/test/Shell/SymbolFile/NativePDB/inline_sites_live.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ int main(int argc, char** argv) {
2424

2525
// CHECK: * thread #1, stop reason = breakpoint 1
2626
// CHECK-NEXT: frame #0: {{.*}}`main [inlined] bar(param=2)
27-
// CHECK: (lldb) p param
27+
// CHECK: (lldb) expression param
2828
// CHECK-NEXT: (int) $0 = 2
2929
// CHECK: * thread #1, stop reason = breakpoint 2
3030
// CHECK-NEXT: frame #0: {{.*}}`main [inlined] foo(param=1)
31-
// CHECK: (lldb) p param
31+
// CHECK: (lldb) expression param
3232
// CHECK-NEXT: (int) $1 = 1
33-
// CHECK-NEXT: (lldb) p local
33+
// CHECK-NEXT: (lldb) expression local
3434
// CHECK-NEXT: (int) $2 = 2

0 commit comments

Comments
 (0)