[Lldb-commits] [PATCH] D42870: Correct recognition of NetBSD images

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 2 16:16:07 PST 2018


jingham added a comment.

There is code in the GDBRemoteTestBase that makes targets from yaml2obj.  See the createTarget method in packages/Python/lldbsuite/functionalities/gdb_remote_client/gdbclientutils.py.  Actually, that's method should be pulled out of the gdb_remote_client and moved to TestBase in lldbtest.py, it doesn't appear to have any dependencies on being a gdb_remote_client test, and it seems like a generally useful feature.  Note that gdb_remote_client directory also has an example of making a little ELF file (a.yaml).

It looks like the GDBRemoteTestBase class also has some mechanism for cleaning up temporary files, but I'm not sure that's necessary, since the generated files should all go into the build directory now Adrian is done with that work.  I don't see why the test cases should have to do this by hand.

Anyway, if that were in lldbtest (maybe createTargetFromYaml), then you could make a dotest test by copying the packages/Python/lldbsuite/test/sample_test/TestSampleTest.py somewhere, remove the build stage, and in the test body just do something like:

  target = self.createTargetFromYaml(path_to_yaml)
  self.assertTrue(target.GetTriple() =="whateverItsSupposedToBe", "Got the right target")

You only need to use lldb-server to run the dotest.py based tests if you need to run the process, which you don't here.  You should be able to run all the tests that don't run processes, though of course if you don't have an lldb-server you can't actually launch anything regardless of what test harness is doing the launching.


Repository:
  rL LLVM

https://reviews.llvm.org/D42870





More information about the lldb-commits mailing list