Skip to content

Commit 6e2213e

Browse files
committed
Refactor the output of syscall
1 parent c67c538 commit 6e2213e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qiling/os/posix/posix.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ def load_syscall(self):
243243
raise e
244244

245245
# print out log entry
246-
syscall_basename = syscall_name[len(SYSCALL_PREF):]
246+
syscall_basename = syscall_name[len(SYSCALL_PREF) if syscall_name.startswith(SYSCALL_PREF) else 0:]
247+
247248
args = []
248249

249250
for name, value in zip(param_names, params):
@@ -253,7 +254,7 @@ def load_syscall(self):
253254

254255
args.append((name, f'{value:#x}'))
255256

256-
sret = retval and QlOsPosix.getNameFromErrorCode(retval)
257+
sret = QlOsPosix.getNameFromErrorCode(retval)
257258
self.utils.print_function(self.ql.reg.arch_pc, syscall_basename, args, sret, False)
258259

259260
# record syscall statistics

0 commit comments

Comments
 (0)