From 6d8ffe65a0215d68ef7f752cf9711ef102d4c480 Mon Sep 17 00:00:00 2001 From: Exiled1 Date: Sun, 7 Jan 2024 22:11:24 -0800 Subject: [PATCH] Checked for overflow error and added error msg to setup (#85) * Checked for overflow error and added error msg to setup --- decomp2dbg/__init__.py | 2 +- decomp2dbg/clients/gdb/decompiler_pane.py | 8 ++++++++ setup.py | 18 +++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/decomp2dbg/__init__.py b/decomp2dbg/__init__.py index 77ce599..0513c22 100644 --- a/decomp2dbg/__init__.py +++ b/decomp2dbg/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.8.1" +__version__ = "3.8.2" try: from .clients.client import DecompilerClient diff --git a/decomp2dbg/clients/gdb/decompiler_pane.py b/decomp2dbg/clients/gdb/decompiler_pane.py index 7c4d029..722c27a 100644 --- a/decomp2dbg/clients/gdb/decompiler_pane.py +++ b/decomp2dbg/clients/gdb/decompiler_pane.py @@ -30,6 +30,14 @@ def update_event(self, pc_): # decompile the current pc location try: resp = self.decompiler.decompile(rebased_pc) + except OverflowError as e: + warn( + f"Decompiler failed to get a response from decompiler on " + f"{hex(rebased_pc) if isinstance( + rebased_pc, int) else rebased_pc} with: {e}" + f", are you in a library function?" + ) + return False except Exception as e: warn(f"Decompiler failed to get a response from decompiler on " f"{hex(rebased_pc) if isinstance(rebased_pc,int) else rebased_pc} with: {e}") diff --git a/setup.py b/setup.py index 3041c10..7ad5d12 100644 --- a/setup.py +++ b/setup.py @@ -19,27 +19,31 @@ def _copy_decomp_plugins(): local_d2d = Path("d2d.py").absolute() # clean the install location of symlink or folder - shutil.rmtree(pip_e_plugins, ignore_errors=True) + try: + shutil.rmtree(pip_e_plugins, ignore_errors=True) + except Exception as e: + print(f"Exception occurred while removing {pip_e_plugins}: {e}") + try: os.unlink(pip_e_plugins) os.unlink(decomp2dbg_loc.joinpath(local_d2d.name)) - except: - pass + except Exception as e: + print(f"Exception occurred during cleaning of install location: {e}") # first attempt a symlink, if it works, exit early try: os.symlink(local_plugins, pip_e_plugins, target_is_directory=True) os.symlink(local_d2d, decomp2dbg_loc.joinpath(local_d2d.name)) return - except: - pass + except Exception as e: + print(f"Exception occured during symlinking process: {e}") # copy if symlinking is not available on target system try: shutil.copytree("decompilers", "decomp2dbg/decompilers") shutil.copy("d2d.py", "decomp2dbg/d2d.py") - except: - pass + except Exception as e: + print(f"Exception occurred during copying process: {e}") class build(st_build): def run(self, *args):