This fixes memoize when debug=True is set in pwndbg/lib/memoize.py
Before this commit, one gets the following error:
```
dc@jhtc:~$ gdb
Executed: <stop-memoized function pwndbg.ida.available>(())
.... False
Traceback (most recent call last):
File "/home/dc/pwndbg/gdbinit.py", line 100, in <module>
import pwndbg # noqa: F401
File "/home/dc/pwndbg/pwndbg/__init__.py", line 11, in <module>
load_commands()
File "/home/dc/pwndbg/pwndbg/commands/__init__.py", line 601, in load_commands
import pwndbg.commands.cymbol
File "/home/dc/pwndbg/pwndbg/commands/cymbol.py", line 53, in <module>
pwndbg_cachedir = pwndbg.lib.tempfile.cachedir("custom-symbols")
File "/home/dc/pwndbg/pwndbg/lib/memoize.py", line 52, in __call__
print("%s: %s(%r)" % (how, self, args))
File "/home/dc/pwndbg/pwndbg/lib/memoize.py", line 58, in __repr__
return "<%s-memoized function %s>" % (self.kind, funcname)
AttributeError: 'forever' object has no attribute 'kind'
/home/dc/.gdbinit:12: Error in sourced command file:
No symbol table is loaded. Use the "file" command.
```
* Fix#855: Rust binaries debugging
This fixes#855 by using a workaround when we set language to C, fetch
symbols and set language back to Rust or auto.
Note that I also extended the list of symbols we fetched as... it seems
that the C language that is being set during some events may not have
e.g. `short` but may have a `short int` symbol. This is kinda weird, but
this is how it is. Idk if that's a GDB bug or what.
```
ipdb> gdb.execute('show language')
The current source language is "auto; currently c".
ipdb> gdb.lookup_type('short')
*** gdb.error: No type named short.
ipdb> gdb.lookup_type('int')
<gdb.Type object at 0x7fd35b550dc8>
ipdb> gdb.lookup_type('short int')
<gdb.Type object at 0x7fd35b550e68>
ipdb> gdb.lookup_type('long int')
<gdb.Type object at 0x7fd35b550e18>
```
* fix code review issues
* lib/memory.py: use 'if collection' instead of 'if len(collection) > 0'
* commands/__init__.py: use 'not line' instead of 'len(line)==0'
* hexdump.py: use 'not data' instead of 'len(data)==0'
* commands/nearpc.py: use `if p` instead of `if len("%s" % p)>0`
I double checked that this works fine:
```
pwndbg> set nearpc-branch-marker-contiguous
Set contiguous branch marker line for nearpc command to ''.
pwndbg> pi str(pwndbg.commands.nearpc.nearpc_branch_marker_contiguous)
''
pwndbg> pi bool(pwndbg.commands.nearpc.nearpc_branch_marker_contiguous)
False
```
Removing this _autofetch: first of all, it never called gdb.execute
since it was commented out. Second of all, GDB seems to do symbol
autofetching by default or at least with my simple tests it was working.
Maybe a very old GDB version did not do that and that's we wanted to
have it in the first place.