tromey / gdb-gui

A gdb gui written in Python, running inside gdb itself.
44 stars 3 forks source link

make scrolling more intelligent #3

Open tromey opened 9 years ago

tromey commented 9 years ago

Right now the source window scrolls naively. It would be great if it were more intelligent.

The ideal would be if we could get loop information out of gdb, so we could scroll the window to show the entirety of a loop. This isn't available though.

When entering a new function we should try to display it -- centering the function in the window if it is small enough, but otherwise showing the start of the function at the top.

When stepping we could adopt a somewhat emacs-like approach. After N steps that scroll a single line, we could scroll so that point is centered. Then if we have to scroll backward within a function, assume there is a loop and scroll so that point is at the top of the window (to try to keep the entire loop visible).

tromey commented 9 years ago

Another case to consider is up/down. Here "same frame" isn't the relevant distinction but instead the window should save scroll positions with the buffer, or something like that.

tromey commented 7 years ago

Now I'm thinking of having two margins: an "outer" margin, where if stepping moves past that point, the text is scrolled; and an "inner" margin which indicates how much more text to show.