Skip to content

Commit

Permalink
Revert bad cache (PR #88) (#89)
Browse files Browse the repository at this point in the history
* Revert "#87 add client symbol cache for gdb (#88)"

This reverts commit 922eedd.

* Roll back bad caching
  • Loading branch information
mahaloz authored Jan 16, 2024
1 parent 2026533 commit 5db2030
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 52 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.4"
__version__ = "3.8.5"

try:
from .clients.client import DecompilerClient
Expand Down
18 changes: 2 additions & 16 deletions decomp2dbg/clients/gdb/gdb_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(self, gdb_client, name="decompiler", host="127.0.0.1", port=3662):
self.symbol_mapper = SymbolMapper()
self._is_pie = None
self._lvar_bptr = None
self._symbol_cache = set()

@property
@lru_cache()
Expand Down Expand Up @@ -53,13 +52,6 @@ def decompiler_connected(self):
def decompiler_disconnected(self):
self.gdb_client.on_decompiler_disconnected(self.name)

def _cache(self, item):
if item in self._symbol_cache:
return False

self._symbol_cache.add(item)
return True

def update_symbols(self):
self.symbol_mapper.text_base_addr = self.text_base_addr

Expand All @@ -74,10 +66,7 @@ def update_symbols(self):

# add symbols with native support if possible
for addr, func in func_headers.items():
symbol = (func["name"], int(addr, 0), "function", func["size"])
new_entry = self._cache(symbol)
if new_entry:
syms_to_add.append(symbol)
syms_to_add.append((func["name"], int(addr, 0), "function", func["size"]))
sym_name_set.add(func["name"])

for addr, global_var in global_vars.items():
Expand All @@ -86,10 +75,7 @@ def update_symbols(self):
if clean_name in sym_name_set:
continue

symbol = (clean_name, int(addr,0), "object", global_var_size)
new_entry = self._cache(symbol)
if new_entry:
syms_to_add.append(symbol)
syms_to_add.append((clean_name, int(addr, 0), "object", global_var_size))

try:
self.symbol_mapper.add_native_symbols(syms_to_add)
Expand Down
32 changes: 0 additions & 32 deletions decomp2dbg/clients/gdb/gdb_client_test.py

This file was deleted.

3 changes: 0 additions & 3 deletions decomp2dbg/clients/gdb/symbol_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ def add_native_symbols(self, sym_info_list):
return False

# info("{:d} symbols will be added".format(len(sym_info_list)))
if len(sym_info_list) == 0:
return True

self._delete_old_sym_files()

# add each symbol into a mass symbol commit
Expand Down

0 comments on commit 5db2030

Please sign in to comment.