diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/DebuggerBreakpointsPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/DebuggerBreakpointsPlugin.html index daa63d1045..813e16dbd2 100644 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/DebuggerBreakpointsPlugin.html +++ b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/DebuggerBreakpointsPlugin.html @@ -149,8 +149,11 @@
  • Threads - (hidden by default) if the breakpoint applies to a limited set of threads, gives the list of threads.
  • -
  • Comment - gives a user comment — the specification's expression by default. This - field is user modifiable.
  • +
  • Comment - gives a user comment. This field is user modifiable.
  • + +
  • Expression - the expression given by the user when placing the breakpoint. This ought to + echo back what was typed into the CLI, if applicable. When placed via a Listing, this often + refers to the dynamic address.
  • Sleigh - indicates whether or not the location has a customized Sleigh configuration. This is only relevant for emulation.
  • @@ -319,7 +322,7 @@ emu_exec_decoded(); Alternatively, suppose the example instruction is JZ 0x00401234. Then, the injection can jump straight to the target:
    -goto [0x00401234];
    +goto 0x00401234;
     
    diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/images/DebuggerBreakpointsPlugin.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/images/DebuggerBreakpointsPlugin.png index 77722233b8..5615abc9f6 100644 Binary files a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/images/DebuggerBreakpointsPlugin.png and b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointsPlugin/images/DebuggerBreakpointsPlugin.png differ diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/BreakpointLocationRow.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/BreakpointLocationRow.java index c835c5c32a..543972d6ea 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/BreakpointLocationRow.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/BreakpointLocationRow.java @@ -25,6 +25,7 @@ import ghidra.pcode.exec.SleighUtils; import ghidra.program.model.address.Address; import ghidra.program.util.ProgramLocation; import ghidra.trace.model.breakpoint.TraceBreakpointLocation; +import ghidra.trace.model.breakpoint.TraceBreakpointSpec; public class BreakpointLocationRow { private final DebuggerBreakpointsProvider provider; @@ -113,6 +114,15 @@ public class BreakpointLocationRow { } } + public String getExpression() { + TraceBreakpointSpec spec = loc.getSpecification(); + if (spec == null) { + // Shouldn't happen, but may in the interim + return ""; + } + return spec.getExpression(getSnap()); + } + public boolean hasSleigh() { return !SleighUtils.UNCONDITIONAL_BREAK.equals(loc.getEmuSleigh(getSnap())); } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java index c7a90e983b..88d460684b 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsProvider.java @@ -70,8 +70,9 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter protected enum LogicalBreakpointTableColumns implements EnumeratedTableColumn { - STATE("State", State.class, LogicalBreakpointRow::getState, LogicalBreakpointRow::setState, true), - NAME("Name", String.class, LogicalBreakpointRow::getName, LogicalBreakpointRow::setName, // + STATE("State", State.class, LogicalBreakpointRow::getState, LogicalBreakpointRow::setState, + true), + NAME("Name", String.class, LogicalBreakpointRow::getName, LogicalBreakpointRow::setName, LogicalBreakpointRow::isNamable, true), ADDRESS("Address", Address.class, LogicalBreakpointRow::getAddress, true), IMAGE("Image", String.class, LogicalBreakpointRow::getImageName, true), @@ -142,8 +143,8 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter } } - protected static class LogicalBreakpointTableModel extends RowWrappedEnumeratedColumnTableModel< // - LogicalBreakpointTableColumns, LogicalBreakpoint, LogicalBreakpointRow, LogicalBreakpoint> { + protected static class LogicalBreakpointTableModel extends RowWrappedEnumeratedColumnTableModel< + LogicalBreakpointTableColumns, LogicalBreakpoint, LogicalBreakpointRow, LogicalBreakpoint> { public LogicalBreakpointTableModel(DebuggerBreakpointsProvider provider) { super(provider.getTool(), "Breakpoints", LogicalBreakpointTableColumns.class, lb -> lb, @@ -160,12 +161,16 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter protected enum BreakpointLocationTableColumns implements EnumeratedTableColumn { - STATE("State", State.class, BreakpointLocationRow::getState, BreakpointLocationRow::setState, true, true), - NAME("Name", String.class, BreakpointLocationRow::getName, BreakpointLocationRow::setName, true, true), + STATE("State", State.class, BreakpointLocationRow::getState, + BreakpointLocationRow::setState, true, true), + NAME("Name", String.class, BreakpointLocationRow::getName, BreakpointLocationRow::setName, + true, true), ADDRESS("Address", Address.class, BreakpointLocationRow::getAddress, true, true), TRACE("Trace", String.class, BreakpointLocationRow::getTraceName, true, true), THREADS("Threads", String.class, BreakpointLocationRow::getThreads, true, false), - COMMENT("Comment", String.class, BreakpointLocationRow::getComment, BreakpointLocationRow::setComment, true, true), + COMMENT("Comment", String.class, BreakpointLocationRow::getComment, + BreakpointLocationRow::setComment, true, true), + EXPRESSION("Expression", String.class, BreakpointLocationRow::getExpression, true, true), SLEIGH("Sleigh", Boolean.class, BreakpointLocationRow::hasSleigh, true, true); private final String header; @@ -229,9 +234,8 @@ public class DebuggerBreakpointsProvider extends ComponentProviderAdapter } protected static class BreakpointLocationTableModel - extends RowWrappedEnumeratedColumnTableModel< // - BreakpointLocationTableColumns, ObjectKey, BreakpointLocationRow, // - TraceBreakpointLocation> { + extends RowWrappedEnumeratedColumnTableModel { public BreakpointLocationTableModel(DebuggerBreakpointsProvider provider) { super(provider.getTool(), "Locations", BreakpointLocationTableColumns.class, diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java index 6de9fe339e..ab7390f161 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/register/DebuggerRegistersProvider.java @@ -141,11 +141,11 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter protected enum RegisterTableColumns implements EnumeratedTableColumn { - FAV("Fav", 1, Boolean.class, RegisterRow::isFavorite, RegisterRow::setFavorite, // - r -> true, SortDirection.DESCENDING), + FAV("Fav", 1, Boolean.class, RegisterRow::isFavorite, RegisterRow::setFavorite, r -> true, + SortDirection.DESCENDING), NUMBER("#", 1, Integer.class, RegisterRow::getNumber), NAME("Name", 40, String.class, RegisterRow::getName), - VALUE("Value", 100, BigInteger.class, RegisterRow::getValue, RegisterRow::setValue, // + VALUE("Value", 100, BigInteger.class, RegisterRow::getValue, RegisterRow::setValue, RegisterRow::isValueEditable, SortDirection.ASCENDING) { private static final RegisterValueCellRenderer RENDERER = new RegisterValueCellRenderer(); @@ -162,10 +162,11 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter return DEFS; } }, - TYPE("Type", 40, DataType.class, RegisterRow::getDataType, RegisterRow::setDataType, // + TYPE("Type", 40, DataType.class, RegisterRow::getDataType, RegisterRow::setDataType, r -> true, SortDirection.ASCENDING), - REPR("Repr", 100, String.class, RegisterRow::getRepresentation, RegisterRow::setRepresentation, // - RegisterRow::isRepresentationEditable, SortDirection.ASCENDING); + REPR("Repr", 100, String.class, RegisterRow::getRepresentation, + RegisterRow::setRepresentation, RegisterRow::isRepresentationEditable, + SortDirection.ASCENDING); private final String header; private final int width; @@ -414,6 +415,7 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter @Override public final Component getTableCellRendererComponent(GTableCellRenderingData data) { super.getTableCellRendererComponent(data); + setFont(getFixedWidthFont()); RegisterRow row = (RegisterRow) data.getRowObject(); if (!row.isKnown()) { if (data.isSelected()) { @@ -1099,9 +1101,6 @@ public class DebuggerRegistersProvider extends ComponentProviderAdapter result.add(pc); } for (Register reg : lang.getRegisters()) { - //if (reg.getGroup() != null) { - // continue; - //} if (reg.isProcessorContext()) { continue; } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java index e42bf5b02a..85473683ec 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java @@ -66,6 +66,22 @@ public class DebuggerStackPanel extends AbstractObjectsTableBasedPanel getProperty(ValueRow row) { + return new ValueAddressProperty(row) { + @Override + public Address getValue() { + TraceObjectValue entry = row.getAttributeEntry(attributeName); + return entry.getValue() instanceof Address addr ? addr : null; + } + + @Override + public boolean isModified() { + return row.isAttributeModified(attributeName); + } + }; + } } static Address computeProgramCounter(ValueRow row, long snap) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/time/DebuggerSnapshotTablePanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/time/DebuggerSnapshotTablePanel.java index 0cec92c03c..4547c352d7 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/time/DebuggerSnapshotTablePanel.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/time/DebuggerSnapshotTablePanel.java @@ -59,10 +59,11 @@ public class DebuggerSnapshotTablePanel extends JPanel { EVENT_THREAD("Event Thread", String.class, SnapshotRow::getEventThreadName, true), PC("PC", Address.class, SnapshotRow::getProgramCounter, true), MODULE("Module", String.class, SnapshotRow::getModuleName, true), - FUNCTION("Function", ghidra.program.model.listing.Function.class, SnapshotRow::getFunction, true), + FUNCTION("Function", ghidra.program.model.listing.Function.class, SnapshotRow::getFunction, + true), TIMESTAMP("Timestamp", Date.class, SnapshotRow::getTimeStamp, false), SCHEDULE("Schedule", TraceSchedule.class, SnapshotRow::getSchedule, false), - DESCRIPTION("Description", String.class, SnapshotRow::getDescription, // + DESCRIPTION("Description", String.class, SnapshotRow::getDescription, SnapshotRow::setDescription, true); private final String header; @@ -212,6 +213,39 @@ public class DebuggerSnapshotTablePanel extends JPanel { }; } + Font lastFixedWidthFont; + Font fixedWidthBoldFont; + Font fixedWidthItalicFont; + + Font computePlainFont(GTableCellRenderingData data) { + return data.getValue() instanceof Address ? getFixedWidthFont() : getDefaultFont(); + } + + void checkDeriveNewFonts() { + if (Objects.equals(lastFixedWidthFont, getFixedWidthFont())) { + return; + } + lastFixedWidthFont = getFixedWidthFont(); + fixedWidthBoldFont = lastFixedWidthFont.deriveFont(Font.BOLD); + fixedWidthItalicFont = lastFixedWidthFont.deriveFont(Font.ITALIC); + } + + Font computeBoldFont(GTableCellRenderingData data) { + if (data.getValue() instanceof Address) { + checkDeriveNewFonts(); + return fixedWidthBoldFont; + } + return getBoldFont(); + } + + Font computeItalicFont(GTableCellRenderingData data) { + if (data.getValue() instanceof Address) { + checkDeriveNewFonts(); + return fixedWidthItalicFont; + } + return getItalicFont(); + } + @Override public Component getTableCellRendererComponent(GTableCellRenderingData data) { super.getTableCellRendererComponent(data); @@ -221,10 +255,13 @@ public class DebuggerSnapshotTablePanel extends JPanel { return this; } if (current.getViewSnap() == row.getSnap()) { - setBold(); + setFont(computeBoldFont(data)); } else if (current.getSnap() == row.getSnap()) { - setItalic(); + setFont(computeItalicFont(data)); + } + else { + setFont(computePlainFont(data)); } TraceSnapshot snapshot = row.getSnapshot(); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java index b4382b6688..4c09294e21 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/watch/DebuggerWatchesProvider.java @@ -85,6 +85,7 @@ import ghidra.util.exception.CancelledException; import ghidra.util.table.GhidraTable; import ghidra.util.table.GhidraTableFilterPanel; import ghidra.util.table.column.AbstractGColumnRenderer; +import ghidra.util.table.column.GColumnRenderer; public class DebuggerWatchesProvider extends ComponentProviderAdapter implements DebuggerWatchesService { @@ -151,12 +152,24 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter implements EnumeratedTableColumn { EXPRESSION("Expression", String.class, WatchRow::getExpression, WatchRow::setExpression), COMMENT("Comment", String.class, WatchRow::getComment, WatchRow::setComment), - ADDRESS("Address", Address.class, WatchRow::getAddress), + ADDRESS("Address", Address.class, WatchRow::getAddress) { + @Override + public GColumnRenderer getRenderer() { + return CustomToStringCellRenderer.MONO_OBJECT; + } + }, SYMBOL("Symbol", Symbol.class, WatchRow::getSymbol), - VALUE("Value", String.class, WatchRow::getRawValueString, WatchRow::setRawValueString, // - WatchRow::isRawValueEditable), + VALUE("Value", String.class, WatchRow::getRawValueString, WatchRow::setRawValueString, + WatchRow::isRawValueEditable) { + private static final WatchValueCellRenderer RENDERER = new WatchValueCellRenderer(); + + @Override + public GColumnRenderer getRenderer() { + return RENDERER; + } + }, TYPE("Type", DataType.class, WatchRow::getDataType, WatchRow::setDataType), - REPR("Repr", String.class, WatchRow::getValueString, WatchRow::setValueString, // + REPR("Repr", String.class, WatchRow::getValueString, WatchRow::setValueString, WatchRow::isValueEditable), ERROR("Error", String.class, WatchRow::getErrorMessage); @@ -292,10 +305,11 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter } } - class WatchValueCellRenderer extends AbstractGColumnRenderer { + static class WatchValueCellRenderer extends AbstractGColumnRenderer { @Override public Component getTableCellRendererComponent(GTableCellRenderingData data) { super.getTableCellRendererComponent(data); + setFont(getFixedWidthFont()); WatchRow row = (WatchRow) data.getRowObject(); if (!row.isKnown()) { if (data.isSelected()) { @@ -453,10 +467,6 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter }); TableColumnModel columnModel = watchTable.getColumnModel(); - TableColumn addrCol = columnModel.getColumn(WatchTableColumns.ADDRESS.ordinal()); - addrCol.setCellRenderer(CustomToStringCellRenderer.MONO_OBJECT); - TableColumn valCol = columnModel.getColumn(WatchTableColumns.VALUE.ordinal()); - valCol.setCellRenderer(new WatchValueCellRenderer()); TableColumn typeCol = columnModel.getColumn(WatchTableColumns.TYPE.ordinal()); typeCol.setCellEditor(new WatchDataTypeEditor()); } diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/DebuggerEmulationIntegration.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/DebuggerEmulationIntegration.java index ecc2da1d92..a38f9d098e 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/DebuggerEmulationIntegration.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/emulation/DebuggerEmulationIntegration.java @@ -132,7 +132,7 @@ public enum DebuggerEmulationIntegration { @Override public AddressSetView readUninitialized(PcodeTraceDataAccess acc, PcodeThread thread, PcodeExecutorStatePiece piece, AddressSetView set) { - AddressSetView unknown = acc.intersectUnknown(set); + AddressSetView unknown = set.subtract(acc.intersectViewKnown(set, false)); if (unknown.isEmpty()) { return super.readUninitialized(acc, thread, piece, set); } @@ -148,7 +148,7 @@ public enum DebuggerEmulationIntegration { } if (acc instanceof PcodeDebuggerMemoryAccess memAcc) { if (memAcc.isLive() && waitTimeout(memAcc.readFromTargetMemory(unknown))) { - unknown = memAcc.intersectUnknown(set); + unknown = set.subtract(memAcc.intersectViewKnown(set, false)); if (unknown.isEmpty()) { return super.readUninitialized(acc, thread, piece, set); } diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/AbstractPcodeTraceDataAccess.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/AbstractPcodeTraceDataAccess.java index 0bf9ec3fed..a0cb53020a 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/AbstractPcodeTraceDataAccess.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/AbstractPcodeTraceDataAccess.java @@ -4,9 +4,9 @@ * 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. @@ -162,20 +162,6 @@ public abstract class AbstractPcodeTraceDataAccess implements InternalPcodeTrace return platform.mapHostToGuest(hostResult); } - @Override - public AddressSetView intersectUnknown(AddressSetView guestView) { - TraceMemoryOperations ops = getMemoryOps(false); - if (ops == null) { - return guestView; - } - - AddressSetView hostView = toOverlay(platform.mapGuestToHost(guestView)); - AddressSetView hostKnown = ops.getAddressesWithState(snap, hostView, - s -> s != null && s != TraceMemoryState.UNKNOWN); - AddressSetView hostResult = TraceRegisterUtils.getPhysicalSet(hostView.subtract(hostKnown)); - return platform.mapHostToGuest(hostResult); - } - @Override public int putBytes(Address start, ByteBuffer buf) { // TODO: Truncate or verify range? diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/DefaultPcodeTraceThreadAccess.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/DefaultPcodeTraceThreadAccess.java index d6eaf8bb51..19f3b1bb6b 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/DefaultPcodeTraceThreadAccess.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/DefaultPcodeTraceThreadAccess.java @@ -4,9 +4,9 @@ * 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. @@ -76,11 +76,6 @@ public class DefaultPcodeTraceThreadAccess .union(registers.intersectViewKnown(view, useFullSpans)); } - @Override - public AddressSetView intersectUnknown(AddressSetView view) { - return memory.intersectUnknown(view).union(registers.intersectUnknown(view)); - } - @Override public int putBytes(Address start, ByteBuffer buf) { if (start.isRegisterAddress()) { diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/PcodeTraceDataAccess.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/PcodeTraceDataAccess.java index 3d4e6d66f4..4f19953595 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/PcodeTraceDataAccess.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/pcode/exec/trace/data/PcodeTraceDataAccess.java @@ -4,9 +4,9 @@ * 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. @@ -73,15 +73,6 @@ public interface PcodeTraceDataAccess { */ AddressSetView intersectViewKnown(AddressSetView view, boolean useFullSpans); - /** - * Compute the intersection of the given address set and the set of - * {@link TraceMemoryState#UNKNOWN} memory - * - * @param view the address set - * @return the intersection - */ - AddressSetView intersectUnknown(AddressSetView view); - /** * Write bytes into the trace * diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java index fee2453f98..3618e91f62 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java +++ b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java @@ -44,7 +44,7 @@ import ghidra.test.ToyProgramBuilder; import ghidra.trace.database.ToyDBTraceBuilder; import ghidra.trace.database.breakpoint.DBTraceBreakpointManager; import ghidra.trace.model.*; -import ghidra.trace.model.breakpoint.TraceBreakpointKind; +import ghidra.trace.model.breakpoint.*; import ghidra.util.Msg; import ghidra.util.task.TaskMonitor; import help.screenshot.GhidraScreenShotGenerator; @@ -151,11 +151,20 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera long snap = tb1.trace.getTimeManager().createSnapshot("First").getKey(); DBTraceBreakpointManager bm = tb1.trace.getBreakpointManager(); - bm.placeBreakpoint("Breakpoints[1]", snap, tb1.addr(0x00401234), List.of(), - Set.of(TraceBreakpointKind.SW_EXECUTE), true, "ram:00401234"); - bm.placeBreakpoint("Breakpoints[2]", snap, tb1.range(0x00604321, 0x00604324), - List.of(), - Set.of(TraceBreakpointKind.WRITE), true, "ram:00604321"); + TraceBreakpointLocation locCx = + bm.placeBreakpoint("Breakpoints[1]", snap, tb1.addr(0x00401234), List.of(), + Set.of(TraceBreakpointKind.SW_EXECUTE), true, ""); + locCx.getSpecification() + .getObject() + .setAttribute(Lifespan.nowOn(snap), TraceBreakpointSpec.KEY_EXPRESSION, + "*0x00401234"); + TraceBreakpointLocation locWr = + bm.placeBreakpoint("Breakpoints[2]", snap, tb1.range(0x00604321, 0x00604324), + List.of(), Set.of(TraceBreakpointKind.WRITE), true, ""); + locWr.getSpecification() + .getObject() + .setAttribute(Lifespan.nowOn(snap), TraceBreakpointSpec.KEY_EXPRESSION, + "version"); } try (Transaction tx = tb2.startTransaction()) { @@ -164,8 +173,13 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera long snap = tb2.trace.getTimeManager().createSnapshot("First").getKey(); DBTraceBreakpointManager bm = tb2.trace.getBreakpointManager(); - bm.placeBreakpoint("Breakpoints[1]", snap, tb2.addr(0x7fac1234), List.of(), - Set.of(TraceBreakpointKind.SW_EXECUTE), false, "ram:7fac1234"); + TraceBreakpointLocation locCx = + bm.placeBreakpoint("Breakpoints[1]", snap, tb2.addr(0x7fac1234), List.of(), + Set.of(TraceBreakpointKind.SW_EXECUTE), false, ""); + locCx.getSpecification() + .getObject() + .setAttribute(Lifespan.nowOn(snap), TraceBreakpointSpec.KEY_EXPRESSION, + "*0x7fac1234"); } programManager.openProgram(program); diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java index f6a77c9b9a..2df50940e4 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java +++ b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java @@ -263,6 +263,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator @Test public void testGettingStarted_ToolWSpecimen() { + tool.getActiveWindow().requestFocus(); captureToolWindow(1920, 1080); } @@ -315,7 +316,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator public void testGettingStarted_DisassemblyAfterLaunch() throws Throwable { launchProgramInGdb(); - Thread.sleep(7000); + tool.getActiveWindow().requestFocus(); captureToolWindow(1920, 1080); } @@ -448,6 +449,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator // Just to be sure. goTo(tool, progLibC, flatDbg.translateDynamicToStatic(dynAddr)); + tool.getActiveWindow().requestFocus(); captureToolWindow(1920, 1080); } diff --git a/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.html b/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.html index 8d514d35c7..1732b21481 100644 --- a/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.html +++ b/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.html @@ -261,9 +261,9 @@ back-end.
  • The Trace column indicates which target contains the location. The text here should match one of the tabs from the Dynamic Listing panel.
  • -
  • The Comment column is a user-defined comment. Its -default value is the specification that generated it, e.g., -srand.
  • +
  • The Comment column is a user-defined comment.
  • +
  • The Expression column is the expression given when +specifying the breakpoint, e.g., srand.
  • @@ -422,7 +422,7 @@ course.

    Exercise: Diagram the Mines

    -

    You goal is to capture the location of all the mines. You will +

    Your goal is to capture the location of all the mines. You will probably want to disable the breakpoints on rand and srand for now. Devise a strategy using breakpoints and the control buttons (Step, Resume, etc.) so that you can observe the diff --git a/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.md b/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.md index a42cc52a02..3e4149b703 100644 --- a/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.md +++ b/GhidraDocs/GhidraClass/Debugger/A3-Breakpoints.md @@ -88,7 +88,7 @@ The State, Address, and Sleigh columns are the same as the top, but for the indi * The **Trace** column indicates which target contains the location. The text here should match one of the tabs from the Dynamic Listing panel. * The **Comment** column is a user-defined comment. - Its default value is the specification that generated it, e.g., `srand`. +* The **Expression** column is the expression given when specifying the breakpoint, e.g., `srand`. ### Toggling the Breakpoints @@ -195,7 +195,7 @@ The advantages of a dynamic session along side static analysis should become mor ### Exercise: Diagram the Mines -You goal is to capture the location of all the mines. +Your goal is to capture the location of all the mines. You will probably want to disable the breakpoints on `rand` and `srand` for now. Devise a strategy using breakpoints and the control buttons (Step, Resume, etc.) so that you can observe the location of each mine. Use pen and paper to draw a diagram of the board, and mark the location of each mine as you observe the algorithm placing it. diff --git a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_EmptyAfterLaunch.png b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_EmptyAfterLaunch.png index 3955c95344..f6a0e1bac2 100644 Binary files a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_EmptyAfterLaunch.png and b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_EmptyAfterLaunch.png differ diff --git a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_PopAfterSRandRand.png b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_PopAfterSRandRand.png index 26f01c8170..7efe94e1d6 100644 Binary files a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_PopAfterSRandRand.png and b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_PopAfterSRandRand.png differ diff --git a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png index 856c2a4e5e..45a4123f2b 100644 Binary files a/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png and b/GhidraDocs/GhidraClass/Debugger/images/Breakpoints_SyncedAfterImportLibC.png differ diff --git a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png index 252c733b3e..6c75492991 100644 Binary files a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png and b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_DisassemblyAfterLaunch.png differ diff --git a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_ToolWSpecimen.png b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_ToolWSpecimen.png index a5482ea5f6..8f59dccc5f 100644 Binary files a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_ToolWSpecimen.png and b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_ToolWSpecimen.png differ