mib created this revision.
mib added reviewers: JDevlieghere, bulbazord.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

When using interactive crashlog from an IDE, it can happen that the user
already have the `command script import lldb.macosx.crashlog` command on
their `lldbinit` file.

That leads to showing some message:

  error: cannot add command: user command exists and force replace not set
  error: cannot add command: user command exists and force replace not set

This leads to confusion because the crashlog symbolication continues and
succeeds even after these errors.

To address that, the crashlog commands get overridden everytime the
script get re-imported.

rdar://103403943

Signed-off-by: Med Ismail Bennani <medismail.benn...@gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140113

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1344,8 +1344,8 @@
 
 def __lldb_init_module(debugger, internal_dict):
     debugger.HandleCommand(
-        'command script add -c lldb.macosx.crashlog.Symbolicate crashlog')
+        'command script add -o -c lldb.macosx.crashlog.Symbolicate crashlog')
     debugger.HandleCommand(
-        'command script add -f lldb.macosx.crashlog.save_crashlog 
save_crashlog')
+        'command script add -o -f lldb.macosx.crashlog.save_crashlog 
save_crashlog')
     print('"crashlog" and "save_crashlog" commands have been installed, use '
           'the "--help" options on these commands for detailed help.')


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1344,8 +1344,8 @@
 
 def __lldb_init_module(debugger, internal_dict):
     debugger.HandleCommand(
-        'command script add -c lldb.macosx.crashlog.Symbolicate crashlog')
+        'command script add -o -c lldb.macosx.crashlog.Symbolicate crashlog')
     debugger.HandleCommand(
-        'command script add -f lldb.macosx.crashlog.save_crashlog save_crashlog')
+        'command script add -o -f lldb.macosx.crashlog.save_crashlog save_crashlog')
     print('"crashlog" and "save_crashlog" commands have been installed, use '
           'the "--help" options on these commands for detailed help.')
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH]... Med Ismail Bennani via Phabricator via lldb-commits

Reply via email to