diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -3066,19 +3066,24 @@ StreamString response; - response.Printf(""); - response.Printf(""); + response.Printf("\n"); + response.Printf("\n"); + response.IndentMore(); - response.Printf("%s", + response.Indent(); + response.Printf("%s\n", m_current_process->GetArchitecture() .GetTriple() .getArchName() .str() .c_str()); - response.Printf(""); + response.Indent("\n"); const int registers_count = reg_context.GetUserRegisterCount(); + if (registers_count) + response.IndentMore(); + for (int reg_index = 0; reg_index < registers_count; reg_index++) { const RegisterInfo *reg_info = reg_context.GetRegisterInfoAtIndex(reg_index); @@ -3090,7 +3095,9 @@ continue; } - response.Printf("name, reg_info->byte_size * 8, reg_index); if (!reg_context.RegisterOffsetIsDynamic()) @@ -3139,11 +3146,15 @@ response.Printf("\" "); } - response.Printf("/>"); + response.Printf("/>\n"); } - response.Printf(""); - response.Printf(""); + if (registers_count) + response.IndentLess(); + + response.Indent("\n"); + response.IndentLess(); + response.Indent("\n"); return MemoryBuffer::getMemBufferCopy(response.GetString(), "target.xml"); } diff --git a/lldb/test/API/tools/lldb-server/TestPtyServer.py b/lldb/test/API/tools/lldb-server/TestPtyServer.py --- a/lldb/test/API/tools/lldb-server/TestPtyServer.py +++ b/lldb/test/API/tools/lldb-server/TestPtyServer.py @@ -63,7 +63,7 @@ "read packet: $qXfer:features:read:target.xml:0,200000#00", { "direction": "send", - "regex": re.compile("^\$l(.+)#[0-9a-fA-F]{2}$"), + "regex": re.compile("^\$l(.+)#[0-9a-fA-F]{2}$", flags=re.DOTALL), "capture": {1: "target_xml"}, }], True) diff --git a/lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py b/lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py --- a/lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py +++ b/lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py @@ -25,7 +25,7 @@ LENGTH), { "direction": "send", - "regex": re.compile("^\$l(.+)#[0-9a-fA-F]{2}$"), + "regex": re.compile("^\$l(.+)#[0-9a-fA-F]{2}$", flags=re.DOTALL), "capture": {1: "target_xml"} }], True)