[Lldb-commits] [PATCH] D131036: [lldb/crashlog] Add `-s|--skip-status` option to interactive mode

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 3 21:17:23 PDT 2022


JDevlieghere added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:1198-1204
+        option_parser.add_option(
+            '--skip-status',
+            '-s',
+            dest='skip_status',
+            action='store_true',
+            help='prevent the interactive crashlog to dump the process status and thread backtrace at launch',
+            default=False)
----------------
jingham wrote:
> JDevlieghere wrote:
> > Is there another way to detect that we're running in this kind of environment? For example, could we check if we're in an interactive lldb session? I imagine you'd like to have the same behavior as the IDE case if you imported the crashlog module in another Python file for example. One easy way to determine this is to check if `lldb.debugger` exists, but I'm not sure if that will cover the IDE case you're trying to solve. 
> I don't think we should be in the business of trying to auto-detect what the caller's intentions are in this regard.  For instance, I can easily imagine a python utility that wants to get the crashlog, show it to the user, and also do some logic on it, and having us dump it is really convenient.  Plus the development experience here would be bad.  Someone would try out the crashlog command in lldb and see the dump.  Then they would run it in their program and not see it.  Then I think they would take our names in vain...
The reason I brought it up is because we have another patch that adds another flag for Xcode. Each flag makes sense by itself, but if there's a way to detect this more generally and avoid a sprawl of flags I would prefer that. But I don't feel strongly about it as this more of a "slippery slope argument". 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131036



More information about the lldb-commits mailing list