rohanrhu / gdb-frontend

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

(Not sure if bug?) Opening a .c file will sometimes not actually open it as a source code file tab #16

Closed ell1e closed 3 years ago

ell1e commented 3 years ago

In the project of mine I'm trying to debug, when I open a specific .c file via "Load File" then instead of showing up as an additional source code tab (which is what I wanted) instead the tree view disappears. It almost seems like gdb-frontend thought it was a binary, but it is not - it's really just a very boring text file. Am I supposed to open source files via some other button, or is that a bug? In any case, it'd be cool if "Load File" actually detected a code file vs a binary and magically did "the right thing" for both which at least for this case doesn't seem to have worked out.

Here is the issue in a short clip where I open the .c file:

output

rohanrhu commented 3 years ago

"Load File" button is different from the load icon in right side of "Sources" section title.

ell1e commented 3 years ago

Maybe you should rename it to "Load Executable" then? Might also be worth finding some way to filter the file list to only binaries one day (e.g. by probing the header of the listed files for ELF and other common formats, or excluding the common source code extensions)

Edit: I'm thinking, a different icon might also help, e.g. something like this which indicates a non-text file: https://e7.pngegg.com/pngimages/1005/794/png-clipart-computer-icons-binary-file-others-angle-text.png

Edit 2: or what about "Load Program" maybe? that's shorter

rohanrhu commented 3 years ago

Good idea. Renamed it to "Load Executable". Thank you for feedback. I will change icon also.

ell1e commented 3 years ago

You are so quick :heart_eyes: :+1:

rohanrhu commented 3 years ago

By the way, when you add breakpoint a line in main() and step over the line for first time, you will see all sources on the left side and you can use Ctrl+P fuzzy finder also.

It seems also we have a scrollbar style problem for Firefox, I will look to that.