This is an archive of the discontinued LLVM Phabricator instance.

noexternal 1/2: refactor testsuite spawnLldbMi args->exe+args
ClosedPublic

Authored by jankratochvil on Dec 18 2018, 3:11 PM.

Details

Summary

Currently spawnLldbMi accepts both lldb-mi options and executable to debug as a single parameter. Split them.
As in the next patch we will need to execute one lldb-mi command before loading the exe. Therefore we can no longer use the exe as lldb-mi command-line parameter as then there is no way to execute a command before loading exe specified as lldb-mi command-line parameter.
LocateExecutableSymbolFileDsym should be static, that is also a little refactorization.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

jankratochvil created this revision.Dec 18 2018, 3:11 PM
labath added inline comments.Dec 19 2018, 12:10 AM
packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
53

Shouldn't you also expect the ^done response here or something similar?

jankratochvil marked 3 inline comments as done.Dec 19 2018, 12:25 AM

Thanks for the review!

packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
53

This would break compatibility with previous behavior of this function, see my test_lldbmi_specialchars comment below.

packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
63

Here you can see just by passing complicated_myexe as spawnLldbMi parameter the code still expects to be able to match the -file-exec-and-symbols command.

labath accepted this revision.Dec 19 2018, 12:27 AM

Ok, if that's how things worked previously, then this lgtm.

This revision is now accepted and ready to land.Dec 19 2018, 12:27 AM
jankratochvil marked an inline comment as done.

I have put there a comment:

             self.runCmd("-file-exec-and-symbols \"%s\"" % exe)
+            # Testcases expect to be able to match output of this command,
+            # see test_lldbmi_specialchars.
This revision was automatically updated to reflect the committed changes.