use of com.google.security.zynamics.binnavi.disassembly.CCodeNodeComments in project binnavi by google.
the class LocalInstructionCommentAccessor method getAllComments.
@Override
public ArrayList<Pair<INaviInstruction, IComment>> getAllComments() {
final ArrayList<Pair<INaviInstruction, IComment>> values = new ArrayList<>();
final CCodeNodeComments currentComments = m_codeNode.getComments();
for (final INaviInstruction instruction : m_codeNode.getInstructions()) {
final List<IComment> comments = currentComments.getLocalInstructionComment(instruction);
if ((comments == null) || comments.isEmpty()) {
values.add(new Pair<INaviInstruction, IComment>(instruction, new EmptyComment()));
continue;
} else {
for (final IComment comment : comments) {
values.add(new Pair<INaviInstruction, IComment>(instruction, comment));
}
values.add(new Pair<INaviInstruction, IComment>(instruction, new EmptyComment()));
}
}
return values;
}
use of com.google.security.zynamics.binnavi.disassembly.CCodeNodeComments in project binnavi by google.
the class CCommentUtilities method getLocalInstructionComments.
/**
* TODO (timkornau): either comment the function or find a better way on how the commenting for
* instructions can access all comments.
*/
public static List<Pair<INaviInstruction, IComment>> getLocalInstructionComments(final CCodeNode codeNode) {
Preconditions.checkNotNull(codeNode, "IE02633: codeNode argument can not be null");
final List<Pair<INaviInstruction, IComment>> values = new ArrayList<Pair<INaviInstruction, IComment>>();
final CCodeNodeComments currentComments = codeNode.getComments();
for (final INaviInstruction instruction : codeNode.getInstructions()) {
final List<IComment> comments = currentComments.getLocalInstructionComment(instruction);
if ((comments == null) || comments.isEmpty()) {
values.add(new Pair<INaviInstruction, IComment>(instruction, null));
continue;
} else {
for (final IComment comment : comments) {
values.add(new Pair<INaviInstruction, IComment>(instruction, comment));
}
}
}
return values;
}
Aggregations