mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-380: Better quick launch using opinions and offers.
This commit is contained in:
parent
93b2f5cc64
commit
808c20ab7f
28 changed files with 1210 additions and 310 deletions
|
@ -342,22 +342,6 @@ public interface DebuggerObjectModel {
|
|||
* are refreshed; and {@code A}'s, {@code B[1]}'s, and {@code C[2]}'s attribute caches are
|
||||
* refreshed.
|
||||
*
|
||||
* @implNote The returned value cannot be a {@link TargetObjectRef} unless the value represents
|
||||
* a link. In other words, if the path refers to an object, the model must return the
|
||||
* object, not a ref. When the value is a link, the implementation may optionally
|
||||
* resolve the object, but should only do so if it doesn't incur a significant cost.
|
||||
* Furthermore, such links cannot be resolved -- though they can be substituted for
|
||||
* the target object at the linked path. In other words, the path of the returned ref
|
||||
* (or object) must represent the link's target. Suppose {@code A[1]} is a link to
|
||||
* {@code B[1]}, which is in turn a link to {@code C[1]} -- honestly, linked links
|
||||
* ought to be a rare occurrence -- then fetching {@code A[1]} must return a ref to
|
||||
* {@code B[1]}. It must not return {@code C[1]} nor a ref to it. The reason deals
|
||||
* with caching and updates. If a request for {@code A[1]} were to return
|
||||
* {@code C[1]}, a client may cache that result. Suppose that client then observes a
|
||||
* change causing {@code B[1]} to link to {@code C[2]}. This implies that {@code A[1]}
|
||||
* now resolves to {@code C[2]}; however, the client has not received enough
|
||||
* information to update or invalidate its cache.
|
||||
*
|
||||
* @param path the path
|
||||
* @param refresh true to refresh caches
|
||||
* @return the found value, or {@code null} if it does not exist
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/* ###
|
||||
* 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://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.dbg;
|
||||
|
||||
import ghidra.util.classfinder.ExtensionPointProperties;
|
||||
|
||||
/**
|
||||
* A factory for a local debugger model
|
||||
*
|
||||
* <p>
|
||||
* These factories are searched when attempting to create a new default debug model targeting the
|
||||
* local environment.
|
||||
*/
|
||||
public interface LocalDebuggerModelFactory extends DebuggerModelFactory {
|
||||
/**
|
||||
* Get the priority of this factory
|
||||
*
|
||||
* <p>
|
||||
* In the event multiple compatible factories are discovered, the one with the highest priority
|
||||
* is selected, breaking ties arbitrarily.
|
||||
*
|
||||
* <p>
|
||||
* The default implementation returns the priority given by {@link ExtensionPointProperties}. If
|
||||
* the priority must be determined dynamically, then override this implementation.
|
||||
*
|
||||
* @return the priority, where lower values indicate higher priority.
|
||||
*/
|
||||
default int getPriority() {
|
||||
return ExtensionPointProperties.Util.getPriority(getClass());
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/* ###
|
||||
* 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://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.dbg.model;
|
||||
|
||||
import java.util.Deque;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
import ghidra.dbg.LocalDebuggerModelFactory;
|
||||
import ghidra.dbg.util.ConfigurableFactory.FactoryDescription;
|
||||
|
||||
@FactoryDescription(brief = "Mocked Local Client", htmlDetails = TestDebuggerModelFactory.FAKE_DETAILS)
|
||||
public class TestLocalDebuggerModelFactory implements LocalDebuggerModelFactory {
|
||||
protected final Deque<CompletableFuture<DebuggerObjectModel>> buildQueue =
|
||||
new LinkedList<>();
|
||||
|
||||
public TestLocalDebuggerModelFactory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<? extends DebuggerObjectModel> build() {
|
||||
CompletableFuture<DebuggerObjectModel> future = new CompletableFuture<>();
|
||||
buildQueue.offer(future);
|
||||
return future;
|
||||
}
|
||||
|
||||
public CompletableFuture<DebuggerObjectModel> pollBuild() {
|
||||
return buildQueue.poll();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue