This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Explain memory history provider in mem hist command description
Needs ReviewPublic

Authored by Michael137 on Dec 15 2022, 6:23 AM.

Details

Summary

Previously, using memory history command on an executable
which wasn't compiled with ASAN would yield following error:

(lldb) mem hist 0x0
error: no available memory history provider

Looking at the help message for this command didn't really
make this error message any clearer.

This patch changes the help memory history description to
at least mention how a history provider could be set up.

After the patch:

(lldb) help mem hist
Print recorded stack traces for allocation/deallocation events associated with an address.
This command requires a memory history provider plugin to be present. For example, compile the debuggee with address sanitizer.

Diff Detail

Event Timeline

Michael137 created this revision.Dec 15 2022, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 6:23 AM
Michael137 requested review of this revision.Dec 15 2022, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 6:23 AM
Michael137 edited the summary of this revision. (Show Details)Dec 15 2022, 6:24 AM
  • Fix commit message

This is a fine idea. However, it doesn't seem immediately obvious that a "memory history provider plugin" is a property of the executable, not lldb. In other instances we say we don't have an architecture plugin for your architecture, etc. So that ends up sounding more like something you have to add to lldb.

I'd make this more direct, like "This command requires that your executable run with some memory introspection support library. For example, compile the debug with address sanitizer." You could also be less cagy about the list of memory history introspection libraries since we seem to only support ASAN at present. We could just say "use asan" here so people don't waste time wondering what the others are. Then if we ever support another one we can revise this string. It should be natural at that point because once we support more than one introspection library, we'd probably have to give you a way to choose which among the ones that are available.