[Lldb-commits] [lldb] [lldb] Improved formatting of 'register read' command. (PR #188049)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 2 03:01:43 PDT 2026


================
@@ -75,7 +75,7 @@ class CommandObjectRegisterRead : public CommandObjectParsed {
 
   bool DumpRegister(const ExecutionContext &exe_ctx, Stream &strm,
                     RegisterContext &reg_ctx, const RegisterInfo &reg_info,
-                    bool print_flags) {
+                    bool print_flags, uint32_t reg_name_align_at = 0) {
----------------
DavidSpickett wrote:

> but I do think defaulting to 8 would be sensible to keep lists of short names consistent with what we did before.

It does make testing harder because you need registers with names > 8. Which are usually unusual things we can't assume hosts will have, so you need to simulate it using something what lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py does.

But then you also have the problem that I think the sets are defined in lldb not in the XML from lldb-server. So you can test individual alignment but not sets.

An API test written in Python could check that registers exist first, and then check alignment. Then you can have checks that use common registers and cover parts of this, and rarer registers are used if you have them.

https://github.com/llvm/llvm-project/pull/188049


More information about the lldb-commits mailing list