OSDN Git Service

[debuginfo-tests][Dexter] Fix some Windows-unfriendly Dexter behaviours
authorJeremy Morse <jeremy.morse@sony.com>
Thu, 13 Feb 2020 14:24:33 +0000 (14:24 +0000)
committerJeremy Morse <jeremy.morse@sony.com>
Thu, 13 Feb 2020 14:24:33 +0000 (14:24 +0000)
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

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

index 2f246a3..bc9355a 100644 (file)
@@ -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,
index fcd009c..9df1d08 100644 (file)
@@ -58,7 +58,7 @@ class TestCase(object):
 
         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(
index 837c930..2d93b8d 100644 (file)
@@ -104,7 +104,7 @@ dexter_path = os.path.join(config.debuginfo_tests_src_root,
                            '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,