[Dexter] Cope better with empty source locations
authorJeremy Morse <jeremy.morse@sony.com>
Fri, 1 Nov 2019 13:20:26 +0000 (13:20 +0000)
committerJeremy Morse <jeremy.morse@sony.com>
Fri, 1 Nov 2019 13:30:26 +0000 (13:30 +0000)
When running a program, Dexter single steps if it's in one of the source
files under test, or free-runs if it isn't. Handle the circumstance where
the current source file simply isn't known.

debuginfo-tests/dexter/dex/debugger/DebuggerBase.py

index 8013ceb..57fcad0 100644 (file)
@@ -153,6 +153,8 @@ class DebuggerBase(object, metaclass=abc.ABCMeta):
     def in_source_file(self, step_info):
         if not step_info.current_frame:
             return False
+        if not step_info.current_location.path:
+            return False
         if not os.path.exists(step_info.current_location.path):
             return False
         return any(os.path.samefile(step_info.current_location.path, f) \