[Lldb-commits] [PATCH] D83425: [lldb] add printing of stdout compile errors to lldbsuite

Benson Li via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 8 13:53:06 PDT 2020


bbli created this revision.
bbli added a reviewer: labath.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This patch will add printing of the output of stdout during compile errors, right below output of stderr.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83425

Files:
  lldb/packages/Python/lldbsuite/test_event/build_exception.py


Index: lldb/packages/Python/lldbsuite/test_event/build_exception.py
===================================================================
--- lldb/packages/Python/lldbsuite/test_event/build_exception.py
+++ lldb/packages/Python/lldbsuite/test_event/build_exception.py
@@ -4,13 +4,14 @@
         super(BuildError, self).__init__("Error when building test subject")
         self.command = called_process_error.lldb_extensions.get(
             "command", "<command unavailable>")
-        self.build_error = called_process_error.lldb_extensions.get(
+        self.stderr = called_process_error.lldb_extensions.get(
             "stderr_content", "<error output unavailable>")
+        self.stdout = called_process_error.lldb_extensions.get("stdout_content","<stdout output unavailable>")
 
     def __str__(self):
-        return self.format_build_error(self.command, self.build_error)
+        return self.format_build_error(self.command, self.stderr, self.stdout)
 
     @staticmethod
-    def format_build_error(command, command_output):
+    def format_build_error(command, stderr_output, stdout_output):
         return "Error when building test subject.\n\nBuild Command:\n{}\n\nBuild Command Output:\n{}".format(
-            command, command_output.decode("utf-8"))
+            command, stderr_output.decode("utf-8")+ stdout_output.decode("utf-8"))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83425.276545.patch
Type: text/x-patch
Size: 1355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200708/8d554755/attachment-0001.bin>


More information about the lldb-commits mailing list