* 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.
The GDB didn't freeze, but somehow showed an additional newline and failed to show the context because `pwndbg.gdblib.proc.thread_is_stopped` is False when running `gdb.prompt_hook`.
If we execute the `monitor` command in `is_debug_probe()`, the GDB with normal GDBserver will stuck after first `continue`.
To avoid this, we check if `monitor help` showed that we are using GDBserver.
- Update the docs of the config: `kernel-vmmap`, `hexdump-group-use-big-endian`, `kernel_vmmap_via_pt`, and `resolve-heap-via-heuristic`
- Update the output of `get_show_string()` to display: ``See `help set <config>` for more information`` in the end of the output of `show <config>`
- Fix wrong output of `heap_config` command
- Implement auto mode for heap heuristic
- In auto mode, pwndbg will try to resolve the heap using heuristics if debug symbols are missing
- Modify `get_set_string()` to match GDB's builtin behaviour
- Make `gcc-compiler-path`'s and `cymbol-editor`'s `set_show_doc` first strings to lowercase
- Change `gcc-compiler-path` and `cymbol-editor` to `gdb.PARAM_OPTIONAL_FILENAME`
- Add resolve_heap_via_heuristic as a gdb.PARAM_ENUM config with options:
- auto: pwndbg will try to use heuristics if debug symbols are missing
- force: pwndbg will always try to use heuristics, even if debug symbols are available
- never: pwndbg will never use heuristics to resolve the heap
- Move some hints to `resolve_heap_via_heuristic`'s `help_docstring`