[debuginfo-tests] 5ee4a03 - [debuginfo-tests][Dexter] Fix some Windows-unfriendly Dexter behaviours

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 06:26:10 PST 2020


Author: Jeremy Morse
Date: 2020-02-13T14:24:33Z
New Revision: 5ee4a03bc916d2925b9431c53b7da0d3ce7e2b9e

URL: https://github.com/llvm/llvm-project/commit/5ee4a03bc916d2925b9431c53b7da0d3ce7e2b9e
DIFF: https://github.com/llvm/llvm-project/commit/5ee4a03bc916d2925b9431c53b7da0d3ce7e2b9e.diff

LOG: [debuginfo-tests][Dexter] Fix some Windows-unfriendly Dexter behaviours

These are some minor things that I've run into on Windows, largely in
error handling paths:

 * Giving --lldb-executable on Windows triggers a "useless option" code
   path, which touches an attribute that only exists in the
   list_debuggers tool. Switch this to use hasattr, which will work in
   all subtools.
 * We were over-decoding some text reporting errors, but only in an
   exception path
 * The path to lldb on Windows needs to be quoted (even though dexter
   isn't making use of it).

Differential Revision: https://reviews.llvm.org/D74546

Added: 
    

Modified: 
    debuginfo-tests/dexter/dex/debugger/Debuggers.py
    debuginfo-tests/dexter/dex/tools/test/Tool.py
    debuginfo-tests/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/debuginfo-tests/dexter/dex/debugger/Debuggers.py b/debuginfo-tests/dexter/dex/debugger/Debuggers.py
index 2f246a3fd959..bc9355a0381c 100644
--- a/debuginfo-tests/dexter/dex/debugger/Debuggers.py
+++ b/debuginfo-tests/dexter/dex/debugger/Debuggers.py
@@ -41,7 +41,7 @@ def _get_potential_debuggers():  # noqa
 
 
 def _warn_meaningless_option(context, option):
-    if context.options.list_debuggers:
+    if hasattr(context.options, 'list_debuggers'):
         return
 
     warn(context,

diff  --git a/debuginfo-tests/dexter/dex/tools/test/Tool.py b/debuginfo-tests/dexter/dex/tools/test/Tool.py
index fcd009c50819..9df1d082ace8 100644
--- a/debuginfo-tests/dexter/dex/tools/test/Tool.py
+++ b/debuginfo-tests/dexter/dex/tools/test/Tool.py
@@ -58,7 +58,7 @@ def __str__(self):
 
         if self.error:
             script_error = (' : {}'.format(
-                self.error.script_error.splitlines()[0].decode()) if getattr(
+                self.error.script_error.splitlines()[0]) if getattr(
                     self.error, 'script_error', None) else '')
 
             error = ' [{}{}]'.format(

diff  --git a/debuginfo-tests/lit.cfg.py b/debuginfo-tests/lit.cfg.py
index 837c930ac7fd..2d93b8da9bf6 100644
--- a/debuginfo-tests/lit.cfg.py
+++ b/debuginfo-tests/lit.cfg.py
@@ -104,7 +104,7 @@ def get_required_attr(config, attr_name):
                            'dexter', 'dexter.py')
 dexter_test_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
 if lldb_path is not None:
-  dexter_test_cmd += ' --lldb-executable {}'.format(lldb_path)
+  dexter_test_cmd += ' --lldb-executable "{}"'.format(lldb_path)
 tools.append(ToolSubst('%dexter', dexter_test_cmd))
 
 # For testing other bits of dexter that aren't under the "test" subcommand,


        


More information about the llvm-commits mailing list