-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cache symbols locally before reloading symbol file #87
Comments
It is, unfortunately, the intended behavior right now due to lazy programming. I never fixed it because on IDA Pro, it was fast enough (1 second or less) that I never fixed it. The problem is coming from here:
Nothing is cached on the client side. Things are cached server-side, but that is useless since, as you know, objcopy will be invoked many times. A way to fix would be to make a simple dict that stores things after they are sent. If the dict ever matches what was sent, don't invoke the |
#88 removes all symbols when new symbol is introduced: --- a/decomp2dbg/clients/gdb/gdb_client.py
+++ b/decomp2dbg/clients/gdb/gdb_client.py
@@ -91,6 +91,10 @@ class GDBDecompilerClient(DecompilerClient):
if new_entry:
syms_to_add.append(symbol)
+ if len(syms_to_add) == 0:
+ syms_to_add.append(("test123", int("0xdeadf00d",0), "function", 8))
+ print("add test123")
+
try: (gdb) attach 341338
Attaching to process 341338
Reading symbols from /usr/bin/less...
0x00007fd1e18a809d in __GI___libc_read (fd=3, buf=0x7ffe00f9db67, nbytes=1) at ../sysdeps/unix/sysv/linux/read.c:26
(gdb) pipe info functions | wc -l
8013
(gdb) decompiler connect ghidra
[+] Connected to decompiler!
(gdb) pipe info functions | grep FUN_00105020
0xbaa8e020 FUN_00105020
(gdb) ni
0x00007fd1e18a809d 26 in ../sysdeps/unix/sysv/linux/read.c
add test123
[*] Decompiler failed to get a response from decompiler on 0x2a5426e1f09d with: int exceeds XML-RPC limits, are you in a library function?
───────────────────────────────────────────────
[!] Unable to decompile function
───────────────────────────────────────────────
(gdb) pipe info functions | wc -l
8014
(gdb) pipe info functions | grep test123
0x9956800c test123
(gdb) pipe info functions | grep FUN_00105020
(gdb) It happens because all temporary symbol files are removed; there is no file to add symbol to, so a new empty file is created. https://github.com/mahaloz/decomp2dbg/blob/main/decomp2dbg/clients/gdb/symbol_mapper.py#L259 Potential fix: don't remove symbol files, create only one file and increment on it. You'll also need to remove syms from obj which were removed from decompiler. I suggest rolling back #88. |
Rip np, I'll roll back |
Ghidra decompiled ~95k symbols from my library which are reloaded on any gdb command. It takes about 5 seconds to invoke objcopy ~60 times:
Symbols in Ghidra are not modified by me, why load them again? Is this a correct behaviour?
The text was updated successfully, but these errors were encountered: