Skip to content

invalid settings error when using with gef-extras #823

@ebubekirtrkr

Description

@ebubekirtrkr
  • Did you use the latest version of GEF from dev branch?
  • Is your bug specific to GEF (not GDB)? - Try to reproduce it running gdb -nx
  • Did you read the documentation first?
  • Did you check issues (including
    the closed ones) - and the PR?

Step 1: Describe your environment

  • GEF version (including the Python library version) run version in GEF.
GEF: rev:6508a99f91bf7cdd2f1ea5af6fb2d4921d42a669 (Git - clean)
SHA256(/home/XXXX/gef/gef.py): 6b115fcaac5ff2748ce785f1be12c0445fbcd64d3fdca2b23ebfb279afdec997
GDB: 9.2
GDB-Python: 3.8

Step 2: Describe your problem

There are bunch of errors after any change in configration when use gef with gef-extras .

GEF for linux ready, type `gef' to start, `gef config' to configure
96 commands loaded for GDB 9.2 using Python engine 3.8
[*] Invalid setting 'gef.use-windbg-prompt': 'gef.use-windbg-prompt'
[*] Invalid setting 'ida-rpyc.host': 'ida-rpyc.host'
[*] Invalid setting 'ida-rpyc.port': 'ida-rpyc.port'
[*] Invalid setting 'ida-rpyc.sync_cursor': 'ida-rpyc.sync_cursor'
[*] Invalid setting 'retdec.path': 'retdec.path'
[*] Invalid setting 'retdec.retdec_path': 'retdec.retdec_path'
[*] Invalid setting 'retdec.theme': 'retdec.theme'
[*] Invalid setting 'rpyc-remote.host': 'rpyc-remote.host'
[*] Invalid setting 'rpyc-remote.port': 'rpyc-remote.port'
[*] Invalid setting 'vereference.max_recursion': 'vereference.max_recursion'
[+] Configuration from '/home/XXXXX/.gef.rc' restored
[+] 34 extra commands added from '/home/XXXXX/.config/gef-extras/scripts'

Steps to reproduce

  1. install gef dev
  2. install gef-extras dev
  3. run gdb
  4. gef save --> this will add settings related to the gef-extras to .gef.rc
  5. exit
  6. run gdb

Traces

opening gef debug won't change output

Thoughts

I think these error occur due to L10255 in GefCommand's setup function. __load_extra_plugins() executed after gdb.execute("gef restore") so there are invalid keys in config at L10615.
When I change order, or commented L10255 out errors doesn't occur again. Changing order not solves issue, it just removes all configuration.

gef/gef.py

Lines 10254 to 10264 in 18c7ba4

# load the saved settings
gdb.execute("gef restore")
# restore the autosave/autoreload breakpoints policy (if any)
self.__reload_auto_breakpoints()
# load plugins from `extra_plugins_dir`
if self.__load_extra_plugins() > 0:
# if here, at least one extra plugin was loaded, so we need to restore
# the settings once more
gdb.execute("gef restore quiet")

gef/gef.py

Lines 10614 to 10618 in 18c7ba4

try:
setting = gef.config.raw_entry(key)
except Exception as e:
warn(f"Invalid setting '{key}': {e}")
continue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions