Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz 2022-04-14 15:07:28 -04:00
commit c7351125e5
6 changed files with 27 additions and 26 deletions

View file

@ -25,7 +25,7 @@
<li><I>Analysis</I>. Fixed another bug with recovering Objective-C method names. (GP-1642, Issue #3817)</li>
<li><I>Analysis</I>. Certain switch cases using the AARCH64 CSEL instruction will now recover correctly. Previously internal CBRANCH instructions could cause switch flow recovery failure in the decompiler switch analyzer. (GP-1687)</li>
<li><I>Analysis</I>. Fixed unused Microsoft Demangler options. (GP-1688, Issue #3892)</li>
<li><I>Analysis</I>. (U) Reverted change (GP-1575) introduced with Ghidra 10.1 which improperly factored image-base into analysis of ELF LSDA Gcc exception records. (GP-1702)</li>
<li><I>Analysis</I>. Reverted change (GP-1575) introduced with Ghidra 10.1 which improperly factored image-base into analysis of ELF LSDA GCC exception records. (GP-1702)</li>
<li><I>Build</I>. Fixed <code>gradle buildGhidra</code> issue where a second build doesn't include all the files. This issue appears to be a bug introduced in Gradle 7. (GP-1648, Issue #3827)</li>
<li><I>Data Types</I>. Fixed display of multiple Enum values. (GP-1657, Issue #3810)</li>
<li><I>Debugger</I>. Now invalidating caches for dbgeng/dbgmodel in the GADP variants so the memory is not left stale. (GP-846)</li>
@ -354,7 +354,7 @@
<li><I>Data Types</I>. When creating a substructure from existing components, the new structure will adopt the pack setting of the parent structure from which it was created. Note that a packed structure may still move based upon component alignment rules. (GP-1111, Issue #3193)</li>
<li><I>Decompiler</I>. Added <B>E</B> key binding to the Decompiler's Equate action. (GP-1146, Issue #3195)</li>
<li><I>GUI</I>. Added <B>Apply</B> button to analysis options dialog. Also added a last chance save/cancel dialog that is shown when a user cancels an options dialog that has unsaved changes. (GP-1169, Issue #3274)</li>
<li><I>Scripting</I>. For stripped gcc binaries, improved prototype RecoverClassesFromRTTIScript identification of vtables and simple class data, constructors, and destructors. (GP-1055, Issue #3266)</li>
<li><I>Scripting</I>. For stripped GCC binaries, improved prototype RecoverClassesFromRTTIScript identification of vtables and simple class data, constructors, and destructors. (GP-1055, Issue #3266)</li>
</ul>
</blockquote>
<blockquote><p><u>Bugs</u></p>
@ -799,7 +799,7 @@
<li><I>Processors</I>. Added manual index file for the M6809 processor. (GT-3449, Issue #1414)</li>
<li><I>Processors</I>. Corrected issues related to retained instruction context during a language upgrade. In some rare cases this retained context could interfere with the instruction re-disassembly. This context-clearing mechanism is controlled by a new pspec property: <code>resetContextOnUpgrade</code>. (GT-3531)</li>
<li><I>Processors</I>. Updated PIC24/PIC30 index file to match latest manual. Added support for dsPIC33C. (GT-3562)</li>
<li><I>Processors</I>. Added missing call-fixup to handle call side-effects for 32 bit gcc programs for <code>get_pc_thunk.ax/si</code>. (GP-10)</li>
<li><I>Processors</I>. Added missing call-fixup to handle call side-effects for 32 bit GCC programs for <code>get_pc_thunk.ax/si</code>. (GP-10)</li>
<li><I>Processors</I>. Added <code>ExitProcess</code> to PEFunctionsThatDoNotReturn. (GP-35)</li>
<li><I>Processors</I>. <B>External Disassembly</B> field in the Listing now shows Thumb disassembly when appropriate TMode context has been established on a memory location. (GP-49)</li>
<li><I>Processors</I>. Changed RISC-V jump instructions to the more appropriate <code>goto</code> instead of <code>call</code>. (GP-54, Issue #2120)</li>

View file

@ -1,6 +1,5 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,6 +15,11 @@
*/
package ghidra.app.util.xml;
import java.util.Iterator;
import java.util.StringTokenizer;
import org.apache.commons.lang3.StringUtils;
import ghidra.app.util.importer.MessageLog;
import ghidra.program.model.address.*;
import ghidra.program.model.listing.Program;
@ -28,9 +32,6 @@ import ghidra.util.xml.*;
import ghidra.xml.XmlElement;
import ghidra.xml.XmlPullParser;
import java.util.Iterator;
import java.util.StringTokenizer;
class RelocationTableXmlMgr {
private Program program;
@ -66,8 +67,8 @@ class RelocationTableXmlMgr {
}
int type = XmlUtilities.parseInt(element.getAttribute("TYPE"));
long[] values = unpackLongs(element.getAttribute("VALUE"));
byte[] bytes = unpackBytes(element.getAttribute("BYTES"));
String symbolName = element.getAttribute("SYMBOL_NAME");
byte[] bytes = unpackBytes(element.getAttribute("BYTES")); // optional
String symbolName = element.getAttribute("SYMBOL_NAME"); // optional
relocTable.add(addr, type, values, bytes, symbolName);
}
@ -120,7 +121,7 @@ class RelocationTableXmlMgr {
private String pack(byte[] values) {
if (values == null || values.length == 0) {
return "";
return null;
}
StringBuffer buf = new StringBuffer();
for (byte v : values) {
@ -149,9 +150,14 @@ class RelocationTableXmlMgr {
attrs.addAttribute("ADDRESS", XmlProgramUtilities.toString(reloc.getAddress()));
attrs.addAttribute("TYPE", reloc.getType(), true);
attrs.addAttribute("VALUE", pack(reloc.getValues()));
attrs.addAttribute("BYTES", pack(reloc.getBytes()));
attrs.addAttribute("SYMBOL_NAME", reloc.getSymbolName());
String packedBytes = pack(reloc.getBytes());
if (packedBytes != null) {
attrs.addAttribute("BYTES", packedBytes);
}
String symName = reloc.getSymbolName();
if (!StringUtils.isEmpty(symName)) {
attrs.addAttribute("SYMBOL_NAME", reloc.getSymbolName());
}
writer.startElement("RELOCATION", attrs);
writer.endElement("RELOCATION");
}

View file

@ -159,10 +159,11 @@
<!ELEMENT RELOCATION_TABLE (RELOCATION*)>
<!ELEMENT RELOCATION EMPTY>
<!ATTLIST RELOCATION ADDRESS CDATA #REQUIRED>
<!ATTLIST RELOCATION TYPE CDATA #REQUIRED>
<!ATTLIST RELOCATION VALUE CDATA #REQUIRED>
<!ATTLIST RELOCATION BYTES CDATA #IMPLIED>
<!ATTLIST RELOCATION ADDRESS CDATA #REQUIRED>
<!ATTLIST RELOCATION TYPE CDATA #REQUIRED>
<!ATTLIST RELOCATION VALUE CDATA #REQUIRED>
<!ATTLIST RELOCATION BYTES CDATA #IMPLIED>
<!ATTLIST RELOCATION SYMBOL_NAME CDATA #IMPLIED>
<!ELEMENT SYMBOL_TABLE (SYMBOL*)>

View file

@ -635,10 +635,10 @@ void PcodeLexer::initialize(istream *t)
}
}
uintb PcodeSnippet::allocateTemp(void)
uint4 PcodeSnippet::allocateTemp(void)
{ // Allocate a variable in the unique space and return the offset
uintb res = tempbase;
uint4 res = tempbase;
tempbase += 16;
return res;
}

View file

@ -113,7 +113,7 @@ class CompositeDBAdapterV5V6 extends CompositeDBAdapter {
if (compositeTable.getSchema().getVersion() == V5_VERSION) {
throw new UnsupportedOperationException();
}
if (packValue < CompositeInternal.DEFAULT_ALIGNMENT) {
if (packValue < CompositeInternal.DEFAULT_PACKING) {
packValue = CompositeInternal.NO_PACKING;
}
else {

View file

@ -28,12 +28,6 @@ import ghidra.util.exception.NotYetImplementedException;
*/
public abstract class CompositeDataTypeImpl extends GenericDataType implements CompositeInternal {
// Strings used for toString formatting
private static final String ALIGN_NAME = "aligned";
private static final String PACKING_NAME = "pack";
private static final String DISABLED_PACKING_NAME = "disabled";
private static final String DEFAULT_PACKING_NAME = "";
private String description;
protected int minimumAlignment = DEFAULT_ALIGNMENT;