Skip to content

Commit

Permalink
[context] handling properly MemoryError exception when $pc is corrupt…
Browse files Browse the repository at this point in the history
…ed, avoid breaking the execution
  • Loading branch information
hugsy committed Apr 1, 2018
1 parent c9663f6 commit 5c89799
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -3468,7 +3468,7 @@ def do_invoke(self, argv):

for bp, bp_ins in __pie_breakpoints__.items():
bp_ins.instantiate(base_address)


@staticmethod
def set_pie_breakpoint(set_func, addr):
Expand Down Expand Up @@ -6417,7 +6417,13 @@ def do_invoke(self, argv):
for section in current_layout:
if section[0] == "-":
continue
self.layout_mapping[section]()

try:
self.layout_mapping[section]()
except gdb.MemoryError as e:
# a MemoryError will happen when $pc is corrupted (invalid address)
err(str(e))


self.context_title("")

Expand Down

0 comments on commit 5c89799

Please sign in to comment.