mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00

Fixed typo in AddressLabelInfo. Improved implementation and error handling of AddressLabelInfo. GP-2606 Refactored the package of 'AddressLabelInfo' to beghidra.program.model.lang. Removed the source and namespace variablesfrom AddressLabelInfo since they would always be global and IMPORTED.Removed a number of constructors to simplify AddressLabelInfo. Improvederror handing in SleighLanguage class. GP-2606 Added javadocs to and throw exceptions from AddressLabelInfo constructors and removed extra constructors that were no longer needed. Added exception handling to AbsractProgramLoader and SleighLanguage for thrown exceptions. Made some variables in SleighLanguage private and removed an unnecessary null check. GP-2606 Prepared test to help investigate volatility interplay settings. GP-2606 Updated per review comments. SleighLanguage will parse pspec files andthen apply symbol element settings for volatility afterward. Simplifiedtests for SleighLanguage and the Decompiler. GP-2606 Made updates based on review feedback. Address label info holds the endaddress of the label. Sleigh language will resolve symbol mutabilityafter parsing the pspec file such that the order of elements in the filewill not be a factor. Rearranged tests in preparation for improvement.Added a constructor to the ProgramBuilder class so that custom definedpspec files may be used in the tests. GP-2606 Updated SpecXmlUtils decodeBoolean method to call decodeNullableBooleanfirst, however if the result is null, to return false instead of null. GP-2606 Changed size of addressLabelInfo to sizeInBytes and added comment toisVolatile that specifies what null, false, or true mean in context.Incorporated improvements per review comments to SleighLanguage. GP-2606 Added tests for the sleigh language volatility changes and thedecompiler itself. GP-2606: Updated SleighLanguage to alter 'volatileAddresses' based on the symbolelements and their attributes in pspec files. Added size and volatilevariables to AddressLabelInfo class. Added Boolean parser method to theSpecXmlUtils.java file. GP-2606: Added optional volatile boolean and optional size integer attributes to the symbol element of processor specification (pspec) files.
189 lines
5.6 KiB
XML
189 lines
5.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
|
|
|
<include href="language_common.rxg" />
|
|
|
|
<!-- processor_spec files have extension .pspec -->
|
|
|
|
<start>
|
|
<element name="processor_spec">
|
|
|
|
<!-- IMPORTANT NOTE:
|
|
If a register is renamed in the register_data section, any
|
|
subsequent reference to that register must use the NEW name.
|
|
Likewise, references before the rename must refer to the OLD
|
|
name.
|
|
|
|
Also, references in compiler specs to the registers must use
|
|
the new name, because the compiler specs for a given language
|
|
are loaded after the language is completely loaded.
|
|
-->
|
|
|
|
<interleave>
|
|
|
|
<optional>
|
|
<ref name="properties_type"/>
|
|
</optional>
|
|
|
|
<optional>
|
|
<element name="programcounter">
|
|
<attribute name="register"/>
|
|
</element>
|
|
</optional>
|
|
|
|
<optional>
|
|
<element name="data_space">
|
|
<attribute name="space"/>
|
|
<optional>
|
|
<attribute name="ptr_wordsize"/>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
|
|
<zeroOrMore>
|
|
<element name="inferptrbounds">
|
|
<oneOrMore>
|
|
<ref name="range_type"/>
|
|
</oneOrMore>
|
|
</element>
|
|
</zeroOrMore>
|
|
|
|
<optional>
|
|
<element name="segmented_address">
|
|
<attribute name="space"/>
|
|
<optional>
|
|
<attribute name="type"/>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
|
|
<zeroOrMore>
|
|
<ref name="segmentop_type"/>
|
|
</zeroOrMore>
|
|
|
|
<!-- see language_common.rxg -->
|
|
<optional>
|
|
<element name="context_data">
|
|
<ref name="context_data_type"/>
|
|
</element>
|
|
</optional>
|
|
|
|
<optional>
|
|
<element name="volatile">
|
|
<attribute name="inputop"/>
|
|
<attribute name="outputop"/>
|
|
<optional>
|
|
<attribute name="format"/>
|
|
<!-- format="functional" forces functional operator synxtax-->
|
|
</optional>
|
|
<oneOrMore>
|
|
<ref name="memory_tags_type"/>
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
|
|
<optional>
|
|
<element name="incidentalcopy">
|
|
<oneOrMore>
|
|
<ref name="varnode_tags_type"/>
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
|
|
<zeroOrMore>
|
|
<element name="jumpassist"><ref name="jumpassist_type"/>
|
|
</element>
|
|
</zeroOrMore>
|
|
|
|
<optional>
|
|
<element name="register_data">
|
|
<oneOrMore>
|
|
<element name="register">
|
|
<attribute name="name"/>
|
|
<optional>
|
|
<attribute name="rename"/>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="alias"/>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="group"/>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="hidden">
|
|
<ref name="boolean_type"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="vector_lane_sizes"/>
|
|
</optional>
|
|
</element>
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
|
|
<optional>
|
|
<element name="default_symbols">
|
|
<oneOrMore>
|
|
<element name="symbol">
|
|
<attribute name="name"/>
|
|
<attribute name="address"/>
|
|
<optional>
|
|
<attribute name="volatile">
|
|
<ref name="boolean_type"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="size"/>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="entry">
|
|
<ref name="boolean_type"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="type">
|
|
<ref name="symbol_type"/>
|
|
</attribute>
|
|
</optional>
|
|
</element>
|
|
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
|
|
<optional>
|
|
<element name="default_memory_blocks">
|
|
<oneOrMore>
|
|
<element name="memory_block">
|
|
<attribute name="name"/>
|
|
<attribute name="start_address"/>
|
|
<attribute name="length"/>
|
|
<choice>
|
|
<attribute name="bit_mapped_address"/>
|
|
<!--
|
|
byte_mapped_address - mapped memory address and optional mapping ratio
|
|
Examples:
|
|
byte_mapped_address="rom:1000" - maps every byte starting at rom:1000
|
|
byte_mapped_address="rom:1000/1:2" - maps one byte for every two bytes
|
|
starting at rom:1000. Facilitates skip of padding bytes.
|
|
-->
|
|
<attribute name="byte_mapped_address"/>
|
|
<attribute name="initialized">
|
|
<ref name="boolean_type"/>
|
|
</attribute>
|
|
</choice>
|
|
<optional> <attribute name="mode"/> </optional>
|
|
<optional>
|
|
<attribute name="overlay">
|
|
<ref name="boolean_type"/>
|
|
</attribute>
|
|
</optional>
|
|
</element>
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
</interleave>
|
|
</element>
|
|
</start>
|
|
</grammar>
|