use of com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier in project binnavi by google.
the class CLineGrayer method grayLine.
/**
* Grays or ungrays a line in a code node.
*
* @param model The model of the graph the node belongs to.
* @param node The node where the user clicked.
* @param codeNode The node that provides the raw data for the node.
* @param y The y location where the user clicked.
*/
private void grayLine(final CGraphModel model, final NaviNode node, final INaviCodeNode codeNode, final double y) {
final double yPos = y - node.getY();
final int row = node.positionToRow(yPos);
final INaviInstruction instruction = CCodeNodeHelpers.lineToInstruction(codeNode, row);
if (instruction == null) {
return;
}
if (m_grayedInstructions.contains(instruction)) {
final Pair<String, List<CStyleRunData>> content = ZyInstructionBuilder.buildInstructionLine(instruction, model.getGraph().getSettings(), new CDefaultModifier(model.getGraph().getSettings(), model.getDebuggerProvider()));
for (final CStyleRunData style : content.second()) {
node.setColor(row, style.getStart(), style.getLength(), style.getColor());
}
m_grayedInstructions.remove(instruction);
} else {
node.setColor(row, Color.LIGHT_GRAY);
m_grayedInstructions.add(instruction);
}
}
use of com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier in project binnavi by google.
the class InstructionNode method toString.
@Override
public String toString() {
final ZyGraphViewSettings settings = new ZyGraphViewSettings(new GraphSettingsConfigItem());
final DebuggerProvider provider = new DebuggerProvider(new ModuleTargetSettings(instruction.getModule()));
return ZyInstructionBuilder.buildInstructionLine(instruction, settings, new CDefaultModifier(settings, provider)).first();
}
use of com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier in project binnavi by google.
the class CCommentUtilities method createInstructionLine.
/**
* TODO (timkornau): either comment function or find a nicer way to generate a pretty printed
* instruction line which does not depend on the graph model.
*/
public static String createInstructionLine(final INaviInstruction instruction, final CGraphModel graphModel) {
final ZyGraphViewSettings graphSettings = graphModel.getGraph().getSettings();
final BackEndDebuggerProvider provider = graphModel.getDebuggerProvider();
final INodeModifier modifier = new CDefaultModifier(graphSettings, provider);
return ZyInstructionBuilder.buildInstructionLine(instruction, graphSettings, modifier).first();
}
Aggregations