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

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 22 15:33:46 PST 2021


jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Yes, this is how I should have done it originally.  Thanks!

I had one suggestion for making the test more compact which you can do or not as you please.  Other than the LGTM.



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


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