Skip to content

Commit

Permalink
Fixed #508: partial revert of cae071e to ensure any exception from bl…
Browse files Browse the repository at this point in the history
…ock_for_line is caught
  • Loading branch information
hugsy committed Mar 9, 2020
1 parent 79e127e commit 63b199e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def _show_code_line(fname, idx):
gef_print("* OS: {:s} - {:s} ({:s})".format(platform.system(), platform.release(), platform.machine()))
if which("lsb_release"):
gef_print("")
gdb.execute("lsb_release -a")
gdb.execute("!lsb_release -a")
gef_print(HORIZONTAL_LINE*80)
gef_print("")
return
Expand Down Expand Up @@ -7481,8 +7481,11 @@ def print_guessed_arguments(self, function_name):

def __get_current_block_start_address():
pc = current_arch.pc
block = gdb.block_for_pc(pc)
block_start = block.start if block else gdb_get_nth_previous_instruction_address(pc, 5)
try:
block = gdb.block_for_pc(pc)
block_start = block.start if block else gdb_get_nth_previous_instruction_address(pc, 5)
except RuntimeError:
block_start = gdb_get_nth_previous_instruction_address(pc, 5)
return block_start


Expand Down

0 comments on commit 63b199e

Please sign in to comment.