Merge remote-tracking branch 'origin/GP-1102_EscapedAddrSpaceNames' into

patch (Closes #3126)
This commit is contained in:
ghidra1
2021-07-06 19:00:12 -04:00
4 changed files with 11 additions and 8 deletions
@@ -415,8 +415,9 @@ void PcodeOp::saveXml(ostream &s) const
else if (vn->getSpace()->getType()==IPTR_CONSTANT) {
if ((i==0)&&((code()==CPUI_STORE)||(code()==CPUI_LOAD))) {
AddrSpace *spc = Address::getSpaceFromConst(vn->getAddr());
s << "<spaceid name=\"";
s << spc->getName() << "\"/>\n";
s << "<spaceid";
a_v(s,"name",spc->getName());
s << "/>\n";
}
else
s << "<addr ref=\"0x" << hex << vn->getCreateIndex() << "\"/>\n";
@@ -259,8 +259,9 @@ void EmitXml::tagField(const char *ptr,syntax_highlight hl,const Datatype *ct,in
void EmitXml::tagComment(const char *ptr,syntax_highlight hl,
const AddrSpace *spc,uintb off) {
*s << "<comment " << highlight[(int4)hl];
*s << " space=\"" << spc->getName();
*s << "\" off=\"0x" << hex << off << "\">";
a_v(*s,"space",spc->getName());
a_v_u(*s,"off",off);
*s << '>';
xml_escape(*s,ptr);
*s << "</comment>";
}
@@ -276,8 +277,9 @@ void EmitXml::tagComment(const char *ptr,syntax_highlight hl,
void EmitXml::tagLabel(const char *ptr,syntax_highlight hl,
const AddrSpace *spc,uintb off) {
*s << "<label " << highlight[(int4)hl];
*s << " space=\"" << spc->getName();
*s << "\" off=\"0x" << hex << off << "\">";
a_v(*s,"space",spc->getName());
a_v_u(*s,"off",off);
*s << '>';
xml_escape(*s,ptr);
*s << "</label>";
}
@@ -62,5 +62,5 @@ ffffffbfdff7ffffe811ffffffbf6100
<stringmatch name="Convert #14" min="1" max="1">recv_signed\(-0b1100110011001100\)</stringmatch>
<stringmatch name="Convert #15" min="1" max="1">recv_unsigned\(0b1110111011101110\)</stringmatch>
<stringmatch name="Convert #16" min="1" max="1">recv_unsigned\(0b11111111111111111111011111011111\)</stringmatch>
<stringmatch name="Convert #17" min="1" max="1">recv_signed\('a'\)</stringmatch>
<stringmatch name="Convert #17" min="1" max="1">recv_signed\(L'a'\)</stringmatch>
</decompilertest>
@@ -1433,7 +1433,7 @@ public class SleighLanguage implements Language {
if ((element instanceof OverlayAddressSpace)) {
OverlayAddressSpace ospace = (OverlayAddressSpace) element;
resBuf.append("<space_overlay");
SpecXmlUtils.encodeStringAttribute(resBuf, "name", ospace.getName());
SpecXmlUtils.xmlEscapeAttribute(resBuf, "name", ospace.getName());
SpecXmlUtils.encodeSignedIntegerAttribute(resBuf, "index", ospace.getUnique());
SpecXmlUtils.encodeStringAttribute(resBuf, "base",
ospace.getOverlayedSpace().getName());