I am having difficulty running a debugger.
I tried gdb and signing, but it didn't work. I also tried lldb, but it doesn't stop on a breakpoint for whatever reason.
I compiled with `-O0 -g3`, then
```
lldb
(lldb) file nextstep/Emacs.app/Contents/MacOS/Emacs
Current executable set to '/Users/kuragin/Desktop/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs' (x86_64).
(lldb) breakpoint set -f scroll.c -l 270
Breakpoint 1: where = Emacs`do_scrolling + 485 at scroll.c:271:11, address = 0x0000000100032da5
```
But, it doesn't stop there...
and I run Emacs like this:
```
arch --x86_64 make configure="CFLAGS='-O0 -g3'" -j 20 && nextstep/Emacs.app/Contents/MacOS/Emacs -nw
```
I can confirm that my patch fixes the problem for me, but I am not confident that the issue is in the estimation cost.
When I have line numbers enabled, I assume, the scrolling logic would always try to insert/delete/write lines. In my case it might be:
- Writing (Is that writing on top of the current lines?) is cheaper.
- Screen flickers because of the specific frequency of the terminal (or the way we flush the buffer).
For example, we insert empty lines and then the screen is updated, only then we add content in there and redisplay again.
Potentially, some redrawing might happen inside of `ins_del_lines`? Instead of redrawing the whole screen, we redraw it in the middle of modifying it?
Those are just my assumptions from reading the code.
I'd appreciate any help in debugging the issue.