eteran / edb-debugger

edb is a cross-platform AArch32/x86/x86-64 debugger.
GNU General Public License v2.0
2.68k stars 322 forks source link

Don't save default plugin path #771

Closed maxxk closed 4 years ago

maxxk commented 4 years ago

In Linux distributions like NixOS and Guix installation path contains hash of all dependencies. If plugin path is stored in user configuration, edb will break on update due to invalid plugin path. It can be prevented by saving only non-default plugin path.

Issue is described here: https://github.com/NixOS/nixpkgs/pull/58962#issuecomment-481521588

eteran commented 4 years ago

Generally looks good to me. So it won't save it so long as it's the default, but if it's user set, then it will still save it, right?

maxxk commented 4 years ago

Well, it will save it if it is different from the default. When rechecking it just now I found an edge case: if plugin path in config file is incorrect, then my changes make it impossible to replace it with the default path. I can't think of a simple enough way to check whether user entered the default value. Probably I will add an "else" clause to writeSettings which will remove plugin path from settings if the default path is entered. It will remove an invalid path and after the restart plugins will be loaded from the default path.

eteran commented 4 years ago

OK, I'll hold off on merging if you want to try to address any edge cases you've found.

maxxk commented 4 years ago

Thank you, I pushed the fix.

eteran commented 4 years ago

@10110111 This patch looks good to me, you have any thoughts?

10110111 commented 4 years ago

Looks sane to me.