Bug 26024 - Cannot scroll up in asm view
Summary: Cannot scroll up in asm view
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: tui (show other bugs)
Version: 9.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-22 13:38 UTC by Edd Barrett
Modified: 2021-03-17 10:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edd Barrett 2020-05-22 13:38:20 UTC
Hi,

As others have noted too [0], in certain cases you cannot scroll up using the up arrow key when in the asm layout.

It seems to me that the bug manifests once the program being debugged has crashed with SIGSEGV.

Suppose a.c is a buggy program like:

```
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char **argv)
{
    printf("%s\n", (char *)0);
    return (EXIT_SUCCESS);
}
```

Now we debug it:

```
$ gcc -g a.c
$ gdb a.out
...
(gdb) layout asm
```

Now verify that scrolling up and down both work. They do.

```
(gdb) run
Starting program: /tmp/a.out 

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f5a181 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
```

Now scrolling down works, but up does not.

This is particularly acute, as you usually want to see what instructions lead to the crash.

I'm using version 9.1 but bug seems also present in 8.2.1, as distributed with debian.

Thanks

[0] https://stackoverflow.com/questions/26572805/gdb-tui-scroll-assembly-view-above-current-instruction
Comment 1 Edd Barrett 2021-03-17 10:58:16 UTC
I just tried the test case with gdb-10.1 and scroll up seems to have been fixed (albeit with caveats, see Bug #27593).