Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz 2025-03-03 13:07:03 -05:00
commit e08184f5db
5 changed files with 30 additions and 20 deletions

View file

@ -251,7 +251,13 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
}
private void objectRestored(DomainObjectChangeRecord rec) {
addChanged(current.getView().getMemory());
for (AddressSpace space : current.getTrace()
.getBaseAddressFactory()
.getAllAddressSpaces()) {
if (space.isRegisterSpace() || space.isMemorySpace()) {
addChanged(new AddressRangeImpl(space.getMinAddress(), space.getMaxAddress()));
}
}
}
private void bytesChanged(TraceAddressSpace space, TraceAddressSnapRange range) {
@ -390,13 +396,6 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
changeDebouncer.addListener(__ -> doCheckDepsAndReevaluate());
}
private void addChanged(AddressSetView toAdd) {
synchronized (changed) {
changed.add(toAdd);
changeDebouncer.contact(null);
}
}
private void addChanged(AddressRange toAdd) {
synchronized (changed) {
changed.add(toAdd);

View file

@ -133,7 +133,14 @@ public class DefaultWatchRow implements WatchRow {
}
// Do not accidentally hang the Swing thread on evaluation
WatchValue fullValue = compiled.evaluate(executor);
byte[] prevValue = prevExec == null ? null : compiled.evaluate(prevExec);
byte[] prevValue;
try {
prevValue = prevExec == null ? null : compiled.evaluate(prevExec);
}
catch (Exception e) {
Msg.trace(this, "Error in evaluating previous value. Ignoring.", e);
prevValue = null;
}
synchronized (lock) {
if (executor != provider.asyncWatchExecutor) {
return;

View file

@ -42,9 +42,10 @@ public class RangeCursorTableHeaderRenderer<N extends Number & Comparable<N>>
setSavedTable(null);
return true;
}
int count = model.getColumnCount();
int count = savedTable.getColumnCount();
for (int i = 0; i < count; i++) {
if (model.getColumn(i) == col) {
int j = savedTable.convertColumnIndexToModel(i);
if (model.getColumn(j) == col) {
return false;
}
}

View file

@ -39,8 +39,7 @@ import ghidra.app.plugin.core.terminal.TerminalFinder.TextTerminalFinder;
import ghidra.app.plugin.core.terminal.vt.*;
import ghidra.app.plugin.core.terminal.vt.VtHandler.*;
import ghidra.app.services.ClipboardService;
import ghidra.util.ColorUtils;
import ghidra.util.Msg;
import ghidra.util.*;
/**
* A VT100 terminal emulator in a panel.
@ -466,9 +465,13 @@ public class TerminalPanel extends JPanel implements FieldLocationListener, Fiel
* Prevent the user from doing this. Cursor location is controlled by pty. While we've
* prevented key strokes from causing this, we've not prevented mouse clicks from doing it.
* Next best thing is to just move it back.
*
* NOTE: We schedule the cursor re-placement for later, because the FieldPanel may be about
* to scroll to the cursor. If we re-place immediately, it will likely scroll to the bottom
* of the terminal. This is especially annoying when the user is trying to make a selection.
*/
if (trigger == EventTrigger.GUI_ACTION) {
placeCursor(false);
Swing.runLater(() -> placeCursor(false));
}
}

View file

@ -31,8 +31,8 @@ public interface RowObjectTableModel<T> extends TableModel {
public static TableModel unwrap(TableModel m) {
TableModel model = m;
while (model instanceof WrappingTableModel) {
model = ((WrappingTableModel) model).getWrappedModel();
while (model instanceof WrappingTableModel wrapper) {
model = wrapper.getWrappedModel();
}
return model;
}