diff options
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 072151e..4ea8472 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -3066,19 +3066,24 @@ GDBRemoteCommunicationServerLLGS::BuildTargetXml() { 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 @@ GDBRemoteCommunicationServerLLGS::BuildTargetXml() { 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 @@ GDBRemoteCommunicationServerLLGS::BuildTargetXml() { 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"); } |