This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Update custom commands to always be overrriden
ClosedPublic

Authored by mib on Dec 19 2022, 4:40 AM.

Details

Summary

This is a follow-up patch to D140113.

As explained previously, when running from an IDE, it can happen that
the IDE imports some lldb scripts by itself. If the user also tries to
import these commands, lldb will show the following message:

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

This message is confusing to the user, because it suggests that the
command import failed and that the execution should stop. However, in
this case, lldb will continue the execution with the command added
previously by the user.

To prevent that, this patch updates every first-party lldb-packaged
custom commands to override commands that were pre-imported in lldb.

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

Diff Detail

Event Timeline

mib created this revision.Dec 19 2022, 4:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 19 2022, 4:40 AM
mib requested review of this revision.Dec 19 2022, 4:40 AM
bulbazord accepted this revision.Dec 19 2022, 12:28 PM
This revision is now accepted and ready to land.Dec 19 2022, 12:28 PM
mib updated this revision to Diff 488036.Jan 10 2023, 4:49 PM

Fix typo in crashlog.py

JDevlieghere accepted this revision.Jan 11 2023, 11:13 AM

LGTM. The pattern of debugger.HandleCommand("command script add -o -c [...]") seems rather tedious. Would it make sense to add a wrapper to the SBAPI that takes care of that?

mib added a comment.Jan 11 2023, 11:56 AM

LGTM. The pattern of debugger.HandleCommand("command script add -o -c [...]") seems rather tedious. Would it make sense to add a wrapper to the SBAPI that takes care of that?

I think that would make sense. I'll do it in a follow-up!

This revision was automatically updated to reflect the committed changes.