-
-
Notifications
You must be signed in to change notification settings - Fork 784
Description
Line 7571 in deeab2f
def context_code(self) -> None: |
Lines 7578 to 7579 in deeab2f
breakpoints = gdb.breakpoints() or [] | |
bp_locations = [b.location for b in breakpoints if b.location and b.location.startswith("*")] |
Line 7589 in deeab2f
for insn in self.instruction_iterator(pc, nb_insn, nb_prev=nb_insn_prev): |
Line 7593 in deeab2f
bp_prefix = Color.redify(BP_GLYPH) if self.addr_has_breakpoint(insn.address, bp_locations) else " " |
Lines 7568 to 7569 in deeab2f
def addr_has_breakpoint(self, address: int, bp_locations: List[str]) -> bool: | |
return any(hex(address) in b for b in bp_locations) |
b.location
is just the string used by the user to set the breakpoint not its address, so the current code relies on the user using an hexadecimal address and doesn't handle breakpoints set on a function.
Would it be worth it to parse info breakpoints
to extract all the addresses instead of ignoring some breakpoints ?
I also considered parsing b.location
and look for the address from the symbol name, but I still have troubles with that part of the API and we would have to handle ourselves the differences between declarations such as b <fun>
, b *<fun>
and b *'<fun>'+<offset>
.
GDB 13.1 did introduce Breakpoint.locations
that can return the exact address, but I don't think it's an option since it relies on a recent version of gdb.