Skip to content

Commit 4473833

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 (cherry picked from commit d875838)
1 parent c31a24b commit 4473833

26 files changed

+101
-101
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)

0 commit comments

Comments
 (0)