aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-06-05 16:56:17 +0200
committerAlice Frosi <afrosi@redhat.com>2023-06-05 16:56:17 +0200
commit86d22d8b4d075e756284a35323768be8a7ac3762 (patch)
treeb84e5ebac3056bebfc547775e6a4dd274e38e2e2
parent3b9f21c6c3f06fd5049aa43f116906417d92e11f (diff)
downloadseitan-86d22d8b4d075e756284a35323768be8a7ac3762.tar
seitan-86d22d8b4d075e756284a35323768be8a7ac3762.tar.gz
seitan-86d22d8b4d075e756284a35323768be8a7ac3762.tar.bz2
seitan-86d22d8b4d075e756284a35323768be8a7ac3762.tar.lz
seitan-86d22d8b4d075e756284a35323768be8a7ac3762.tar.xz
seitan-86d22d8b4d075e756284a35323768be8a7ac3762.tar.zst
seitan-86d22d8b4d075e756284a35323768be8a7ac3762.zip
seitan: add debug message for op_load/op_cmp
-rw-r--r--operations.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/operations.c b/operations.c
index 734bc60..ba9820b 100644
--- a/operations.c
+++ b/operations.c
@@ -228,7 +228,9 @@ int op_load(const struct seccomp_notif *req, int notifier, struct gluten *g,
char path[PATH_MAX];
int fd, ret = 0;
- debug(" op_load: argument %d in %d", load->src.offset, load->dst.offset);
+ debug(" op_load: argument (%s %d) in (%s %d) size=%d",
+ gluten_offset_name[load->src.type], load->src.offset,
+ gluten_offset_name[load->dst.type], load->dst.offset, load->size);
if(dst == NULL)
ret_err(-1, " op_load: empty destination");
@@ -361,16 +363,19 @@ int op_cmp(const struct seccomp_notif *req, int notifier, struct gluten *g,
!check_gluten_limits(op->y, op->size))
return -1;
+ debug(" op_cmp: operands x=(%s %d) y=(%s %d) size=%d",
+ gluten_offset_name[op->x.type], op->x.offset,
+ gluten_offset_name[op->y.type], op->y.offset, op->size);
res = memcmp(px, py, op->size);
-
if ((res == 0 && (cmp == CMP_EQ || cmp == CMP_LE || cmp == CMP_GE)) ||
(res < 0 && (cmp == CMP_LT || cmp == CMP_LE)) ||
(res > 0 && (cmp == CMP_GT || cmp == CMP_GE)) ||
(res != 0 && (cmp == CMP_NE))) {
- debug(" op_cmp: successful comparison");
- debug(" op_cmp: jump to %d", op->jmp.offset);
+ debug(" op_cmp: successful comparison jump to %d",
+ op->jmp.offset);
return op->jmp.offset;
}
+ debug(" op_cmp: comparison is false");
return 0;
}