[PATCH] D91737: [Dexter] Avoid potentially infinite loop in dbgeng driver

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 12:52:37 PST 2020


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

The "go" method of Debugger classes in Dexter used to be called once, to launch the process. However with the new DebuggerController classes it's now used to set the target process free running until we hit a relevant source line. Alas, I'd baked the former assumption into the DbgEng driver and had the "go" method do nothing. This can lead to an infinite loop where the DebuggerController repeatedly calls "go".

Quickly experimenting with setting the target process free running under DbgEng shows some weird behaviour which I'm yet to get to the bottom of; in the meantime, have the "go" method single step instead. This is slow, but makes progress.

Tests: this is stimulated by the tests in D91648 <https://reviews.llvm.org/D91648>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91737

Files:
  debuginfo-tests/dexter/dex/debugger/dbgeng/dbgeng.py


Index: debuginfo-tests/dexter/dex/debugger/dbgeng/dbgeng.py
===================================================================
--- debuginfo-tests/dexter/dex/debugger/dbgeng/dbgeng.py
+++ debuginfo-tests/dexter/dex/debugger/dbgeng/dbgeng.py
@@ -103,8 +103,11 @@
         self.step_info = res
 
     def go(self):
-        # We never go -- we always single step.
-        pass
+        # FIXME: running freely doesn't seem to reliably stop when back in a
+        # relevant source file -- this is likely to be a problem when setting
+        # breakpoints. Until that's fixed, single step instead of running
+        # freely. This isn't very efficient, but at least makes progress.
+        self.step()
 
     def _get_step_info(self, watches, step_index):
         frames = self.step_info


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91737.306188.patch
Type: text/x-patch
Size: 792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/650c3fb0/attachment.bin>


More information about the llvm-commits mailing list