Fix `entry` command (#2627)

pull/2629/head
patryk4815 12 months ago committed by GitHub
parent ab43ce572f
commit f351f27780
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -12,6 +12,7 @@ from shlex import quote
import pwndbg
import pwndbg.aglib.elf
import pwndbg.aglib.proc
import pwndbg.aglib.regs
import pwndbg.color.message as M
import pwndbg.commands
import pwndbg.dbg
@ -28,6 +29,11 @@ def breakpoint_at_entry():
print(M.error("No entry address found for the binary."))
return
if int(pwndbg.aglib.regs.pc) == addr:
# Skip setting the breakpoint because we are already at the entry point.
# This occurs when execution started with `starti` or `run -s`.
return
proc = pwndbg.dbg.selected_inferior()
bp = proc.break_at(BreakpointLocation(addr), internal=True)

Loading…
Cancel
Save