[lldb] Don't send invalid region addresses to lldb server
authorDavid Spickett <david.spickett@linaro.org>
Tue, 15 Sep 2020 13:49:48 +0000 (14:49 +0100)
committerDavid Spickett <david.spickett@linaro.org>
Thu, 17 Sep 2020 09:26:16 +0000 (10:26 +0100)
commitc687af0c30b4dbdc9f614d5e061c888238e0f9c5
tree1aa48991e666336483ec8efa7981de6f28e4563d
parenta9cbe5cf30e386a4f44981f5bf9e1862ad36574d
[lldb] Don't send invalid region addresses to lldb server

Previously when <addr> in "memory region <addr>" didn't
parse correctly, we'd print an error then also ask lldb-server
for a region containing LLDB_INVALID_ADDRESS.

(lldb) memory region not_an_address
error: invalid address argument "not_an_address"...
error: Server returned invalid range

Only send the command to lldb-server if the address
parsed correctly.

(lldb) memory region not_an_address
error: invalid address argument "not_an_address"...

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D87694
lldb/source/Commands/CommandObjectMemory.cpp
lldb/test/API/functionalities/memory-region/TestMemoryRegion.py