Merge remote-tracking branch

'origin/GP-5704_ghidra1_x86_16_LanguageUpgradeIssues' into Ghidra_11.4
(Closes #8140)
This commit is contained in:
ghidra1 2025-05-19 16:05:04 -04:00
commit 0b2739a8fe
10 changed files with 29 additions and 13 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -478,7 +478,16 @@ class OldLanguage implements Language {
} }
if ("segmented_space".equals(elementName)) { if ("segmented_space".equals(elementName)) {
space = new SegmentedAddressSpace(name, unique); String segmentType = childElement.getAttributeValue("type");
if (segmentType == null) {
throw new SAXException("Missing required segmented_space 'type' attribute");
}
if (segmentType.equals("protected")) {
space = new ProtectedAddressSpace(name, unique);
}
else {
space = new SegmentedAddressSpace(name, unique);
}
} }
else { else {
String typeStr = childElement.getAttributeValue("type"); String typeStr = childElement.getAttributeValue("type");

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -323,6 +323,12 @@ public class OldLanguageFactory {
Element element; Element element;
if (space instanceof SegmentedAddressSpace) { if (space instanceof SegmentedAddressSpace) {
element = new Element("segmented_space"); element = new Element("segmented_space");
if (space instanceof ProtectedAddressSpace) {
element.setAttribute("type", "protected");
}
else {
element.setAttribute("type", "real");
}
element.setAttribute("name", space.getName()); element.setAttribute("name", space.getName());
} }
else { else {

View file

@ -6,7 +6,7 @@
</description> </description>
<compiler name="default" id="default"/> <compiler name="default" id="default"/>
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="real" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -8,7 +8,7 @@
</description> </description>
<compiler name="default" id="default" /> <compiler name="default" id="default" />
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="real" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -8,7 +8,7 @@
</description> </description>
<compiler name="default" id="default" /> <compiler name="default" id="default" />
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="real" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -8,7 +8,7 @@
</description> </description>
<compiler name="default" id="default" /> <compiler name="default" id="default" />
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="protected" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -8,7 +8,7 @@
</description> </description>
<compiler name="default" id="default" /> <compiler name="default" id="default" />
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="protected" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -6,7 +6,8 @@
</description> </description>
<compiler name="default" id="default"/> <compiler name="default" id="default"/>
<spaces> <spaces>
<space name="ram" type="ram" size="4" default="yes" /> <!-- <space name="ram" type="ram" size="4" default="yes" /> -->
<segmented_space type="protected" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -8,7 +8,7 @@
</description> </description>
<compiler name="default" id="default" /> <compiler name="default" id="default" />
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="protected" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>

View file

@ -8,7 +8,7 @@
</description> </description>
<compiler name="default" id="default" /> <compiler name="default" id="default" />
<spaces> <spaces>
<segmented_space name="ram" default="yes" /> <segmented_space type="protected" name="ram" default="yes" />
<space name="register" type="register" size="4" /> <space name="register" type="register" size="4" />
</spaces> </spaces>
<registers> <registers>