D:\code\gdb-test\bin\Debug>gdb gdb-test.exe
D:\code\gdbmybuild\bin\gdb.exe: warning: Couldn't determine a path for the index cache directory.
GNU gdb (GDB) 8.2.50.20190111-git
Copyright (C) 2019 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 "mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 gdb-test.exe...
(gdb) b main.cpp:10
Breakpoint 1 at 0x401649: file main.cpp, line 10.
(gdb) r
Starting program: D:\code\gdb-test\bin\Debug\gdb-test.exe
[New Thread 6572.0x16c4]
Do you need "set solib-search-path" or "set sysroot"?
Hello world!
Breakpoint 1, main () at main.cpp:10
10 int b = 0;
(gdb) stepi
11 a++;
(gdb) nexti
12 a= a+6;
(gdb) disas
Dump of assembler code for function main():
0x00401600 <+0>: lea 0x4(%esp),%ecx
0x00401604 <+4>: and $0xfffffff0,%esp
0x00401607 <+7>: pushl -0x4(%ecx)
0x0040160a <+10>: push %ebp
0x0040160b <+11>: mov %esp,%ebp
0x0040160d <+13>: push %ecx
0x0040160e <+14>: sub $0x24,%esp
0x00401611 <+17>: call 0x401870 <__main>
0x00401616 <+22>: movl $0x404045,0x4(%esp)
0x0040161e <+30>: movl $0x6ff05a00,(%esp)
0x00401625 <+37>: call 0x4016d4 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc>
0x0040162a <+42>: movl $0x4016dc,(%esp)
0x00401631 <+49>: mov %eax,%ecx
0x00401633 <+51>: call 0x4016f4 <_ZNSolsEPFRSoS_E>
0x00401638 <+56>: sub $0x4,%esp
0x0040163b <+59>: movl $0x0,-0xc(%ebp)
0x00401642 <+66>: movl $0x3,-0xc(%ebp)
0x00401649 <+73>: movl $0x0,-0x10(%ebp)
0x00401650 <+80>: addl $0x1,-0xc(%ebp)
=> 0x00401654 <+84>: addl $0x6,-0xc(%ebp)
0x00401658 <+88>: mov -0xc(%ebp),%eax
0x0040165b <+91>: add $0x1,%eax
0x0040165e <+94>: mov %eax,-0x10(%ebp)
0x00401661 <+97>: addl $0x1,-0x10(%ebp)
0x00401665 <+101>: addl $0x4,-0x10(%ebp)
0x00401669 <+105>: mov $0x0,%eax
0x0040166e <+110>: mov -0x4(%ebp),%ecx
0x00401671 <+113>: leave
0x00401672 <+114>: lea -0x4(%ecx),%esp
0x00401675 <+117>: ret
End of assembler dump.
(gdb) if 1
>disassemble 0x00401650
>info frame
>end
Dump of assembler code for function main():
0x00401600 <+0>: lea 0x4(%esp),%ecx
0x00401604 <+4>: and $0xfffffff0,%esp
0x00401607 <+7>: pushl -0x4(%ecx)
0x0040160a <+10>: push %ebp
0x0040160b <+11>: mov %esp,%ebp
0x0040160d <+13>: push %ecx
0x0040160e <+14>: sub $0x24,%esp
0x00401611 <+17>: call 0x401870 <__main>
0x00401616 <+22>: movl $0x404045,0x4(%esp)
0x0040161e <+30>: movl $0x6ff05a00,(%esp)
0x00401625 <+37>: call 0x4016d4 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc>
0x0040162a <+42>: movl $0x4016dc,(%esp)
0x00401631 <+49>: mov %eax,%ecx
0x00401633 <+51>: call 0x4016f4 <_ZNSolsEPFRSoS_E>
0x00401638 <+56>: sub $0x4,%esp
0x0040163b <+59>: movl $0x0,-0xc(%ebp)
0x00401642 <+66>: movl $0x3,-0xc(%ebp)
0x00401649 <+73>: movl $0x0,-0x10(%ebp)
0x00401650 <+80>: addl $0x1,-0xc(%ebp)
=> 0x00401654 <+84>: addl $0x6,-0xc(%ebp)
0x00401658 <+88>: mov -0xc(%ebp),%eax
0x0040165b <+91>: add $0x1,%eax
0x0040165e <+94>: mov %eax,-0x10(%ebp)
0x00401661 <+97>: addl $0x1,-0x10(%ebp)
0x00401665 <+101>: addl $0x4,-0x10(%ebp)
0x00401669 <+105>: mov $0x0,%eax
0x0040166e <+110>: mov -0x4(%ebp),%ecx
0x00401671 <+113>: leave
0x00401672 <+114>: lea -0x4(%ecx),%esp
0x00401675 <+117>: ret
End of assembler dump.
Stack level 0, frame at 0x28fed0:
eip = 0x401654 in main (main.cpp:12); saved eip = 0x4013eb
source language c++.
Arglist at 0x28feb8, args:
Locals at 0x28feb8, Previous frame's sp is 0x28fed0
Saved registers:
ebp at 0x28feb8, eip at 0x28fecc
(gdb)
So, I guess it is a C::B related issue.