I have a simple program, compiled with -g for debugging, put a break point and try to debug.
The program stops at the indicated location for one sec and then disappears Gdb returning 1: here is the debug log
==
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\MyDocs\Work\C-simplex\
Adding source dir: D:\MyDocs\Work\C-simplex\
Adding file: D:\MyDocs\Work\C-simplex\bin\Debug\C-simplex.exe
Changing directory to: D:/MyDocs/Work/C-simplex/.
Set variable: PATH=.
:\Program Files (x86)\CodeBlocks-V2003\MinGW\bin;D:\Program Files (x86)\CodeBlocks-V2003\MinGW;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Calibre2;D:\Program Files (x86)\Lua\5.1;D:\Program Files (x86)\Lua\5.1\clibs;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;D:\Program Files\Git\cmd;C:\Users\IOAN\AppData\Local\Microsoft\WindowsApps
[debug]Command-line: D:\Program Files (x86)\CodeBlocks-V2003\MINGW\bin\gdb.exe -nx -fullname -quiet D:\MyDocs\Work\C-simplex\bin\Debug\C-simplex.exe -args D:/MyDocs/Work/C-simplex/bin/Debug/C-simplex.exe
[debug]Working dir : D:\MyDocs\Work\C-simplex
Starting debugger: D:\Program Files (x86)\CodeBlocks-V2003\MINGW\bin\gdb.exe -nx -fullname -quiet D:\MyDocs\Work\C-simplex\bin\Debug\C-simplex.exe -args D:/MyDocs/Work/C-simplex/bin/Debug/C-simplex.exe
done
[debug]Reading symbols from D:/MyDocs/Work/C-simplex/bin/Debug/C-simplex.exe...done.
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.1
[debug]Copyright (C) 2018 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 8.1
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/MyDocs/Work/C-simplex/
[debug]Source directories searched: D:/MyDocs/Work/C-simplex;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> set args axxx byyy czzz dwww
[debug]>>>>>>cb_gdb:
[debug]> break "D:/MyDocs/Work/C-simplex/main.c:8"
[debug]Breakpoint 2 at 0x401577: file D:\MyDocs\Work\C-simplex\main.c, line 8.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\MyDocs\Work\C-simplex\bin\Debug\C-simplex.exe axxx byyy czzz dwww
Child process PID: 2316
[debug][New Thread 2316.0x37c8]
[debug]Breakpoint 2, main (argc=5, argv=0x8914f0) at D:\MyDocs\Work\C-simplex\main.c:8
[debug]D:\MyDocs\Work\C-simplex\main.c:8:121:beg:0x401577
[debug]>>>>>>cb_gdb:
At D:\MyDocs\Work\C-simplex\main.c:8
[debug]> info registers
[debug]rax 0x0 0
[debug]rbx 0x28 40
[debug]rcx 0xffffffff 4294967295
[debug]rdx 0x7ff97955fa30 140709459262000
[debug]rsi 0x5 5
[debug]rdi 0x891630 8984112
[debug]rbp 0x61fe20 0x61fe20
[debug]rsp 0x61fdf0 0x61fdf0
[debug]r8 0x7ff979565940 140709459286336
[debug]r9 0x61e260 6414944
[debug]r10 0x0 0
[debug]r11 0x246 582
[debug]r12 0x30 48
[debug]r13 0x28 40
[debug]r14 0x0 0
[debug]r15 0x0 0
[debug]rip 0x401577 0x401577 <main+39>
[debug]eflags 0x202 [ IF ]
[debug]cs 0x33 51
[debug]ss 0x2b 43
[debug]ds 0x2b 43
[debug]es 0x2b 43
[debug]fs 0x53 83
[debug]gs 0x2b 43
Debugger finished with status 1
=============
Please help, thanks igartner