mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
e63d97b112
3 changed files with 13 additions and 4 deletions
|
@ -760,9 +760,11 @@ public class CodeBrowserClipboardProvider extends ByteCopier
|
||||||
CommentFieldLocation commentFieldLocation = (CommentFieldLocation) currentLocation;
|
CommentFieldLocation commentFieldLocation = (CommentFieldLocation) currentLocation;
|
||||||
Address address = commentFieldLocation.getAddress();
|
Address address = commentFieldLocation.getAddress();
|
||||||
CommentType commentType = commentFieldLocation.getCommentType();
|
CommentType commentType = commentFieldLocation.getCommentType();
|
||||||
|
if (commentType != null) {
|
||||||
SetCommentCmd cmd = new SetCommentCmd(address, commentType, string);
|
SetCommentCmd cmd = new SetCommentCmd(address, commentType, string);
|
||||||
return tool.execute(cmd, currentProgram);
|
return tool.execute(cmd, currentProgram);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,6 +255,9 @@ public class CommentsPlugin extends Plugin implements OptionsChangeListener {
|
||||||
|
|
||||||
CommentFieldLocation cfLoc = (CommentFieldLocation) loc;
|
CommentFieldLocation cfLoc = (CommentFieldLocation) loc;
|
||||||
CommentType type = cfLoc.getCommentType();
|
CommentType type = cfLoc.getCommentType();
|
||||||
|
if (type == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case PRE:
|
case PRE:
|
||||||
action.getPopupMenuData()
|
action.getPopupMenuData()
|
||||||
|
|
|
@ -26,13 +26,17 @@ public class CommentTypeUtils {
|
||||||
* @param cu
|
* @param cu
|
||||||
* @param loc
|
* @param loc
|
||||||
* @param defaultCommentType
|
* @param defaultCommentType
|
||||||
* @return comment type
|
* @return comment type or defaultCommentType if location does not correspond
|
||||||
|
* to a comment
|
||||||
*/
|
*/
|
||||||
public static CommentType getCommentType(CodeUnit cu, ProgramLocation loc,
|
public static CommentType getCommentType(CodeUnit cu, ProgramLocation loc,
|
||||||
CommentType defaultCommentType) {
|
CommentType defaultCommentType) {
|
||||||
if (loc instanceof CommentFieldLocation) {
|
if (loc instanceof CommentFieldLocation) {
|
||||||
CommentFieldLocation cfLoc = (CommentFieldLocation) loc;
|
CommentFieldLocation cfLoc = (CommentFieldLocation) loc;
|
||||||
return cfLoc.getCommentType();
|
CommentType type = cfLoc.getCommentType();
|
||||||
|
if (type != null) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (loc instanceof PlateFieldLocation) {
|
else if (loc instanceof PlateFieldLocation) {
|
||||||
return CommentType.PLATE;
|
return CommentType.PLATE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue