IDA SDK
Functions
Segment comments

Detailed Description

Segment comments are rarely used yet.

The user may define a segment comment by pressing ':' while standing on the segment name at the segment start.

The main advantage of segment comments compared to anterior lines (see lines.hpp) is that they are attached to a segment, not to an address and they will move with the start of segment if the segment boundaries change.

You may set segment comments in your LDR module to describe characteristics of a segment in comments.

Repeatable segment comments are not used at all, because I don't know where they should be repeated.

Functions

idaman ssize_t ida_export get_segment_cmt (qstring *buf, const segment_t *s, bool repeatable)
 Get segment comment. More...
 
idaman void ida_export set_segment_cmt (const segment_t *s, const char *cmt, bool repeatable)
 Set segment comment. More...
 
idaman void ida_export std_out_segm_footer (struct outctx_t &ctx, segment_t *seg)
 Generate segment footer line as a comment line. More...
 

Function Documentation

idaman ssize_t ida_export get_segment_cmt ( qstring buf,
const segment_t s,
bool  repeatable 
)

Get segment comment.

Parameters
bufbuffer for the comment
spointer to segment structure
repeatable0: get regular comment. 1: get repeatable comment.
Returns
size of comment or -1
idaman void ida_export set_segment_cmt ( const segment_t s,
const char *  cmt,
bool  repeatable 
)

Set segment comment.

Parameters
spointer to segment structure
cmtcomment string, may be multiline (with '
'). maximal size is 4096 bytes. Use empty str ("") to delete comment
repeatable0: set regular comment. 1: set repeatable comment.
idaman void ida_export std_out_segm_footer ( struct outctx_t ctx,
segment_t seg 
)

Generate segment footer line as a comment line.

This function may be used in IDP modules to generate segment footer if the target assembler doesn't have 'ends' directive.