[Bug 49018][lldb] Fix incorrect help text for 'memory write' command
authorVenkata Ramanaiah Nalamothu <ramana.venkat83@gmail.com>
Fri, 26 Nov 2021 10:28:14 +0000 (15:58 +0530)
committerVenkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu@amd.com>
Fri, 26 Nov 2021 13:44:26 +0000 (19:14 +0530)
commit7f05ff8be481f6db23615c028280fd92c2080f5f
tree9d6b14763917d1ff4e10c37dd342eff7c9e6db08
parentb927aa69bf2fd50ecf33e3f5ec853eb3c70312c5
[Bug 49018][lldb] Fix incorrect help text for 'memory write' command

Certain commands like 'memory write', 'register read' etc all use
the OptionGroupFormat options but the help usage text for those
options is not customized to those commands.

One such example is:

  (lldb) help memory read
           -s <byte-size> ( --size <byte-size> )
               The size in bytes to use when displaying with the selected format.
  (lldb) help memory write
   -s <byte-size> ( --size <byte-size> )
               The size in bytes to use when displaying with the selected format.

This patch allows such commands to overwrite the help text for the options
in the OptionGroupFormat group as needed and fixes help text of memory write.

llvm.org/pr49018.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D114448
lldb/include/lldb/Interpreter/OptionGroupFormat.h
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Interpreter/OptionGroupFormat.cpp
lldb/test/API/commands/help/TestHelp.py