Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hovering a variable name in the center source code view should show its value in a popup #153

Closed
ell1e opened this issue Sep 27, 2023 · 8 comments · Fixed by #179
Closed
Assignees

Comments

@ell1e
Copy link

ell1e commented Sep 27, 2023

Hovering a variable name in the center source code view when in a paused state should show its current value in a popup, if it was set. This is one of the main benefits of graphical debuggers in my opinion, but it seems like seer 2.2 can't seem to do this yet so I think it would be a great addition.

Just as a mental model and for efficiency, that I can't just point a mouse at some thing in my code and just see what it's set to right now, and I'm forced to look in multiple places, it just feels very cumbersome and dated. (And that despite an otherwise modern looking and useful UI.)

Tested and feature found to be not present in seergdb version: 2.2

@epasveer
Copy link
Owner

I noticed this too a couple weeks ago, It used to work. I must have broken it along the way.

I'll check into it.

@ell1e
Copy link
Author

ell1e commented Sep 28, 2023

For what it's worth, sometimes it works now, but often it just doesn't and either nothing shows on hover, or it shows something like 0xefaf294 (some random address) for e.g. an integer where the "Locals" tab clearly shows some value like 2 which doesn't seem to make too much sense to me. The "Locals" tab on the other hand seems to be very reliable, so if it could just behave a bit more like that one, then everything would be fine.

@ell1e
Copy link
Author

ell1e commented Oct 12, 2023

I think I found why it often doesn't work:

The most common problem case seems to be when I'm hovering variables in a file in a function that is part of the current paused call stack, but not the frame selected in "Frames". I don't know gdb well enough, but if possible seer should maybe e.g. switch gdb to the frame this function is in and immediately back to supply these hover values if needed. (Since I think it's not that obvious or intuitive that you would need to manually always switch the frame in "Frames" to match the code you're currently looking at, just to make sure that hovering values works. When clearly a line is yellow marked as part of the stack and you're hovering stuff around it, I think the expectation is that it "just works", no matter how that happens behind the scenes.)

@epasveer
Copy link
Owner

What you surmize is correct. You need to set the stack frame first for the source file you are looking at.

I'm not sure about other gui debuggers -- if they can handle it the way you're suggesting. I'll check them. If they can, I should be able to.

@epasveer epasveer self-assigned this Oct 17, 2023
@epasveer
Copy link
Owner

The most common problem case seems to be when I'm hovering variables in a file in a function that is part of the current paused call stack, but not the frame selected in "Frames".

So I tried a comercial Linux debugger, and it has the same problem. It hovered with an empty tooltip.

You just need to select the proper frame first. Seer (really gdb) can't figure out the frame by which source file is put to the top.

I'll try the DDD debugger later to see what it does.

@epasveer
Copy link
Owner

One thing the comercial debugger does is:

  • If the text is a variable, print the variables value.
  • If the text is a function or class name, print its prototype.

This last one I can likely add to Seer.

@ell1e
Copy link
Author

ell1e commented Oct 17, 2023

I think in Visual Studio the hovering "just worked", but maybe I'm remembering wrong. I haven't touched that one in a while. I assume the difficulty is knowing what function a hovered name belongs to especially if that variable name is used in multiple functions in the stacktrace, with no knowledge of the code. But at least if the stack trace only enters a file in one frame it feels like it would be trivial (by just finding which single frame is in a function that is in this one file), as well as when a variable name only appears in one of the frames locally and never as global symbol (by just getting the locals of all frames and then picking the only frame that has it), but I guess just covering these two cases would be a very unsatisfyingly limited use.

@epasveer
Copy link
Owner

Even the DDD debugger doesn't support what you're asking for. I don't see how it can be done.

However, I'm finding when the correct stack frame is selected, Seer is still having problems showing the variable value in a tooltip.

So, I'll use this task to:

  • Make the showing of a variable's value more robust when hovering over the variable in the editor.
  • If the text is a function or class name, show its prototype.

@epasveer epasveer linked a pull request Oct 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants