Skip to content

Commit

Permalink
Checked for overflow error and added error msg to setup (#85)
Browse files Browse the repository at this point in the history
* Checked for overflow error and added error msg to setup
  • Loading branch information
Exiled1 authored Jan 8, 2024
1 parent f0baae1 commit 6d8ffe6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion decomp2dbg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.8.1"
__version__ = "3.8.2"

try:
from .clients.client import DecompilerClient
Expand Down
8 changes: 8 additions & 0 deletions decomp2dbg/clients/gdb/decompiler_pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(

This comment has been minimized.

Copy link
@mahaloz

mahaloz Jan 14, 2024

Owner

This is not a legal string in Python

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}")
Expand Down
18 changes: 11 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6d8ffe6

Please sign in to comment.