Skip to content

Commit 7fc02da

Browse files
committed
fix counts for show_args
1 parent d9a92e4 commit 7fc02da

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

qiling/debugger/qdb/qdb.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,10 @@ def do_show_args(self, argc: int = -1):
449449
if argc == -1:
450450
reg_n, stk_n = 2, 0
451451
else:
452-
reg_n, stk_n = 4, 0
453452
if argc > 4:
454453
stk_n = argc - 4
454+
elif argc <= 4:
455+
reg_n, stk_n = argc, 0
455456

456457
ptr_size = self.ql.arch.pointersize
457458

@@ -482,11 +483,6 @@ def do_show_args(self, argc: int = -1):
482483
reg_names = [f'r{d}'for d in range(reg_n)]
483484

484485
elif arch_type == QL_ARCH.X8664:
485-
if argc == -1:
486-
reg_n = 2
487-
else:
488-
reg_n = argc
489-
490486
reg_names = ('rdi', 'rsi', 'rdx', 'rcx', 'r8', 'r9')[:reg_n]
491487

492488
reg_args = [self.ql.arch.regs.read(reg_name) for reg_name in reg_names]

0 commit comments

Comments
 (0)