Skip to content

Commit 135e713

Browse files
committed
Rename show command to info
1 parent 83da808 commit 135e713

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

qiling/debugger/qdb/qdb.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def __set_temp(obj: object, member: str, value: Any):
476476
if has_member:
477477
setattr(obj, member, orig)
478478

479-
def __show_args(self, args: str):
479+
def __info_args(self, args: str):
480480
argc, *_ = args.split() if args else ('',)
481481
argc = try_read_int(argc)
482482

@@ -545,7 +545,7 @@ def __show_args(self, args: str):
545545

546546
qdb_print(QDB_MSG.INFO, f'arg{i}: {a:#0{nibbles + 2}x}{f" {RARROW} {deref_str}" if deref_str else ""}')
547547

548-
def __show_breakpoints(self, args: str):
548+
def __info_breakpoints(self, args: str):
549549
if self.bp_list:
550550
qdb_print(QDB_MSG.INFO, f'{"id":2s} {"address":10s} {"enabled"}')
551551

@@ -556,7 +556,7 @@ def __show_breakpoints(self, args: str):
556556
else:
557557
qdb_print(QDB_MSG.INFO, 'No breakpoints')
558558

559-
def __show_mem(self, kw: str):
559+
def __info_mem(self, kw: str):
560560
info_lines = iter(self.ql.mem.get_formatted_mapinfo())
561561

562562
# print filed name first
@@ -568,7 +568,7 @@ def __show_mem(self, kw: str):
568568
for line in lines:
569569
qdb_print(QDB_MSG.INFO, line)
570570

571-
def __show_marks(self, args: str):
571+
def __info_marks(self, args: str):
572572
"""Show marked symbols.
573573
"""
574574

@@ -581,7 +581,7 @@ def __show_marks(self, args: str):
581581
else:
582582
qdb_print(QDB_MSG.INFO, 'No marked symbols')
583583

584-
def __show_snapshot(self, args: str):
584+
def __info_snapshot(self, args: str):
585585
if self.rr:
586586
if self.rr.layers:
587587
recent = self.rr.layers[-1]
@@ -623,15 +623,14 @@ def __show_snapshot(self, args: str):
623623
else:
624624
qdb_print(QDB_MSG.INFO, 'Snapshots were not enabled for this session')
625625

626-
def __show_entry(self, args: str):
626+
def __info_entry(self, args: str):
627627
qdb_print(QDB_MSG.INFO, f'{"Entry point":16s}: {self.ql.loader.entry_point:#010x}')
628628

629629
if hasattr(self.ql.loader, 'elf_entry'):
630630
qdb_print(QDB_MSG.INFO, f'{"ELF entry point":16s}: {self.ql.loader.elf_entry:#010x}')
631631

632-
def do_show(self, args: str) -> None:
633-
"""
634-
show some runtime information
632+
def do_info(self, args: str) -> None:
633+
"""Provide run-time information.
635634
"""
636635

637636
subcmd, *a = args.split(maxsplit=1) if args else ('',)
@@ -640,17 +639,20 @@ def do_show(self, args: str) -> None:
640639
a = ['']
641640

642641
handlers = {
643-
'args': self.__show_args,
644-
'breakpoints': self.__show_breakpoints,
645-
'mem': self.__show_mem,
646-
'marks': self.__show_marks,
647-
'snapshot': self.__show_snapshot,
648-
'entry': self.__show_entry
642+
'args': self.__info_args,
643+
'breakpoints': self.__info_breakpoints,
644+
'mem': self.__info_mem,
645+
'marks': self.__info_marks,
646+
'snapshot': self.__info_snapshot,
647+
'entry': self.__info_entry
649648
}
650649

651650
if subcmd in handlers:
652651
handlers[subcmd](*a)
653652

653+
else:
654+
qdb_print(QDB_MSG.ERROR, f'info subcommands: {list(handlers.keys())}')
655+
654656
def do_script(self, filename: str) -> None:
655657
"""
656658
usage: script [filename]

tests/qdb_scripts/arm.qdb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ x/8xw $sp
1414
c
1515

1616
# show argument passed to puts
17-
show args 1
17+
info args 1
1818

1919
# show instructions passed call till end of function
2020
x/4i ($pc + 4)
@@ -23,7 +23,7 @@ x/4i ($pc + 4)
2323
n
2424

2525
# show snapshot diff
26-
show snapshot
26+
info snapshot
2727

2828
# step backwards to start of main
2929
p

tests/qdb_scripts/arm_static.qdb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ x/8xw $sp
1414
c
1515

1616
# show argument passed to puts
17-
show args 1
17+
info args 1
1818

1919
# show instructions passed call till end of function
2020
x/3i ($pc + 4)
@@ -23,7 +23,7 @@ x/3i ($pc + 4)
2323
n
2424

2525
# show snapshot diff
26-
show snapshot
26+
info snapshot
2727

2828
# step backwards to start of main
2929
p

tests/qdb_scripts/mips32el.qdb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ x/8xw $sp
1414
c
1515

1616
# show argument passed to puts
17-
show args 1
17+
info args 1
1818

1919
# show instructions passed call till end of function
2020
x/5i ($pc + 4)
@@ -23,7 +23,7 @@ x/5i ($pc + 4)
2323
n
2424

2525
# show snapshot diff
26-
show snapshot
26+
info snapshot
2727

2828
# step backwards to start of main
2929
p

tests/qdb_scripts/x86.qdb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ x/8xw $esp
1414
c
1515

1616
# show argument passed to printf
17-
show args 1
17+
info args 1
1818

1919
# show instructions passed call till end of function
2020
x/8i ($eip + 5)
@@ -23,7 +23,7 @@ x/8i ($eip + 5)
2323
n
2424

2525
# show snapshot diff
26-
show snapshot
26+
info snapshot
2727

2828
# step backwards to start of main
2929
p

0 commit comments

Comments
 (0)