Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checked for overflow error and added error msg to setup #85

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
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