[Lldb-commits] [PATCH] D93874: [process] fix exec support on Linux

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 25 11:17:41 PST 2021


wallace added inline comments.


================
Comment at: lldb/test/API/functionalities/exec/TestExec.py:133-158
+        exe = self.getBuildArtifact("a.out")
+        secondprog = self.getBuildArtifact("secondprog")
+
+        # Create the target
+        target = self.dbg.CreateTarget(exe)
+
+        # Create any breakpoints we need
----------------
jingham wrote:
> I don't think you need to set the second breakpoint till after you've stopped at the first one, If not, you should be able to replace everything from the "exe = self.getBuildArtifact" to the self.assertTrue(len(threads == 1)) with:
> 
> (target, process, thread, breakpoint1) = lldbutil.run_to_source_breakpoint(self, 'Set breakpoint 1 here', lldb.SBFileSpec('main.cpp', False))
> breakpoint2 = target.BreakpointCreateBySourceRegex(...)
> 
> and "threads[0]" below -> "thread", which is a lot easier to read.
nice! run_to_source_breakpoint is super handy


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93874/new/

https://reviews.llvm.org/D93874



More information about the lldb-commits mailing list