Skip to content

Commit eddb96a

Browse files
committed
Fix read and write log output
1 parent 7cbc6b8 commit eddb96a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

qiling/os/posix/syscall/uio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def ql_syscall_writev(ql: Qiling, fd: int, vec: int, vlen: int):
1717
regreturn += l
1818

1919
buf = ql.mem.read(addr, l)
20-
ql.log.debug(buf)
20+
ql.log.debug(f'{buf.decode()!r}')
2121

2222
if hasattr(ql.os.fd[fd], 'write'):
2323
ql.os.fd[fd].write(buf)
@@ -38,7 +38,7 @@ def ql_syscall_readv(ql: Qiling, fd: int, vec: int, vlen: int):
3838

3939
if hasattr(ql.os.fd[fd], 'read'):
4040
data = ql.os.fd[fd].read(l)
41-
ql.log.debug(data)
41+
ql.log.debug(f'{data.decode()!r}')
4242
ql.mem.write(addr, data)
4343

4444
return regreturn

qiling/os/posix/syscall/unistd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def ql_syscall_read(ql: Qiling, fd, buf: int, length: int):
248248
data = ql.os.fd[fd].read(length)
249249
ql.mem.write(buf, data)
250250

251-
ql.log.debug(f'read() CONTENT: {repr(data.decode())}')
251+
ql.log.debug(f'read() CONTENT: {data.decode()!r}')
252252
regreturn = len(data)
253253
except:
254254
regreturn = -EBADF
@@ -263,7 +263,7 @@ def ql_syscall_write(ql: Qiling, fd: int, buf: int, count: int):
263263
data = ql.mem.read(buf, count)
264264

265265
if data:
266-
ql.log.debug(f'write() CONTENT: {repr(data.decode())}')
266+
ql.log.debug(f'write() CONTENT: {data.decode()!r}')
267267

268268
if hasattr(ql.os.fd[fd], 'write'):
269269
ql.os.fd[fd].write(data)

0 commit comments

Comments
 (0)