linux7@linux7:~/C_spectre$ gcc -g -O0 flags.c -o flags
linux7@linux7:~/C_spectre$ gdb ./flags
GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./flags...
(gdb) break main
Breakpoint 1 at 0x1131: file flags.c, line 4.
(gdb) run
Starting program: /home/linux7/C_spectre/flags 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, main () at flags.c:4
4	    __asm__ volatile (
(gdb) disassemble /r main
Dump of assembler code for function main:
   0x0000555555555129 <+0>:	f3 0f 1e fa        	endbr64
   0x000055555555512d <+4>:	55                 	push   %rbp
   0x000055555555512e <+5>:	48 89 e5           	mov    %rsp,%rbp
=> 0x0000555555555131 <+8>:	b8 00 00 00 00     	mov    $0x0,%eax
   0x0000555555555136 <+13>:	85 c0              	test   %eax,%eax
   0x0000555555555138 <+15>:	b8 00 00 00 00     	mov    $0x0,%eax
   0x000055555555513d <+20>:	5d                 	pop    %rbp
   0x000055555555513e <+21>:	c3                 	ret
End of assembler dump.
(gdb) break *0x555555555136
Breakpoint 2 at 0x555555555136: file flags.c, line 4.
(gdb) continue
Continuing.

Breakpoint 2, 0x0000555555555136 in main () at flags.c:4
4	    __asm__ volatile (
(gdb) info registers eflags
eflags         0x246               [ PF ZF IF ]
(gdb) si
12	    return 0;
(gdb) info registers eflags
eflags         0x246               [ PF ZF IF ]
(gdb) break *0x555555555131
Note: breakpoint 1 also set at pc 0x555555555131.
Breakpoint 3 at 0x555555555131: file flags.c, line 4.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/linux7/C_spectre/flags 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, main () at flags.c:4
4	    __asm__ volatile (
(gdb) set $eflags = $eflags & ~0x40
(gdb) break *0x555555555136
Note: breakpoint 2 also set at pc 0x555555555136.
Breakpoint 4 at 0x555555555136: file flags.c, line 4.
(gdb) continue
Continuing.

Breakpoint 2, 0x0000555555555136 in main () at flags.c:4
4	    __asm__ volatile (
(gdb) info registers eflags
eflags         0x206               [ PF IF ]
(gdb) si
12	    return 0;
(gdb) info registers eflags
eflags         0x246               [ PF ZF IF ]
(gdb) 
