2 Test that argdumper is a viable launching strategy.
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class TestRerun(TestBase
):
15 exe
= self
.getBuildArtifact("a.out")
17 self
.runCmd("target create %s" % exe
)
20 target
= self
.dbg
.CreateTarget(exe
)
22 # Create any breakpoints we need
23 breakpoint
= target
.BreakpointCreateBySourceRegex(
24 "break here", lldb
.SBFileSpec("main.cpp", False)
26 self
.assertTrue(breakpoint
, VALID_BREAKPOINT
)
28 self
.runCmd("process launch 1 2 3")
30 process
= self
.process()
31 thread
= lldbutil
.get_one_thread_stopped_at_breakpoint(process
, breakpoint
)
33 thread
, "Process should be stopped at a breakpoint in main"
35 self
.assertTrue(thread
.IsValid(), "Stopped thread is not valid")
37 self
.expect("frame variable argv[1]", substrs
=["1"])
38 self
.expect("frame variable argv[2]", substrs
=["2"])
39 self
.expect("frame variable argv[3]", substrs
=["3"])
42 self
.runCmd("continue")
44 # Re-run with no args and make sure we still run with 1 2 3 as arguments as
45 # they should have been stored in "target.run-args"
46 self
.runCmd("process launch")
48 process
= self
.process()
49 thread
= lldbutil
.get_one_thread_stopped_at_breakpoint(process
, breakpoint
)
52 thread
, "Process should be stopped at a breakpoint in main"
54 self
.assertTrue(thread
.IsValid(), "Stopped thread is not valid")
56 self
.expect("frame variable argv[1]", substrs
=["1"])
57 self
.expect("frame variable argv[2]", substrs
=["2"])
58 self
.expect("frame variable argv[3]", substrs
=["3"])