summaryrefslogtreecommitdiff
path: root/lldb/test/Shell/Target/target-label.test
blob: 7f4f31e09fa16489a7d4c05f9d5acefabcfc36ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# REQUIRES: python
# UNSUPPORTED: system-windows
# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s 2>&1 | FileCheck %s

target create -l "ls" /bin/ls
target list
# CHECK: * target #0 (ls): [[LS_PATH:.*]]

script lldb.target.SetLabel("")
target list
# CHECK: * target #0: [[LS_PATH]]

target create -l "cat" /bin/cat
target list
# CHECK: target #0: [[LS_PATH]]
# CHECK-NEXT: * target #1 (cat): [[CAT_PATH:.*]]

target create -l "cat" /bin/cat
# CHECK: Cannot use label 'cat' since it's set in target #1.

target create -l 42 /bin/cat
# CHECK: error: Cannot use integer as target label.

target select 0
# CHECK: * target #0: [[LS_PATH]]
# CHECK-NEXT: target #1 (cat): [[CAT_PATH]]

target select cat
# CHECK: target #0: [[LS_PATH]]
# CHECK-NEXT: * target #1 (cat): [[CAT_PATH]]

script lldb.target.GetLabel()
# CHECK: 'cat'

script lldb.debugger.GetTargetAtIndex(0).SetLabel('Not cat')
# CHECK: success

target list
# CHECK: target #0 (Not cat): [[LS_PATH]]
# CHECK-NEXT: * target #1 (cat): [[CAT_PATH]]