summaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectRegister.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-09-22 15:55:27 +0100
committerGitHub <noreply@github.com>2023-09-22 15:55:27 +0100
commitbb01fd57bcaec533cd08b4d107979511d893f5b3 (patch)
tree41d982653a02eec070a5d99e73daa4e301e1d18c /lldb/source/Commands/CommandObjectRegister.cpp
parent6cb3866b1ce9d835402e414049478cea82427cf1 (diff)
[lldb] Require paused process and frame for "register info" command (#67124)
Prior to this the command would simply crash when run on a running process. Of the three register commands, "info" was the only one missing these requirements. On some level it makes sense because you're not going to read a value or modify anything, but practically I think lldb assumes any time you're going to access register related stuff, the process should be paused. I noticed this debugging with a remote gdb stub, so I've recreated that scenario using attach in a new test case.
Diffstat (limited to 'lldb/source/Commands/CommandObjectRegister.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index a0e88f6ab4ba..6e6071fd5460 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -406,8 +406,9 @@ public:
CommandObjectRegisterInfo(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "register info",
"View information about a register.", nullptr,
- eCommandRequiresRegContext |
- eCommandProcessMustBeLaunched) {
+ eCommandRequiresFrame | eCommandRequiresRegContext |
+ eCommandProcessMustBeLaunched |
+ eCommandProcessMustBePaused) {
SetHelpLong(R"(
Name The name lldb uses for the register, optionally with an alias.
Size The size of the register in bytes and again in bits.