From bb01fd57bcaec533cd08b4d107979511d893f5b3 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 22 Sep 2023 15:55:27 +0100 Subject: [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. --- lldb/source/Commands/CommandObjectRegister.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/source/Commands/CommandObjectRegister.cpp') 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. -- cgit v1.2.3