summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
blob: 413927454881b9e58e78345054ea3ee453dba06a (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""
Test some lldb command abbreviations to make sure the common short spellings of
many commands remain available even after we add/delte commands in the future.
"""

import os, time
import unittest2
import lldb
from lldbtest import *

class CommonShortSpellingsTestCase(TestBase):
    
    mydir = os.path.join("functionalities", "abbreviation")

    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
    def test_with_dsym (self):
        self.buildDsym ()
        self.run_abbrevs2 ()

    def test_with_dwarf (self):
        self.buildDwarf ()
        self.run_abbrevs2 ()

    def run_abbrevs2 (self):
        exe = os.path.join (os.getcwd(), "a.out")
        self.expect("fil " + exe,
                    patterns = [ "Current executable set to .*a.out.*" ])

        # br s -> breakpoint set
        self.expect("br s -n sum",
            startstr = "Breakpoint created: 1: name = 'sum', locations = 1")

        # disp -> display
        self.expect("disp a",
            startstr = "target stop-hook add -o")
        self.expect("disp b",
            startstr = "target stop-hook add -o")

        # di/dis -> disassemble
        self.expect("help di",
            substrs = ["disassemble"])
        self.expect("help dis",
            substrs = ["disassemble"])

        # ta st a -> target stop-hook add
        self.expect("help ta st a",
            substrs = ["target stop-hook add"])

        # fr v -> frame variable
        self.expect("help fr v",
            substrs = ["frame variable"])

        # ta st li -> target stop-hook list
        self.expect("ta st li",
            substrs = ["Hook: 1", "Hook: 2"])


if __name__ == '__main__':
    import atexit
    lldb.SBDebugger.Initialize()
    atexit.register(lambda: lldb.SBDebugger.Terminate())
    unittest2.main()

OpenPOWER on IntegriCloud