-
-
Notifications
You must be signed in to change notification settings - Fork 808
Closed
Description
GEF+GDB version
GEF: rev:0fd751ec151952c4efbdcb5b2107b19b49256239 (Git - dirty)
SHA256(/opt/gef/gef.py): 6ce67338f7dfc572534023e3e11d267743fbfe6f225a7f5c212d6ae100ea1f29
GDB: 13.1
GDB-Python: 3.11Operating System
Manjaro Linux
Describe the issue you encountered
Creating a custom command following the documentation works but gives us a register_external_command' is deprecated and will be removed in a feature release. Use register(), and inherit from GenericCommand instead warning.
Trying to use register() does not seems to works properly.
Do you read the docs and look at previously closed issues/PRs for similar cases?
Yes
Architecture impacted
- X86
- X64
- ARM
- ARM64
- MIPS
- MIPS64
- PPC
- PPC64
- RISCV
Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.
Add this to gef.py:
@register
class Test(GenericCommand):
"""Test cmd."""
_cmdline_ = "test"
_syntax_ = f"{_cmdline_}"
@only_if_gdb_running
def do_invoke(self, argv):
print("plop")
returnStart gdb and try the new test command:
gef➤ test
Undefined command: "test". Try "help".
gef➤ test
Undefined command: "test". Try "help".
gef➤ pi Test()
<__main__.Test object at 0x7fc2f7f74780>
gef➤ test
plop
The expected behavior would be that test returns plop on the first instance
Minimalist test case
No response
Additional context?
Using register(Test) gives the same behavior
Reactions are currently unavailable