From ceb7897320162a4cdb2e46cd389fc903277e8ef0 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Mon, 7 Jan 2019 22:42:52 -0800 Subject: [PATCH] [LibOS] use struct debug_buf instead of void * in shim_tcb_t Signed-off-by: Isaku Yamahata --- LibOS/shim/include/shim_tls.h | 4 +++- LibOS/shim/src/utils/printf.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/LibOS/shim/include/shim_tls.h b/LibOS/shim/include/shim_tls.h index dd65c85b..061f11b2 100644 --- a/LibOS/shim/include/shim_tls.h +++ b/LibOS/shim/include/shim_tls.h @@ -57,6 +57,8 @@ struct shim_context { #endif /* IN_SHIM */ +struct debug_buf; + typedef struct { uint64_t canary; void * self; @@ -64,7 +66,7 @@ typedef struct { struct shim_context context; unsigned int tid; int pal_errno; - void * debug_buf; + struct debug_buf * debug_buf; /* This record is for testing the memory of user inputs. * If a segfault occurs with the range [start, end], diff --git a/LibOS/shim/src/utils/printf.c b/LibOS/shim/src/utils/printf.c index 929c1ce3..ab3689d0 100644 --- a/LibOS/shim/src/utils/printf.c +++ b/LibOS/shim/src/utils/printf.c @@ -78,7 +78,7 @@ debug_fputch (void * f, int ch, void * b) void debug_puts (const char * str) { int len = strlen(str); - struct debug_buf * buf = (struct debug_buf *) SHIM_GET_TLS()->debug_buf; + struct debug_buf * buf = SHIM_GET_TLS()->debug_buf; while (len) { int rem = DEBUGBUF_SIZE - 4 - buf->end; @@ -131,7 +131,7 @@ void debug_setprefix (shim_tcb_t * tcb) if (!debug_handle) return; - struct debug_buf * buf = (struct debug_buf *) tcb->debug_buf; + struct debug_buf * buf = tcb->debug_buf; buf->start = buf->end = 0; if (tcb->tid && !IS_INTERNAL_TID(tcb->tid))