summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Le Fessant <fabrice.le_fessant@ocamlpro.com>2022-10-18 11:23:15 +0200
committerDmitry V. Levin <ldv@strace.io>2022-12-19 08:00:00 +0000
commit97e0315b35d5b1f4c22e1714096f3f6fe308c3f0 (patch)
tree74168f29b27603ff96818e00a96e7f2c5df7cae6
parent20f40cc466a3c9226dd7d729c9b20d61909f0a4a (diff)
downloadstrace-97e0315b35d5b1f4c22e1714096f3f6fe308c3f0.tar.gz
src: rename tprints to tprints_string
Co-authored-by: Dmitry V. Levin <ldv@strace.io>
-rw-r--r--src/defs.h2
-rw-r--r--src/ioctl.c6
-rw-r--r--src/ioprio.c4
-rw-r--r--src/mem.c2
-rw-r--r--src/memfd_create.c2
-rw-r--r--src/mmsghdr.c2
-rw-r--r--src/net.c2
-rw-r--r--src/numa.c2
-rw-r--r--src/prctl.c6
-rw-r--r--src/print_fields.h6
-rw-r--r--src/print_instruction_pointer.c6
-rw-r--r--src/print_mac.c8
-rw-r--r--src/print_timespec.h2
-rw-r--r--src/print_utils.h2
-rw-r--r--src/ptrace.c2
-rw-r--r--src/resource.c4
-rw-r--r--src/s390.c8
-rw-r--r--src/secontext.c2
-rw-r--r--src/sg_io_v3.c4
-rw-r--r--src/sg_io_v4.c2
-rw-r--r--src/signal.c12
-rw-r--r--src/sigreturn.c2
-rw-r--r--src/sock.c2
-rw-r--r--src/sockaddr.c12
-rw-r--r--src/strace.c18
-rw-r--r--src/syscall.c26
-rw-r--r--src/tee.c2
-rw-r--r--src/term.c2
-rw-r--r--src/unwind.c2
-rw-r--r--src/util.c12
-rw-r--r--src/wait.c2
-rw-r--r--src/xlat.c8
32 files changed, 87 insertions, 87 deletions
diff --git a/src/defs.h b/src/defs.h
index 3654a6bfd..b5c5d0968 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -1686,7 +1686,7 @@ extern void printleader(struct tcb *);
extern void line_ended(void);
extern void tabto(void);
extern void tprintf(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
-extern void tprints(const char *str);
+extern void tprints_string(const char *str);
extern void tprintf_comment(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
extern void tprints_comment(const char *str);
diff --git a/src/ioctl.c b/src/ioctl.c
index 33f0deca9..ac271970e 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -249,7 +249,7 @@ ioctl_decode_command_number(struct tcb *tcp)
switch (_IOC_TYPE(code)) {
case '!': /* 0x21 */
if (code == _IOC(_IOC_READ, '!', 2, sizeof(uint64_t))) {
- tprints("SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR");
+ tprints_string("SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR");
return 1;
}
return 0;
@@ -451,10 +451,10 @@ SYS_FUNC(ioctl)
if (iop) {
if (ret)
tprint_alternative_value();
- tprints(iop->symbol);
+ tprints_string(iop->symbol);
while ((iop = ioctl_next_match(iop))) {
tprint_alternative_value();
- tprints(iop->symbol);
+ tprints_string(iop->symbol);
}
} else if (!ret) {
ioctl_print_code(tcp->u_arg[1]);
diff --git a/src/ioprio.c b/src/ioprio.c
index 9b5786813..0d1b7e8de 100644
--- a/src/ioprio.c
+++ b/src/ioprio.c
@@ -46,7 +46,7 @@ print_ioprio(unsigned int ioprio)
const char *str = sprint_ioprio(ioprio);
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(str);
+ ? tprints_comment : tprints_string)(str);
}
static void
@@ -105,7 +105,7 @@ SYS_FUNC(ioprio_set)
return RVAL_DECODED;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(sprint_ioprio(tcp->u_arg[2]));
+ ? tprints_comment : tprints_string)(sprint_ioprio(tcp->u_arg[2]));
return RVAL_DECODED;
}
diff --git a/src/mem.c b/src/mem.c
index 38695a578..f98a25e2c 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -90,7 +90,7 @@ print_mmap_flags(kernel_ulong_t flags)
* print_xlat_u is not used here because the whole thing
* is potentially inside a comment already.
*/
- tprints("MAP_HUGE_SHIFT");
+ tprints_string("MAP_HUGE_SHIFT");
tprint_shift_end();
}
diff --git a/src/memfd_create.c b/src/memfd_create.c
index 8e9faeb0c..a4509a27d 100644
--- a/src/memfd_create.c
+++ b/src/memfd_create.c
@@ -52,7 +52,7 @@ SYS_FUNC(memfd_create)
* print_xlat_u is not used here because the whole thing
* is potentially inside a comment already.
*/
- tprints("MFD_HUGE_SHIFT");
+ tprints_string("MFD_HUGE_SHIFT");
tprint_shift_end();
}
diff --git a/src/mmsghdr.c b/src/mmsghdr.c
index 0e313678b..c4babc912 100644
--- a/src/mmsghdr.c
+++ b/src/mmsghdr.c
@@ -231,7 +231,7 @@ do_recvmmsg(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
tprint_arg_next();
/* timeout on entrance */
- tprints(*(const char **) get_tcb_priv_data(tcp));
+ tprints_string(*(const char **) get_tcb_priv_data(tcp));
}
if (syserror(tcp))
return 0;
diff --git a/src/net.c b/src/net.c
index a9a7c8c1c..01f1c34f8 100644
--- a/src/net.c
+++ b/src/net.c
@@ -785,7 +785,7 @@ print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len)
if (popcount32(&data32, 1) > sizeof(data32) * 8 / 2) {
/* show those bits that are NOT in the set */
data32 = ~data32;
- tprints("~");
+ tprints_string("~");
}
/* next_set_bit operates on current_wordsize words */
diff --git a/src/numa.c b/src/numa.c
index 32aee6245..3e7fb2984 100644
--- a/src/numa.c
+++ b/src/numa.c
@@ -96,7 +96,7 @@ print_mode(struct tcb *const tcp, const kernel_ulong_t mode_arg)
tprint_comment_begin();
tprint_flags_begin();
- tprints(mode_str);
+ tprints_string(mode_str);
tprint_flags_or();
printflags_ex(flags, NULL, XLAT_STYLE_ABBREV, mpol_mode_flags, NULL);
tprint_flags_end();
diff --git a/src/prctl.c b/src/prctl.c
index 97f42fe15..17e6073b8 100644
--- a/src/prctl.c
+++ b/src/prctl.c
@@ -286,7 +286,7 @@ SYS_FUNC(prctl)
case PR_SVE_SET_VL:
if (entering(tcp)) {
tprint_arg_next();
- tprints(sprint_sve_val(arg2, false));
+ tprints_string(sprint_sve_val(arg2, false));
return 0;
}
ATTRIBUTE_FALLTHROUGH;
@@ -327,7 +327,7 @@ SYS_FUNC(prctl)
case PR_SET_TAGGED_ADDR_CTRL:
tprint_arg_next();
- tprints(sprint_tagged_addr_val(arg2, false));
+ tprints_string(sprint_tagged_addr_val(arg2, false));
print_prctl_args(tcp, 2);
return RVAL_DECODED;
@@ -345,7 +345,7 @@ SYS_FUNC(prctl)
case PR_SME_SET_VL:
if (entering(tcp)) {
tprint_arg_next();
- tprints(sprint_sme_val(arg2, false));
+ tprints_string(sprint_sme_val(arg2, false));
return 0;
}
ATTRIBUTE_FALLTHROUGH;
diff --git a/src/print_fields.h b/src/print_fields.h
index 38a0f15c1..4e7b6cc28 100644
--- a/src/print_fields.h
+++ b/src/print_fields.h
@@ -13,7 +13,7 @@
# ifdef IN_STRACE
-# define STRACE_PRINTS(s_) tprints(s_)
+# define STRACE_PRINTS(s_) tprints_string(s_)
/*
* The printf-like function to use in header files
@@ -672,8 +672,8 @@ tprints_arg_begin(const char *name)
xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) \
tprint_comment_begin(); \
if (nr_prefix_) \
- tprints(nr_prefix_); \
- tprints(name); \
+ tprints_string(nr_prefix_); \
+ tprints_string(name); \
if (!nr_prefix_ || \
xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) \
tprint_comment_end(); \
diff --git a/src/print_instruction_pointer.c b/src/print_instruction_pointer.c
index 8aa906887..b818544de 100644
--- a/src/print_instruction_pointer.c
+++ b/src/print_instruction_pointer.c
@@ -18,9 +18,9 @@ print_instruction_pointer(struct tcb *tcp)
? "%08" PRI_klx
: "%016" PRI_klx, ip);
} else {
- tprints(current_wordsize == 4
- ? "????????"
- : "????????????????");
+ tprints_string(current_wordsize == 4
+ ? "????????"
+ : "????????????????");
}
tprint_attribute_end();
tprint_space();
diff --git a/src/print_mac.c b/src/print_mac.c
index 38a1f57e8..cad1013a8 100644
--- a/src/print_mac.c
+++ b/src/print_mac.c
@@ -114,7 +114,7 @@ sprint_mac_addr(const uint8_t addr[], size_t size)
void
print_mac_addr(const char *prefix, const uint8_t addr[], size_t size)
{
- tprints(prefix);
+ tprints_string(prefix);
if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV
|| size > MAX_ADDR_LEN)
print_quoted_string((const char *) addr, size,
@@ -123,7 +123,7 @@ print_mac_addr(const char *prefix, const uint8_t addr[], size_t size)
|| size > MAX_ADDR_LEN)
return;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(sprint_mac_addr(addr, size));
+ ? tprints_comment : tprints_string)(sprint_mac_addr(addr, size));
}
static const char *
@@ -139,7 +139,7 @@ void
print_hwaddr(const char *prefix, const uint8_t addr[], size_t size,
uint32_t devtype)
{
- tprints(prefix);
+ tprints_string(prefix);
if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV
|| size > MAX_ADDR_LEN)
print_quoted_string((const char *) addr, size,
@@ -148,6 +148,6 @@ print_hwaddr(const char *prefix, const uint8_t addr[], size_t size,
|| size > MAX_ADDR_LEN)
return;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(sprint_hwaddr(addr, size,
+ ? tprints_comment : tprints_string)(sprint_hwaddr(addr, size,
devtype));
}
diff --git a/src/print_timespec.h b/src/print_timespec.h
index 9603a6bb6..4fb847767 100644
--- a/src/print_timespec.h
+++ b/src/print_timespec.h
@@ -133,7 +133,7 @@ print_timespec_t_utime(struct tcb *tcp, void *elem_buf, size_t elem_size,
break;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(t->TIMESPEC_NSEC == UTIME_NOW
+ ? tprints_comment : tprints_string)(t->TIMESPEC_NSEC == UTIME_NOW
? "UTIME_NOW" : "UTIME_OMIT");
break;
default:
diff --git a/src/print_utils.h b/src/print_utils.h
index 8b899a3b2..9f7954209 100644
--- a/src/print_utils.h
+++ b/src/print_utils.h
@@ -105,7 +105,7 @@ sprint_char(char *buf, const unsigned char c, const enum sprint_char_flags f)
char buf[SPRINT_CHAR_BUFSZ]; \
\
sprint_char(buf, (c_), (flags_) | SCF_NUL); \
- tprints(buf); \
+ tprints_string(buf); \
} while (0)
#endif /* STRACE_PRINT_UTILS_H */
diff --git a/src/ptrace.c b/src/ptrace.c
index 1f47255d9..663a5f314 100644
--- a/src/ptrace.c
+++ b/src/ptrace.c
@@ -73,7 +73,7 @@ print_user_offset_addr(const kernel_ulong_t addr)
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
tprint_comment_begin();
- tprints(str);
+ tprints_string(str);
if (base_addr != addr) {
tprint_plus();
PRINT_VAL_U(addr - (kernel_ulong_t) base_addr);
diff --git a/src/resource.c b/src/resource.c
index 2dc683baa..0453ec1b2 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -36,7 +36,7 @@ print_rlim64_t(uint64_t lim) {
return;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(str);
+ ? tprints_comment : tprints_string)(str);
}
static void
@@ -78,7 +78,7 @@ print_rlim32_t(uint32_t lim) {
return;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(str);
+ ? tprints_comment : tprints_string)(str);
}
static void
diff --git a/src/s390.c b/src/s390.c
index 372c4dc3c..b36b94878 100644
--- a/src/s390.c
+++ b/src/s390.c
@@ -510,7 +510,7 @@ print_sthyi_machine(struct tcb *tcp, struct sthyi_machine *hdr, uint16_t size,
CHECK_SIZE_EX(hdr, last_decoded, size, "machine structure");
- tprints("/* machine */ ");
+ tprints_string("/* machine */ ");
tprint_struct_begin();
if (!abbrev(tcp)) {
if (hdr->infmflg1) { /* Reserved */
@@ -620,7 +620,7 @@ print_sthyi_partition(struct tcb *tcp, struct sthyi_partition *hdr,
*mt = !!(hdr->infpflg1 & 0x80);
- tprints("/* partition */ ");
+ tprints_string("/* partition */ ");
tprint_struct_begin();
PRINT_FIELD_0X(*hdr, infpflg1);
if (!abbrev(tcp) && hdr->infpflg1)
@@ -786,7 +786,7 @@ print_funcs(const uint8_t funcs[8])
continue;
if (cont) {
- tprints(", ");
+ tprints_string(", ");
} else {
tprint_comment_begin();
cont = true;
@@ -1132,7 +1132,7 @@ print_sthyi_buf(struct tcb *tcp, kernel_ulong_t ptr)
tprint_struct_begin();
/* Header */
- tprints("/* header */ ");
+ tprints_string("/* header */ ");
tprint_struct_begin();
PRINT_FIELD_0X(*hdr, infhflg1);
diff --git a/src/secontext.c b/src/secontext.c
index f12d224a7..1312d343b 100644
--- a/src/secontext.c
+++ b/src/secontext.c
@@ -227,7 +227,7 @@ print_context(char *secontext, char *expected)
ssize_t exp_len = parse_secontext(expected, &exp_str);
if (ctx_len != exp_len || strncmp(ctx_str, exp_str, ctx_len)) {
- tprints("!!");
+ tprints_string("!!");
print_quoted_string_ex(exp_str, exp_len, style, "[]!");
}
diff --git a/src/sg_io_v3.c b/src/sg_io_v3.c
index f37d6de05..13c6120c9 100644
--- a/src/sg_io_v3.c
+++ b/src/sg_io_v3.c
@@ -55,7 +55,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
tprint_struct_begin();
tprints_field_name("interface_id");
- tprints("'S'");
+ tprints_string("'S'");
tprint_struct_next();
if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid,
&sg_io.dxfer_direction)) {
@@ -168,7 +168,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
{
tprint_struct_begin();
tprints_field_name("interface_id");
- tprints("'S'");
+ tprints_string("'S'");
tprint_struct_next();
tprint_more_data_follows();
tprint_struct_end();
diff --git a/src/sg_io_v4.c b/src/sg_io_v4.c
index 5087860c8..37a89bf4e 100644
--- a/src/sg_io_v4.c
+++ b/src/sg_io_v4.c
@@ -38,7 +38,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
tprint_struct_begin();
tprints_field_name("guard");
- tprints("'Q'");
+ tprints_string("'Q'");
tprint_struct_next();
if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid,
&sg_io.protocol)) {
diff --git a/src/signal.c b/src/signal.c
index fc13a6613..56e8cb452 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -209,7 +209,7 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes)
sprintsigmask_n((prefix), &(mask), sizeof(mask))
#define tprintsigmask_val(mask) \
- tprints(sprintsigmask_n("", &(mask), sizeof(mask)))
+ tprints_string(sprintsigmask_n("", &(mask), sizeof(mask)))
static const char *
sprint_old_sigmask_val(const char *const prefix, const unsigned long mask)
@@ -229,7 +229,7 @@ sprint_old_sigmask_val(const char *const prefix, const unsigned long mask)
static void
tprint_old_sigmask_val(const unsigned long mask)
{
- tprints(sprint_old_sigmask_val("", mask));
+ tprints_string(sprint_old_sigmask_val("", mask));
}
void
@@ -242,7 +242,7 @@ printsignal(int nr)
if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
return;
(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
- ? tprints_comment : tprints)(str);
+ ? tprints_comment : tprints_string)(str);
}
static void
@@ -260,7 +260,7 @@ print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ulong_t addr,
int mask[NSIG_BYTES / sizeof(int)] = {};
if (umoven_or_printaddr(tcp, addr, len, mask))
return;
- tprints(sprintsigmask_n("", mask, len));
+ tprints_string(sprintsigmask_n("", mask, len));
}
void
@@ -362,7 +362,7 @@ SYS_FUNC(sigaction)
int signo = tcp->u_arg[0];
#if defined SPARC || defined SPARC64
if (signo < 0) {
- tprints("-");
+ tprints_string("-");
signo = -signo;
}
#endif
@@ -781,7 +781,7 @@ do_rt_sigtimedwait(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
tprint_arg_next();
/* timeout */
- tprints(get_tcb_priv_data(tcp));
+ tprints_string(get_tcb_priv_data(tcp));
tprint_arg_next();
/* sigsetsize */
diff --git a/src/sigreturn.c b/src/sigreturn.c
index 27cc84920..06ab15f8f 100644
--- a/src/sigreturn.c
+++ b/src/sigreturn.c
@@ -20,7 +20,7 @@ print_sigmask_addr_size(const void *const addr, const unsigned int size)
{
tprint_struct_begin();
tprints_field_name("mask");
- tprints(sprintsigmask_n("", addr, size));
+ tprints_string(sprintsigmask_n("", addr, size));
tprint_struct_end();
}
diff --git a/src/sock.c b/src/sock.c
index de14db981..5cfddf6cd 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -130,7 +130,7 @@ print_ifc_len(int len)
if (len > 0 && n * sizeof(struct_ifreq) == (unsigned int) len) {
tprint_comment_begin();
PRINT_VAL_U(n);
- tprints(" * sizeof(struct ifreq)");
+ tprints_string(" * sizeof(struct ifreq)");
tprint_comment_end();
}
diff --git a/src/sockaddr.c b/src/sockaddr.c
index a8769082e..794217cbd 100644
--- a/src/sockaddr.c
+++ b/src/sockaddr.c
@@ -119,7 +119,7 @@ print_sockaddr_data_un(struct tcb *tcp, const void *const buf, const int addrlen
QUOTE_0_TERMINATED);
selinux_printfilecon(tcp, sa_un->sun_path);
} else {
- tprints("@");
+ tprints_string("@");
print_quoted_string(sa_un->sun_path + 1, path_len - 1, 0);
}
}
@@ -402,7 +402,7 @@ print_ax25_addr(const void /* ax25_address */ *addr_void)
const char *addr_str = ax25_addr2str(addr);
- (xs == XLAT_STYLE_VERBOSE ? tprints_comment : tprints)(addr_str);
+ (xs == XLAT_STYLE_VERBOSE ? tprints_comment : tprints_string)(addr_str);
}
static bool
@@ -617,7 +617,7 @@ print_bluetooth_l2_psm(uint16_t psm)
tprint_comment_begin();
if (psm_name) {
- tprints(psm_name);
+ tprints_string(psm_name);
} else if (psm_he >= L2CAP_PSM_LE_DYN_START
&& psm_he <= L2CAP_PSM_LE_DYN_END) {
print_xlat(L2CAP_PSM_LE_DYN_START);
@@ -628,7 +628,7 @@ print_bluetooth_l2_psm(uint16_t psm)
tprint_plus();
PRINT_VAL_U(psm_he - L2CAP_PSM_DYN_START);
} else {
- tprints("L2CAP_PSM_???");
+ tprints_string("L2CAP_PSM_???");
}
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !psm_str)
@@ -657,13 +657,13 @@ print_bluetooth_l2_cid(uint16_t cid)
tprint_comment_begin();
if (cid_name) {
- tprints(cid_name);
+ tprints_string(cid_name);
} else if (cid_he >= L2CAP_CID_DYN_START) {
print_xlat(L2CAP_CID_DYN_START);
tprint_plus();
PRINT_VAL_U(cid_he - L2CAP_CID_DYN_START);
} else {
- tprints("L2CAP_CID_???");
+ tprints_string("L2CAP_CID_???");
}
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !cid_str)
diff --git a/src/strace.c b/src/strace.c
index a35aed8eb..897189f87 100644
--- a/src/strace.c
+++ b/src/strace.c
@@ -727,7 +727,7 @@ tprintf(const char *fmt, ...)
#endif
void
-tprints(const char *str)
+tprints_string(const char *str)
{
if (current_tcp) {
int n = fputs_unlocked(str, current_tcp->outf);
@@ -822,7 +822,7 @@ printleader(struct tcb *tcp)
* didn't finish ("SIGKILL nuked us after syscall entry" etc).
*/
tprint_space();
- tprints("<unfinished ...>");
+ tprints_string("<unfinished ...>");
tprint_newline();
printing_tcp->curcol = 0;
}
@@ -891,7 +891,7 @@ printleader(struct tcb *tcp)
tprintf(".%0*ld",
rflag_width, (long) dts.tv_nsec / rflag_scale);
}
- tprints(tflag_format ? ") " : " ");
+ tprints_string(tflag_format ? ") " : " ");
}
if (nflag)
@@ -905,7 +905,7 @@ void
tabto(void)
{
if (current_tcp->curcol < acolumn)
- tprints(acolumn_spaces + current_tcp->curcol);
+ tprints_string(acolumn_spaces + current_tcp->curcol);
}
/* Should be only called directly *after successful attach* to a tracee.
@@ -3216,7 +3216,7 @@ print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig)
if (si) {
tprintf("--- %s ", sprintsigname(sig));
printsiginfo(tcp, si);
- tprints(" ---");
+ tprints_string(" ---");
} else
tprintf("--- stopped by %s ---", sprintsigname(sig));
tprint_newline();
@@ -3267,7 +3267,7 @@ print_event_exit(struct tcb *tcp)
&& printing_tcp->curcol != 0) {
set_current_tcp(printing_tcp);
tprint_space();
- tprints("<unfinished ...>");
+ tprints_string("<unfinished ...>");
tprint_newline();
flush_tcp_output(printing_tcp);
printing_tcp->curcol = 0;
@@ -3282,13 +3282,13 @@ print_event_exit(struct tcb *tcp)
* on exiting syscall which is not going to happen.
*/
tprint_space();
- tprints("<unfinished ...>");
+ tprints_string("<unfinished ...>");
}
printing_tcp = tcp;
- tprints(") ");
+ tprints_string(") ");
tabto();
- tprints("= ?");
+ tprints_string("= ?");
tprint_newline();
if (!is_complete_set(status_set, NUMBER_OF_STATUSES)) {
bool publish = is_number_in_set(STATUS_UNFINISHED, status_set);
diff --git a/src/syscall.c b/src/syscall.c
index 90c4fbd8a..3d195a20a 100644
--- a/src/syscall.c
+++ b/src/syscall.c
@@ -761,13 +761,13 @@ static void
print_injected_note(struct tcb *tcp)
{
if (syscall_tampered(tcp) && syscall_tampered_poked(tcp))
- tprints(" (INJECTED: args, retval)");
+ tprints_string(" (INJECTED: args, retval)");
else if (syscall_tampered_poked(tcp))
- tprints(" (INJECTED: args)");
+ tprints_string(" (INJECTED: args)");
else if (syscall_tampered(tcp))
- tprints(" (INJECTED)");
+ tprints_string(" (INJECTED)");
if (syscall_tampered_delayed(tcp))
- tprints(" (DELAYED)");
+ tprints_string(" (DELAYED)");
}
int
@@ -794,7 +794,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
tprint_arg_end();
tprint_space();
tabto();
- tprints("= ? <unavailable>");
+ tprints_string("= ? <unavailable>");
tprint_newline();
if (!is_complete_set(status_set, NUMBER_OF_STATUSES)) {
bool publish = is_number_in_set(STATUS_UNAVAILABLE,
@@ -862,13 +862,13 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
* The system call will be restarted with the same arguments
* if SA_RESTART is set; otherwise, it will fail with EINTR.
*/
- tprints("= ? ERESTARTSYS (To be restarted if SA_RESTART is set)");
+ tprints_string("= ? ERESTARTSYS (To be restarted if SA_RESTART is set)");
break;
case ERESTARTNOINTR:
/* Rare. For example, fork() returns this if interrupted.
* SA_RESTART is ignored (assumed set): the restart is unconditional.
*/
- tprints("= ? ERESTARTNOINTR (To be restarted)");
+ tprints_string("= ? ERESTARTNOINTR (To be restarted)");
break;
case ERESTARTNOHAND:
/* pause(), rt_sigsuspend() etc use this code.
@@ -878,7 +878,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
* after SIG_IGN or SIG_DFL signal it will restart
* (thus the name "restart only if has no handler").
*/
- tprints("= ? ERESTARTNOHAND (To be restarted if no handler)");
+ tprints_string("= ? ERESTARTNOHAND (To be restarted if no handler)");
break;
case ERESTART_RESTARTBLOCK:
/* Syscalls like nanosleep(), poll() which can't be
@@ -892,7 +892,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
* which in turn saves another such restart block,
* old data is lost and restart becomes impossible)
*/
- tprints("= ? ERESTART_RESTARTBLOCK (Interrupted by signal)");
+ tprints_string("= ? ERESTART_RESTARTBLOCK (Interrupted by signal)");
break;
default:
print_err_ret(tcp->u_rval, tcp->u_error);
@@ -903,7 +903,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
tprintf(" (%s)", tcp->auxstr);
} else {
if (sys_res & RVAL_NONE)
- tprints("= ?");
+ tprints_string("= ?");
else {
switch (sys_res & RVAL_MASK) {
case RVAL_HEX:
@@ -920,7 +920,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
case RVAL_OCTAL: {
unsigned long long mode =
zero_extend_signed_to_ull(tcp->u_rval);
- tprints("= ");
+ tprints_string("= ");
#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
if (current_klongsize < sizeof(tcp->u_rval))
mode = (unsigned int) mode;
@@ -946,7 +946,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
*/
if ((current_klongsize < sizeof(tcp->u_rval)) ||
((kernel_ulong_t) tcp->u_rval <= INT_MAX)) {
- tprints("= ");
+ tprints_string("= ");
printfd(tcp, tcp->u_rval);
} else {
tprintf("= %" PRI_kld, tcp->u_rval);
@@ -962,7 +962,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
};
#undef _
- tprints("= ");
+ tprints_string("= ");
printpid(tcp, tcp->u_rval,
types[(sys_res & RVAL_MASK) - RVAL_TID]);
break;
diff --git a/src/tee.c b/src/tee.c
index b1d135217..25f6e76c5 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -107,7 +107,7 @@ tee_print_param_fn(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data
"TEE_IOCTL_PARAM_ATTR_");
if (param->attr & TEE_IOCTL_PARAM_ATTR_META) {
tprint_flags_or();
- tprints("TEE_IOCTL_PARAM_ATTR_META");
+ tprints_string("TEE_IOCTL_PARAM_ATTR_META");
}
tprint_flags_end();
diff --git a/src/term.c b/src/term.c
index 1695a33a7..8b2501307 100644
--- a/src/term.c
+++ b/src/term.c
@@ -122,7 +122,7 @@ print_cc_char(bool *first, const unsigned char *data, const char *s,
tprint_array_index_begin();
if (s)
- tprints(s);
+ tprints_string(s);
else
PRINT_VAL_U(idx);
tprint_array_index_equal();
diff --git a/src/unwind.c b/src/unwind.c
index a1f9389d8..6e458d522 100644
--- a/src/unwind.c
+++ b/src/unwind.c
@@ -249,7 +249,7 @@ queue_print(struct unwind_queue_t *queue)
tmp = call;
call = call->next;
- tprints(tmp->output_line);
+ tprints_string(tmp->output_line);
line_ended();
if (tmp->output_line != asprintf_error_str)
diff --git a/src/util.c b/src/util.c
index 5c8cd62c2..14f4f92ad 100644
--- a/src/util.c
+++ b/src/util.c
@@ -564,7 +564,7 @@ print_uuid(const unsigned char *uuid)
'\0'
};
- tprints(str);
+ tprints_string(str);
}
enum sock_proto
@@ -630,7 +630,7 @@ static void
print_string_in_angle_brackets(const char *str)
{
tprint_associated_info_begin();
- tprints(str);
+ tprints_string(str);
tprint_associated_info_end();
}
@@ -724,7 +724,7 @@ printpidfd(pid_t pid_of_fd, int fd, const char *path)
pid_t pid = pidfd_get_pid(pid_of_fd, fd);
if (pid > 0) {
tprint_associated_info_begin();
- tprints("pid:");
+ tprints_string("pid:");
/*
* The pid translation is not needed because
* the pid is in strace's namespace.
@@ -747,7 +747,7 @@ print_quoted_string_in_angle_brackets(const char *str, const bool deleted)
tprint_associated_info_end();
if (deleted)
- tprints("(deleted)");
+ tprints_string("(deleted)");
}
void
@@ -1065,7 +1065,7 @@ print_quoted_string_ex(const char *str, unsigned int size,
}
rc = string_quote(str, outstr, size, style, escape_chars);
- tprints(outstr);
+ tprints_string(outstr);
if (((style & (QUOTE_0_TERMINATED | QUOTE_EXPECT_TRAILING_0))
== (QUOTE_0_TERMINATED | QUOTE_EXPECT_TRAILING_0)) && rc) {
@@ -1218,7 +1218,7 @@ printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr,
&& ((style & (QUOTE_0_TERMINATED | QUOTE_EXPECT_TRAILING_0))
|| len > max_strlen);
- tprints(outstr);
+ tprints_string(outstr);
if (ellipsis)
tprint_more_data_follows();
diff --git a/src/wait.c b/src/wait.c
index 4c1715db8..69460faa8 100644
--- a/src/wait.c
+++ b/src/wait.c
@@ -52,7 +52,7 @@ printstatus(int status)
}
#ifdef WIFCONTINUED
else if (WIFCONTINUED(status)) {
- tprints("{WIFCONTINUED(s)}");
+ tprints_string("{WIFCONTINUED(s)}");
status &= ~W_CONTINUED;
}
#endif
diff --git a/src/xlat.c b/src/xlat.c
index 9844a2d52..5135ab440 100644
--- a/src/xlat.c
+++ b/src/xlat.c
@@ -47,7 +47,7 @@ sprint_xlat_val(uint64_t val, enum xlat_style style)
static void
print_xlat_val(uint64_t val, enum xlat_style style)
{
- tprints(sprint_xlat_val(val, style));
+ tprints_string(sprint_xlat_val(val, style));
}
static int
@@ -231,7 +231,7 @@ printxvals_ex(const uint64_t val, const char *dflt, enum xlat_style style,
print_xlat_val(val, style);
tprints_comment(str);
} else {
- tprints(str);
+ tprints_string(str);
}
goto printxvals_ex_end;
@@ -441,7 +441,7 @@ printflags_ex(uint64_t flags, const char *dflt, enum xlat_style style,
tprint_flags_or();
else if (need_comment)
tprint_comment_begin();
- tprints(xlat->data[idx].str);
+ tprints_string(xlat->data[idx].str);
flags &= ~v;
}
if (!flags)
@@ -486,7 +486,7 @@ print_xlat_ex(const uint64_t val, const char *str, uint32_t style)
print_xlat_val(val, style);
tprints_comment(str);
} else {
- tprints(str);
+ tprints_string(str);
}
break;
}