GP-0: Fix javodocs. Fix tests. Fix streamSub.

This commit is contained in:
Dan 2024-03-04 09:43:29 -05:00
parent c2bb47d45a
commit ddea132049
20 changed files with 262 additions and 34 deletions

View file

@ -38,6 +38,8 @@ import ghidra.util.classfinder.ClassSearcher;
* <p>
* For a complete example of a p-code emulator, see {@link PcodeEmulator}. For an alternative
* implementation incorporating an abstract piece, see the Taint Analyzer.
*
* @param <T> the type of objects in the machine's state
*/
public abstract class AbstractPcodeMachine<T> implements PcodeMachine<T> {

View file

@ -198,7 +198,12 @@ public interface PcodeMachine<T> {
/**
* Set the suspension state of the machine
*
* <p>
* This does not simply suspend all threads, but sets a machine-wide flag. A thread is suspended
* if either the thread's flag is set, or the machine's flag is set.
*
* @see PcodeThread#setSuspended(boolean)
* @param suspended true to suspend the machine, false to let it run
*/
void setSuspended(boolean suspended);
@ -206,6 +211,7 @@ public interface PcodeMachine<T> {
* Check the suspension state of the machine
*
* @see PcodeThread#isSuspended()
* @return true if suspended
*/
boolean isSuspended();

View file

@ -15,8 +15,6 @@
*/
package ghidra.pcode.emu;
import java.util.List;
import ghidra.app.plugin.processors.sleigh.SleighLanguage;
import ghidra.pcode.emu.DefaultPcodeThread.PcodeEmulationLibrary;
import ghidra.pcode.exec.*;
@ -289,6 +287,9 @@ public interface PcodeThread<T> {
* reliable way to halt execution. Note the emulator may halt mid instruction. If this is not
* desired, then upon catching the exception, un-suspend the p-code thread and call
* {@link #finishInstruction()} or {@link #dropInstruction()}.
*
* @see PcodeMachine#setSuspended(boolean)
* @param suspended true to suspend the machine, false to let it run
*/
void setSuspended(boolean suspended);
@ -341,6 +342,7 @@ public interface PcodeThread<T> {
* The memory part of this state is shared among all threads in the same machine. See
* {@link PcodeMachine#getSharedState()}.
*
* @return the state
*/
ThreadPcodeExecutorState<T> getState();

View file

@ -40,6 +40,11 @@ public enum SleighUtils {
/**
* A Sleigh parsing error
*
* @param header the header / title for the message
* @param message the detail message
* @param start the character position where the syntax error starts
* @param stop the character position where the syntax error ends
*/
public record SleighParseErrorEntry(String header, String message, int start, int stop) {
public String fullMessage() {