This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Create a way to force remove commands
ClosedPublic

Authored by wallace on Apr 26 2023, 5:10 PM.

Details

Summary

Some LLDB set ups need to hide certain commands for security reasons, so I'm adding a flag that allows removing non-user commands.

Diff Detail

Event Timeline

wallace created this revision.Apr 26 2023, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 5:10 PM
wallace requested review of this revision.Apr 26 2023, 5:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 5:10 PM
bzcheeseman accepted this revision.Apr 26 2023, 5:12 PM
bzcheeseman added inline comments.
lldb/include/lldb/Interpreter/CommandInterpreter.h
329

should force default to false?

This revision is now accepted and ready to land.Apr 26 2023, 5:12 PM
rriddle accepted this revision.Apr 26 2023, 5:13 PM

LGTM with comment addressed, and white space changes dropped.

wallace updated this revision to Diff 517399.Apr 26 2023, 5:18 PM

remove whitespace changes

This revision was landed with ongoing or failed builds.Apr 26 2023, 5:31 PM
This revision was automatically updated to reflect the committed changes.

This was added without a test. Can you add a test.

This also seems a bit Quixotic to me. Unless you are also planning to remove the script command, there's nothing you can do in the command line that you can't do with the SB API so you aren't actually removing any functionality, just making it slightly less convenient.

Sure

You can probably just add something to TestCommandDelete.py.

@jingham, in my use case, I'm exposing a minified LLDB client remotely, so the user won't have access to script command nor the SB API.