[Lldb-commits] [PATCH] D157167: [lldb] Add flag to DynamicLoader::LoadBinaryWithUUIDAndAddress to control whether we fall back to reading the binary out of memory

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 7 11:05:53 PDT 2023


jasonmolenda added inline comments.


================
Comment at: lldb/test/API/macosx/lc-note/multiple-binary-corefile/TestMultipleBinaryCorefile.py:38-39
         )
+        if self.TraceOn():
+            self.runCmd("script print('Creating corefile with command %s')" % cmd)
         call(cmd, shell=True)
----------------
jasonmolenda wrote:
> bulbazord wrote:
> > JDevlieghere wrote:
> > > Out of curiosity what's the point of doing `self.runCmd("script print ...` vs printing the same thing directly? Does this run in another context or something? Do we save the command output somewhere? 
> > I'm also curious. Printing directly is probably less expensive than running a print command through the lldb python script interpreter.
> In the past, when I had an SB API test `print()` directly, the trace output is buffered differently than STDOUT, so I've done this hack in a few places to get the print to happen exactly when the test is executing.  Doing a `if self.TraceOn(): self.runCmd("bt"); print("got here")` will not print the two next to each other, iirc.  I can switch to a print and confirm my memory of this.
I switched this test to just `print` directly and works fine with `lldb-dotest -t`, I must have misremembered.  I'll remove a few places where I do this in this test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157167



More information about the lldb-commits mailing list