GP-5310 Created global search and replace feature

This commit is contained in:
ghidragon 2025-02-28 20:08:40 -05:00
parent cc1228bdaa
commit 6fb115358a
93 changed files with 7469 additions and 141 deletions

View file

@ -439,6 +439,13 @@ public abstract class AbstractDBTraceProgramViewListing implements TraceProgramV
return getCommentAddresses(addrSet).getAddresses(forward);
}
@Override
public long getCommentAddressCount() {
return program.viewport.unionedAddresses(
s -> program.trace.getCommentAdapter().getAddressSetView(Lifespan.at(s)))
.getNumAddresses();
}
@Override
public String getComment(int commentType, Address address) {
try (LockHold hold = program.trace.lockRead()) {
@ -447,6 +454,16 @@ public abstract class AbstractDBTraceProgramViewListing implements TraceProgramV
}
}
@Override
public CodeUnitComments getAllComments(Address address) {
CommentType[] types = CommentType.values();
String[] comments = new String[types.length];
for (CommentType type : types) {
comments[type.ordinal()] = getComment(type, address);
}
return new CodeUnitComments(comments);
}
@Override
public void setComment(Address address, int commentType, String comment) {
program.trace.getCommentAdapter()

View file

@ -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.
@ -249,4 +249,9 @@ public class DBTraceProgramViewFragment implements ProgramFragment {
public void move(Address min, Address max) throws NotFoundException {
throw new UnsupportedOperationException();
}
@Override
public boolean isDeleted() {
return false;
}
}

View file

@ -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.
@ -239,4 +239,9 @@ public class DBTraceProgramViewRootModule implements ProgramModule {
public long getTreeID() {
return 0;
}
@Override
public boolean isDeleted() {
return false;
}
}