nakst / gf

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

Faster way to find source files #65

Closed aolo2 closed 2 years ago

aolo2 commented 2 years ago

As it stands right now, the Files pane starts in the home directory every time. However, what I mostly use it for is for navigating to the debugee source file to place a breakpoint. So what I have to do is go all the way from the home folder to the project source folder.

Would be nice to either:

  1. Start the Files pane already in the compilation root folder
  2. Have a "go to main.c" button in the Files pane or something like that

I'm not sure if gdb itself exposes any of this information, but dwarf sure does! (it's in DW_TAG_compile_unit -> DW_AT_comp_dir).

nakst commented 2 years ago

As it stands right now, the Files pane starts in the home directory every time.

This seems wrong? According to this code, https://github.com/nakst/gf/blob/master/windows.cpp#L2215, it should start in the working directory where gf2 is launched.

Regardless, I am happy to add buttons to the file window to navigate to a) the current working directory and b) the folder containing the currently loaded file.

aolo2 commented 2 years ago

Ah, you are right. The thing is: I launch gf2 via a .desktop file, so the workdir is always the same.

nakst commented 2 years ago

Added in a2ff166.