Skip to content

Commit

Permalink
Fix the broken Batch test by passing a custom module cache to the inf…
Browse files Browse the repository at this point in the history
…erior lldb.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@355991 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
adrian-prantl committed Mar 12, 2019
1 parent 9527e93 commit bcee16a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def test_batch_mode_run_crash(self):

import pexpect
exe = self.getBuildArtifact("a.out")
module_cache = self.getBuildArtifact("module.cache")
prompt = "(lldb) "

# Pass CRASH so the process will crash and stop in batch mode.
run_commands = ' -b -o "break set -n main" -o "run" -o "continue" -k "frame var touch_me_not"'
run_commands = ' -b -o "settings set symbols.clang-modules-cache-path %s" -o "break set -n main" -o "run" -o "continue" -k "frame var touch_me_not"' % module_cache
self.child = pexpect.spawn(
'%s %s %s %s -- CRASH' %
(lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
Expand Down Expand Up @@ -87,10 +88,11 @@ def test_batch_mode_run_exit(self):

import pexpect
exe = self.getBuildArtifact("a.out")
module_cache = self.getBuildArtifact("module.cache")
prompt = "(lldb) "

# Now do it again, and make sure if we don't crash, we quit:
run_commands = ' -b -o "break set -n main" -o "run" -o "continue" '
run_commands = ' -b -o "settings set symbols.clang-modules-cache-path %s" -o "break set -n main" -o "run" -o "continue" '%module_cache
self.child = pexpect.spawn(
'%s %s %s %s -- NOCRASH' %
(lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
Expand Down Expand Up @@ -131,6 +133,7 @@ def test_batch_mode_attach_exit(self):

import pexpect
exe = self.getBuildArtifact("a.out")
module_cache = self.getBuildArtifact("module.cache")
prompt = "(lldb) "

# Finally, start up the process by hand, attach to it, and wait for its completion.
Expand All @@ -156,8 +159,8 @@ def test_batch_mode_attach_exit(self):

self.victim.expect("Waiting")

run_commands = ' -b -o "process attach -p %d" -o "breakpoint set --file %s -p \'Stop here to unset keep_waiting\' -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (
victim_pid, self.source)
run_commands = ' -b -o "settings set symbols.clang-modules-cache-path %s" -o "process attach -p %d" -o "breakpoint set --file %s -p \'Stop here to unset keep_waiting\' -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (
module_cache, victim_pid, self.source)
self.child = pexpect.spawn(
'%s %s %s %s' %
(lldbtest_config.lldbExec,
Expand Down

0 comments on commit bcee16a

Please sign in to comment.