epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.11k stars 67 forks source link

Opening source code sugestion #109

Closed chucktilbury closed 8 months ago

chucktilbury commented 1 year ago

I have been digging around in libc quite a bit lately. The source code is located in a non-standard place, so when I step into it, I have to provide a path. Then I have to hit enter to actually open the file. If I open the file, then I can't add the path without going into the setup. What I would like to see is adding the path and opening the file in one step. Or, better, provide the path to glibc and have seer glob for it.

epasveer commented 1 year ago

Hi.

Have you tried adding the non-standard directory in the "Source" config tab under Alternate directories? (Then save the new config setting).

image

Seer will check the list of alternate paths if it can't find the path the gdb suggests.

epasveer commented 1 year ago

If that doesn't work, then I've missed something. Perhaps you can provide some screenshots?

chucktilbury commented 1 year ago

Yes. That all works fine, but it's not what I am describing. I want to smooth out adding a source code path from the main window. Here are some screen caps how I would like for it to work. I am starting the debugger without any configuration set.

I start the debugger as: seergdb --start --bf _start ut 2> /dev/null & The current directory has the executable and the source is located in a different directory. The source code is not found. image

I step into it once so that libc is entered: image

I hit OK and open the directory: image At this point I have to hit the "+" button to add the path, and then I have to hit to open the file.

What I want to have happen is to hit the OK button and enter the path with the path dialog as it happens now, but the file is opened and the path is saved without the other mouse and key strokes.

I also looked again and globbing will not work in this situation because there are several files with the same name and picking the right one is a trial and error procedure. Can the whole path be shown in the info dialog?

chucktilbury commented 1 year ago

BTW: It steps into function that are embedded in macros just fine. Awesome!

epasveer commented 1 year ago

Hi Chuck.

Thanks for the screenshots. I think I understand a bit better. I like your idea. Here's what I'm planning.

image

Instead of a "+" button that you have to manually select, I've changed it to a checkbox to remember the alternate path for any future lookups in your session. The default is "on".

If you manually type the path (then hit "return"), or select the path with the File dialog (hit "Open"), it will be remembered.
As you say, there is many fewer mouse clicks and typing.

epasveer commented 1 year ago

Can the whole path be shown in the info dialog?

I suspect you're talking about this circled area?

image

I can add the full path. However, the full path can get quite long in some cases.

Let me know if that is what you mean.

epasveer commented 1 year ago

I'm going with this:

image

chucktilbury commented 1 year ago

If you manually type the path (then hit "return"), or select the path with the File dialog (hit "Open"), it will be remembered. As you say, there is many fewer mouse clicks and typing.

Yes. That sounds about right.

chucktilbury commented 1 year ago

I'm going with this:

image

That looks good to me. One thing is that I am using CMAKE to build and that moves things around a lot. I like having an example path for the file because it could give a clue when there are more than one files with the same name, such as in libc and the LLVM libraries. Other than that, the right answer may be "just deal with it".

chucktilbury commented 1 year ago

One thing is that Seer does not find source code that is in a different location than the executable. I don't know how to solve that except with globbing. I think that the debugging information stores the complete path for sources, but I have not verified that. That could be very easy to solve or a real PITA....

epasveer commented 1 year ago

I think that the debugging information stores the complete path for sources

In all my testing with gcc/g++ and Seer, I've seen both relative and absolute paths in the debug information that gdb sees. I haven't been able to figure out why that happens yet :^(

epasveer commented 1 year ago

Anyway, I just pushed the changes to github. If you want to pull the latest, you can.

epasveer commented 8 months ago

Closing this old task. A new one can be created if things are still outstanding.