Skip to content

Commit

Permalink
GP-3872: Port scripting API to Trace RMI
Browse files Browse the repository at this point in the history
  • Loading branch information
nsadeveloper789 committed Mar 28, 2024
1 parent 77923fa commit ad6cb58
Show file tree
Hide file tree
Showing 32 changed files with 3,103 additions and 2,031 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package ghidra.app.services;

import java.util.Collection;
import java.util.List;

import ghidra.debug.api.tracermi.TraceRmiLaunchOffer;
import ghidra.framework.plugintool.ServiceInfo;
Expand All @@ -35,4 +36,12 @@ public interface TraceRmiLauncherService {
* @return the offers
*/
Collection<TraceRmiLaunchOffer> getOffers(Program program);

/**
* Get offers with a saved configuration, ordered by most-recently-saved
*
* @param program the program
* @return the offers
*/
List<TraceRmiLaunchOffer> getSavedOffers(Program program);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.app.plugin.core.debug.gui.model;
package ghidra.debug.api.model;

import java.awt.Component;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.debug.api.model;

import docking.DefaultActionContext;
import ghidra.trace.model.target.TraceObjectKeyPath;

/**
* Really just used by scripts to get a path into an action context
*/
public class DebuggerSingleObjectPathActionContext extends DefaultActionContext {
private final TraceObjectKeyPath path;

public DebuggerSingleObjectPathActionContext(TraceObjectKeyPath path) {
this.path = path;
}

public TraceObjectKeyPath getPath() {
return path;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ public boolean builtIn() {
*/
Map<String, ActionEntry> collectActions(ActionName name, ActionContext context);

/**
* Execute a command as if in the CLI
*
* @param command the command
* @param toString true to capture the output and return it, false to print to the terminal
* @return the captured output, or null if {@code toString} is false
*/
CompletableFuture<String> executeAsync(String command, boolean toString);

/**
* @see #executeAsync(String, boolean)
*/
String execute(String command, boolean toString);

/**
* Get the trace thread that contains the given object
*
Expand Down
Loading

0 comments on commit ad6cb58

Please sign in to comment.