Skip to content

Commit

Permalink
[name-break] using new argparsing (issue #661)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Jun 23, 2021
1 parent c5644b1 commit 9ffe5cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gef.py
Expand Up @@ -7605,16 +7605,16 @@ def __init__(self, *args, **kwargs):
super().__init__()
return

def do_invoke(self, argv):
if not argv:
@parse_arguments({"name": "", "location": ""}, {})
def do_invoke(self, argv, *args, **kwargs):
args = kwargs["arguments"]
if not args.name:
err("Missing name for breakpoint")
self.usage()
return

name = argv[0]
location = argv[1] if len(argv) > 1 else "*{}".format(hex(current_arch.pc))

NamedBreakpoint(location, name)
location = args.location or "*{:#x}".format(current_arch.pc)
NamedBreakpoint(location, args.name)
return


Expand Down

0 comments on commit 9ffe5cd

Please sign in to comment.