rohanrhu / gdb-frontend

☕ GDBFrontend is an easy, flexible and extensible gui debugger. Try it on https://debugme.dev
https://oguzhaneroglu.com/projects/gdb-frontend/
GNU General Public License v3.0
2.82k stars 101 forks source link

Options per each tree item for including non-source files #13

Closed ell1e closed 3 years ago

ell1e commented 3 years ago

This is what happens when I load my executable, as you can see just main.c pops up:

Screenshot from 2020-10-08 09-31-13

This wouldn't be an issue if the tree shown to the left would actually allow me to browse the project folder for the other files. However, for some reason it doesn't, and opening them all up manually via "Load File" would take forever (since load file is unsorted as mentioned in #12 and doesn't start out in the directory I previously picked something from, making it really tedious to open up multiple files form the same folder). So some sort of "Show other files from this directory" context menu or button in the tree view to the left would really help, or alternatively a fix for whatever causes the other source files to not get detected in the first place. If you need more info for fixing that detection please tell me what you need, I'm happy to provide what I can.

rohanrhu commented 3 years ago

Hi, you can look this: https://github.com/rohanrhu/gdb-frontend#gdb-related-issues-and-tips

GDB does not give sources of linked object until stepping a line that calls a function from the linked object once. You can add break point a line and step it once, then you will see sources from linked object hereafter during the session.

ell1e commented 3 years ago

Ah I see, that at least explains the technical side. However in my opinion that is extremely inconvenient to use, since I already know where I want to add my breakpoints so I don't want to manually step around or look up the line number in an external editor to do that. If I wanted to look up my breakpoints manually in an external text editor I could have used command line gdb to start with, the entire point of a frontend for me is to solve such inconveniences.

I suggest you just provide a way to easily expand the file tree to the left to work around this. For example, just giving the folders a context menu or a "fully expand" icon to the right of each folder entry would be useful, such that I can open the other source files immediately and set the breakpoints right in the UI.

Edit: here's a quick mockup idea:

Screenshot from 2020-10-08 09-31-13

rohanrhu commented 3 years ago

Usually, a breakpoint and stepping once a random line shows all sources. But i will look for a solution for this also.

Do you mean "Expand/Collapse All" buttons for left side?

You can also use Ctrl+P fuzzy finder.

ell1e commented 3 years ago

I just added a quick mockup image, I hope that will help!

CTRL+P sounds useful, but sadly doesn't seem to pick up on subfolder paths inside all of the source folders. E.g. As you can see, the file /home/user/Develop/core.horse64.org/horse64/main.c is opened up. However, if I type compiler/scoperesolver.c to open up /home/user/Develop/core.horse64.org/horse64/compiler/scoperesolver.c, that entry won't be listed. I suspect it just doesn't look in that path where main.c is at, if it did that, that'd be very useful!

rohanrhu commented 3 years ago

Edit: here's a quick mockup idea:

Screenshot from 2020-10-08 09-31-13

Ok. Nice idea. A button for "list all" behaviour and I can make a "filter" setting for that. So you can set it to list only certain file types.

ell1e commented 3 years ago

Your frontend is really good-looking by the way. Other than these small difficulties browsing the files it looks way more promising than all other frontends I have tried, which usually tend to feel really outdated and horrible to use for some reason. So I really appreciate this project.

Edit: e.g. "nemiver", the best one I've tried so far other than yours, has no "gdb" prompt at the bottom for whatever reason which is a huge downside if I can't find something in the UI, and it's also abandoned

rohanrhu commented 3 years ago

Thank you. You can also access to GDB shell with tmux a -t gdb-frontend command in terminal. (and you can use terminalless layout without /terminal/ path in URL.)

You can set that ID (gdb-frontend) with --terminal-id=ID option.

rohanrhu commented 3 years ago

Hi,

I added FileBrowser opener buttons for each directory in SourceTree.

adittional-opener

I still have more feature ideas for SourceTree and planning them for v1.0.0.