[lldb] Print the enum values and their description in the help outputPrint the enum values and their description in the help output forargument values. Until now, there was no way to get these val
[lldb] Print the enum values and their description in the help outputPrint the enum values and their description in the help output forargument values. Until now, there was no way to get these values andtheir description.Example output:(lldb) help <description-verbosity> <description-verbosity> -- How verbose the output of 'po' should be. compact : Only show the description string full : Show the full output, including persistent variable's name and typeDifferential revision: https://reviews.llvm.org/D129707
show more ...
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://r
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://reviews.llvm.org/D128077
[lldb] Specify aguments of `image list`Register positional argument details in `CommandObjectTargetModulesList`.I recently learned that `image list` takes a module name, but the help infodoes no
[lldb] Specify aguments of `image list`Register positional argument details in `CommandObjectTargetModulesList`.I recently learned that `image list` takes a module name, but the help infodoes not indicate this. With this change, `help image list` will show that itaccepts zero or more module names.This makes it easier to get info about specific modules, without having tofind/grep through the full image list.Reviewed By: DavidSpickettDifferential Revision: https://reviews.llvm.org/D125154
[lldb] Add --show-tags option to "memory find"This is off by default. If you get a result and thatmemory has memory tags, when --show-tags is given you'llsee the tags inline with the memory conte
[lldb] Add --show-tags option to "memory find"This is off by default. If you get a result and thatmemory has memory tags, when --show-tags is given you'llsee the tags inline with the memory content.```(lldb) memory read mte_buf mte_buf+64 --show-tags<...>0xfffff7ff8020: 00 00 00 00 00 00 00 00 0d f0 fe ca 00 00 00 00 ................ (tag: 0x2)<...>(lldb) memory find -e 0xcafef00d mte_buf mte_buf+64 --show-tagsdata found at location: 0xfffff7ff80280xfffff7ff8028: 0d f0 fe ca 00 00 00 00 00 00 00 00 00 00 00 00 ................ (tags: 0x2 0x3)0xfffff7ff8038: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ (tags: 0x3 0x4)```The logic for handling alignments is the same as for memory readso in the above example because the line starts misaligned to thegranule it covers 2 granules.Depends on D125089Reviewed By: omjavaidDifferential Revision: https://reviews.llvm.org/D125090
[lldb] Change implementation of memory read --show-tags optionThis does 2 things:* Moves it after the short options. Which makes sense given it's a niche, default off option. (if 2 files for o
[lldb] Change implementation of memory read --show-tags optionThis does 2 things:* Moves it after the short options. Which makes sense given it's a niche, default off option. (if 2 files for one option seems a bit much, I am going to reuse them for "memory find" later)* Fixes the use of repeated commands. For example: memory read buf --show-tags <shows tags> memory read <shows tags>Added tests for the repetition and updated existing help tests.Reviewed By: omjavaidDifferential Revision: https://reviews.llvm.org/D125089
[lldb][NFC] Add more tests for GenerateOptionsUsageThis adds a few targeted tests to make sure that when refactoringthis function later I don't break these properties.Some are tested in passing
[lldb][NFC] Add more tests for GenerateOptionsUsageThis adds a few targeted tests to make sure that when refactoringthis function later I don't break these properties.Some are tested in passing elsewhere but this makes it moreobvious what went wrong when it fails.This doesn't cover everything the function does, I couldn'tfind any examples that would exercise some of the code.Reviewed By: jinghamDifferential Revision: https://reviews.llvm.org/D123500
[Bug 49018][lldb] Fix incorrect help text for 'memory write' commandCertain commands like 'memory write', 'register read' etc all usethe OptionGroupFormat options but the help usage text for those
[Bug 49018][lldb] Fix incorrect help text for 'memory write' commandCertain commands like 'memory write', 'register read' etc all usethe OptionGroupFormat options but the help usage text for thoseoptions 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 optionsin the OptionGroupFormat group as needed and fixes help text of memory write.llvm.org/pr49018.Reviewed By: DavidSpickettDifferential Revision: https://reviews.llvm.org/D114448
[lldb] Fix crash in "help memory read"When a command option does not have a short version(e.g. -f for --file), we use an arbitrary value in theshort_option field to mark it as invalid.(though th
[lldb] Fix crash in "help memory read"When a command option does not have a short version(e.g. -f for --file), we use an arbitrary value in theshort_option field to mark it as invalid.(though this value is unqiue to be used later for otherthings)We check that this short option is valid to print usingllvm::isPrint. This implicitly casts our int to char,meaning we check the last char of any short_option value.Since the arbitrary value we chose for these options issome shortened hex version of the name, this returned trueeven for invalid values.Since llvm::isPrint returns true we later call std::islowerand/or std::isupper on the short_option value. (the int)Calling these functions with something that cannot be validlyconverted to unsigned char is undefined. Somehow we got/getaway with this but for me compiling with g++-9 I got a crashfor "help memory read".The other command that uses this is "target variable" but thatdidn't crash for unknown reasons.Checking that short_option can fit into an unsigned char beforewe call llvm::isPrint means we will not attempt to call islower/upperon these options since we have no reason to print them.This also fixes bogus short options being shown for "memory read"and target variable.For "target variable", before: -e <filename> ( --file <filename> ) -b <filename> ( --shlib <filename> )After: --file <filename> --shlib <filename>(note that the bogus short options are just the bottom byte of ourarbitrary short_option value)Reviewed By: labathDifferential Revision: https://reviews.llvm.org/D94917
[lldb] Remove stale LLDB-Info.plistRemove the stale LLDB-Info.plist which was only used by TestHelp.py. Thelatter would try to parse the version number from the plist and use thatto verify the ve
[lldb] Remove stale LLDB-Info.plistRemove the stale LLDB-Info.plist which was only used by TestHelp.py. Thelatter would try to parse the version number from the plist and use thatto verify the version in the help output. Of course this never matchedso it would fall back to matching any arbitrary version.This patch does *not* change the real LLDB-Info.plist.in file which isused for the LLDB Framework.
[lldb][test] Remove symlink for API tests.Summary: Moves lldbsuite tests to lldb/test/API.This is a largely mechanical change, moved with the following steps:```rm lldb/test/API/testcasesmkdi
[lldb][test] Remove symlink for API tests.Summary: Moves lldbsuite tests to lldb/test/API.This is a largely mechanical change, moved with the following steps:```rm lldb/test/API/testcasesmkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runnerfor d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; donefor d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; donefor d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done```lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.Reviewers: labath, JDevlieghereTags: #lldbDifferential Revision: https://reviews.llvm.org/D71151