mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
GP-1329: convert Msg.error to console msg
This commit is contained in:
parent
56a8346e78
commit
2c386e37fe
3 changed files with 21 additions and 6 deletions
|
@ -25,6 +25,7 @@ import ghidra.app.plugin.PluginCategoryNames;
|
|||
import ghidra.app.plugin.core.debug.AbstractDebuggerPlugin;
|
||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||
import ghidra.app.plugin.core.debug.event.*;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
import ghidra.dbg.target.TargetInterpreter;
|
||||
|
@ -34,6 +35,7 @@ import ghidra.framework.plugintool.*;
|
|||
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.datastruct.CollectionChangeListener;
|
||||
|
||||
|
@ -67,6 +69,8 @@ public class DebuggerObjectsPlugin extends AbstractDebuggerPlugin
|
|||
protected DebuggerInterpreterService interpreterService;
|
||||
@AutoServiceConsumed
|
||||
public DebuggerModelService modelService;
|
||||
@AutoServiceConsumed
|
||||
private DebuggerConsoleService consoleService;
|
||||
|
||||
private List<DebuggerObjectsProvider> providers = new ArrayList<>();
|
||||
private boolean firstPass = true;
|
||||
|
@ -269,4 +273,13 @@ public class DebuggerObjectsPlugin extends AbstractDebuggerPlugin
|
|||
}
|
||||
providers.get(0).readConfigState(saveState);
|
||||
}
|
||||
|
||||
public void objectError(String title, String message) {
|
||||
if (consoleService == null) {
|
||||
Msg.showError(this, null, title, message);
|
||||
return;
|
||||
}
|
||||
consoleService.log(DebuggerResources.ICON_LOG_ERROR, message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -68,7 +68,8 @@ import ghidra.program.model.address.AddressRange;
|
|||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.datastruct.PrivatelyQueuedListener;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import resources.ResourceManager;
|
||||
|
@ -464,7 +465,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
|||
if (pane != null) {
|
||||
if (currentModel != null) {
|
||||
currentModel.fetchModelRoot().thenAccept(this::refresh).exceptionally(ex -> {
|
||||
Msg.error(this, "Error refreshing model root", ex);
|
||||
plugin.objectError("Refresh", "Error refreshing model root");
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
@ -667,7 +668,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
|||
table.setColumns();
|
||||
// TODO: What with attrs?
|
||||
}).exceptionally(ex -> {
|
||||
Msg.error(this, "Failed to fetch attributes", ex);
|
||||
plugin.objectError("Build Table", "Failed to fetch attributes");
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
@ -682,7 +683,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
|||
public void addTargetToMap(ObjectContainer container) {
|
||||
DebuggerObjectsProvider provider = container.getProvider();
|
||||
if (!this.equals(provider)) {
|
||||
Msg.error(this, "TargetMap corrupted");
|
||||
plugin.objectError("Add Target", "TargetMap corrupted");
|
||||
}
|
||||
TargetObject targetObject = container.getTargetObject();
|
||||
if (targetObject != null && !container.isLink()) {
|
||||
|
|
|
@ -17,10 +17,10 @@ package ghidra.app.plugin.core.debug.gui.objects.components;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsPlugin;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider;
|
||||
import ghidra.dbg.target.TargetMethod;
|
||||
import ghidra.dbg.target.TargetObject;
|
||||
import ghidra.util.Msg;
|
||||
|
||||
public class ObjectElementRow {
|
||||
|
||||
|
@ -33,7 +33,8 @@ public class ObjectElementRow {
|
|||
to.fetchAttributes(true).thenAccept(attributes -> {
|
||||
map = attributes;
|
||||
}).exceptionally(ex -> {
|
||||
Msg.error(this, "Failed to fetch attributes");
|
||||
DebuggerObjectsPlugin plugin = provider.getPlugin();
|
||||
plugin.objectError("Create Row", "Failed to fetch attributes");
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue