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);
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())
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");
}
"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)