An implementation of CommentDatabase backed by a Ghidra client.
More...
#include <comment_ghidra.hh>
An implementation of CommentDatabase backed by a Ghidra client.
Comment information about particular functions is obtained by querying a Ghidra client. All comments for a single function are queried at once, and results are cached in this object. The cache needs to be cleared between functions using the clear() method.
◆ addComment()
void CommentDatabaseGhidra::addComment |
( |
uint4 |
tp, |
|
|
const Address & |
fad, |
|
|
const Address & |
ad, |
|
|
const string & |
txt |
|
) |
| |
|
virtual |
For the Ghidra implementation of CommentDatabase, addComment() is currently only called by the warning routines which generates the warning and warningheader comment types. Neither of these types is intended to be a permanent comment in the database, so we only add the comment to the cache
Implements CommentDatabase.
◆ addCommentNoDuplicate()
bool CommentDatabaseGhidra::addCommentNoDuplicate |
( |
uint4 |
tp, |
|
|
const Address & |
fad, |
|
|
const Address & |
ad, |
|
|
const string & |
txt |
|
) |
| |
|
virtual |
Add a new comment to the container, making sure there is no duplicate.
If there is already a comment at the same address with the same body, no new comment is added.
- Parameters
-
tp | is a set of properties to associate with the new comment (may be zero) |
fad | is the address of the function to which the comment belongs |
ad | is the address to which the comment is attached |
txt | is the body of the comment |
- Returns
- true if a new Comment was created, false if there was a duplicate
Implements CommentDatabase.
◆ beginComment()
CommentSet::const_iterator CommentDatabaseGhidra::beginComment |
( |
const Address & |
fad | ) |
const |
|
virtual |
Get an iterator to the beginning of comments for a single function.
- Parameters
-
fad | is the address of the function |
- Returns
- the beginning iterator
Implements CommentDatabase.
◆ clearType()
virtual void CommentDatabaseGhidra::clearType |
( |
const Address & |
fad, |
|
|
uint4 |
tp |
|
) |
| |
|
inlinevirtual |
Clear all comments matching (one of) the indicated types.
Clearing is restricted to comments belonging to a specific function and matching at least one of the given properties
- Parameters
-
fad | is the address of the owning function |
tp | is a set of one or more properties |
Implements CommentDatabase.
◆ deleteComment()
virtual void CommentDatabaseGhidra::deleteComment |
( |
Comment * |
com | ) |
|
|
inlinevirtual |
◆ endComment()
CommentSet::const_iterator CommentDatabaseGhidra::endComment |
( |
const Address & |
fad | ) |
const |
|
virtual |
Get an iterator to the ending of comments for a single function.
- Parameters
-
fad | is the address of the function |
- Returns
- the ending iterator
Implements CommentDatabase.
◆ restoreXml()
Restore all comments from XML.
- Parameters
-
el | is the root <commentdb> element |
manage | is a manager for resolving address space references |
Implements CommentDatabase.
◆ saveXml()
virtual void CommentDatabaseGhidra::saveXml |
( |
ostream & |
s | ) |
const |
|
inlinevirtual |
Save all comments in the container to an XML stream.
Writes a <commentdb> tag, with <comment> sub-tags for each Comment object.
- Parameters
-
Implements CommentDatabase.
The documentation for this class was generated from the following files: