[Lldb-commits] [PATCH] D134035: [LLDB] Format lldb-server's target XML
David Spickett via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 20 02:02:32 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGba822e248d3a: [LLDB] Format lldb-server's target XML (authored by DavidSpickett).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134035/new/
https://reviews.llvm.org/D134035
Files:
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/test/API/tools/lldb-server/TestPtyServer.py
lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
Index: lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
===================================================================
--- lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
+++ 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)
Index: lldb/test/API/tools/lldb-server/TestPtyServer.py
===================================================================
--- lldb/test/API/tools/lldb-server/TestPtyServer.py
+++ 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)
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -3066,19 +3066,24 @@
StreamString response;
- response.Printf("<?xml version=\"1.0\"?>");
- response.Printf("<target version=\"1.0\">");
+ response.Printf("<?xml version=\"1.0\"?>\n");
+ response.Printf("<target version=\"1.0\">\n");
+ response.IndentMore();
- response.Printf("<architecture>%s</architecture>",
+ response.Indent();
+ response.Printf("<architecture>%s</architecture>\n",
m_current_process->GetArchitecture()
.GetTriple()
.getArchName()
.str()
.c_str());
- response.Printf("<feature>");
+ response.Indent("<feature>\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("<reg name=\"%s\" bitsize=\"%" PRIu32 "\" regnum=\"%d\" ",
+ response.Indent();
+ response.Printf("<reg name=\"%s\" bitsize=\"%" PRIu32
+ "\" regnum=\"%d\" ",
reg_info->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("</feature>");
- response.Printf("</target>");
+ if (registers_count)
+ response.IndentLess();
+
+ response.Indent("</feature>\n");
+ response.IndentLess();
+ response.Indent("</target>\n");
return MemoryBuffer::getMemBufferCopy(response.GetString(), "target.xml");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134035.461512.patch
Type: text/x-patch
Size: 3382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220920/8266d6b1/attachment-0001.bin>
More information about the lldb-commits
mailing list