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

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 04:55:47 PST 2020


jmorse created this revision.
jmorse added reviewers: Orlando, StephenTozer, TWeaver.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74546

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


Index: debuginfo-tests/lit.cfg.py
===================================================================
--- debuginfo-tests/lit.cfg.py
+++ debuginfo-tests/lit.cfg.py
@@ -104,7 +104,7 @@
                            '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,
Index: debuginfo-tests/dexter/dex/tools/test/Tool.py
===================================================================
--- debuginfo-tests/dexter/dex/tools/test/Tool.py
+++ debuginfo-tests/dexter/dex/tools/test/Tool.py
@@ -58,7 +58,7 @@
 
         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: debuginfo-tests/dexter/dex/debugger/Debuggers.py
===================================================================
--- debuginfo-tests/dexter/dex/debugger/Debuggers.py
+++ debuginfo-tests/dexter/dex/debugger/Debuggers.py
@@ -41,7 +41,7 @@
 
 
 def _warn_meaningless_option(context, option):
-    if context.options.list_debuggers:
+    if hasattr(context.options, 'list_debuggers'):
         return
 
     warn(context,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74546.244390.patch
Type: text/x-patch
Size: 1600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/8588cc3d/attachment.bin>


More information about the llvm-commits mailing list