Skip to content

Commit 4b3a908

Browse files
committed
Add operand append function for frames.
1 parent 036ef5e commit 4b3a908

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

contrib/plugins/bap-tracing/frame.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,21 @@ Frame *frame_new_std(uint64_t addr, int vcpu_id) {
2222
sframe->operand_post_list = ol_out;
2323
return frame;
2424
}
25+
26+
void frame_add_operand(Frame *frame, OperandInfo *oi, bool is_post) {
27+
OperandValueList *ol;
28+
if (is_post) {
29+
ol = frame->std_frame->operand_post_list;
30+
} else {
31+
ol = frame->std_frame->operand_pre_list;
32+
}
33+
34+
oi->taint_info = g_new(TaintInfo, 1);
35+
taint_info__init(oi->taint_info);
36+
oi->taint_info->no_taint = 1;
37+
oi->taint_info->has_no_taint = 1;
38+
39+
ol->n_elem += 1;
40+
ol->elem = g_renew(OperandInfo *, ol->elem, ol->n_elem);
41+
ol->elem[ol->n_elem - 1] = oi;
42+
}

contrib/plugins/bap-tracing/tracing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ Frame **frame_buffer_flush(FrameBuffer *buf, size_t *fbuf_size);
6161
*/
6262
Frame *frame_new_std(uint64_t addr, int vcpu_id);
6363

64+
void frame_add_operand(Frame *frame, OperandInfo *oi, bool is_out);
65+
6466
#endif

0 commit comments

Comments
 (0)