nakst / gf

A GDB frontend for Linux.
MIT License
1.8k stars 61 forks source link

Bug and Feature Request: Set UI path to exectuable when `file /executable/path` passed to gf2 #181

Open KonnorTimmons1297 opened 3 weeks ago

KonnorTimmons1297 commented 3 weeks ago

BUG: Passing file /executable/path as arguments to gf2, gdb fails to load the executable. However, when you execute file /executable/path in the gdb command input window it works as expected. You can replicate this by doing ./gf2 file gf2.

FEATURE REQUEST: Currently when passing file /executable/path as arguments to gf2 the executable the "Path to Executable" field in the UI is not populated with the path to that executable. As a result, when you hit the "Run" button the "The executable path is invalid" alert is shown.

KonnorTimmons1297 commented 3 weeks ago

Something like this is already being worked on in #176, but my approach seems to be a little different in that it is playing into to "gdb frontend" idea instead of loading from a settings file.

UPDATE: I misunderstood how gdbArgv is passed to gdb on startup. It looks like it just passes the arguments straight to gdb, so ./gf2 gf2 is equivalent to saying gdb gf2. I thought what was happening was that gdb was started and then the arguments are fed into gdb hence the reason I was passing file gf2.

Still I think dynamically checking gdb if a target executable is set and setting the "Path to Executable" field is the UI would be useful.