I just ran your program again, in the debugger. This is the output in the Output tab of the Debugger pane:
Code: Select all
Using gdbinit file: /home/david/.codelite-gdbinit
Current working dir: /mnt/everythingelse/devel/temp/Dino/section15/15_challenge
Launching gdb from : /home/david/devel/temp/Dino/section15/15_challenge
Starting debugger : /usr/bin/gdb --command="/home/david/.codelite-gdbinit" --tty=/dev/pts/13 --interpreter=mi "/home/david/devel/CLworkspace/Misc/build-Debug/bin/15-ChallengeOrig"
DEBUG>>set unwindonsignal on
DEBUG>>set breakpoint pending on
DEBUG>>set print object on
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set pagingation off
DEBUG>>set debuginfod enabled off
DEBUG>>set print elements 200
DEBUG>>python
DEBUG>>import sys
DEBUG>>sys.path.insert(0, '/home/david/.codelite/gdb_printers')
DEBUG>>from libstdcxx.v6.printers import register_libstdcxx_printers
DEBUG>>register_libstdcxx_printers (None)
DEBUG>>from qt4 import register_qt4_printers
DEBUG>>register_qt4_printers (None)
DEBUG>>from wx import register_wx_printers
DEBUG>>register_wx_printers (None)
DEBUG>>00000210-break-insert -f "/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp:33"
DEBUG>>00000212-enable-pretty-printing
Debug session started successfully!
DEBUG>>00000213-exec-arguments
DEBUG>>00000214-exec-run
DEBUG>>=thread-group-added,id="i1"
=thread-group-added,id="i1"
DEBUG>>~"GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git\n"
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
...
DEBUG>>~"This GDB was configured as \"x86_64-linux-gnu\".\n"
This GDB was configured as "x86_64-linux-gnu".
DEBUG>>~"Type \"show configuration\" for configuration details.\n"
...
DEBUG>>=cmd-param-changed,param="confirm",value="off"
=cmd-param-changed,param="confirm",value="off"
DEBUG>>~"Reading symbols from /home/david/devel/CLworkspace/Misc/build-Debug/bin/15-ChallengeOrig...\n"
Reading symbols from /home/david/devel/CLworkspace/Misc/build-Debug/bin/15-ChallengeOrig...
DEBUG>>&"\"/home/david/.codelite-gdbinit\": No such file or directory.\n"
DEBUG>>&"set unwindonsignal on\n"
DEBUG>>=cmd-param-changed,param="unwindonsignal",value="on"
=cmd-param-changed,param="unwindonsignal",value="on"
DEBUG>>^done
DEBUG>>&"set breakpoint pending on\n"
DEBUG>>=cmd-param-changed,param="breakpoint pending",value="on"
=cmd-param-changed,param="breakpoint pending",value="on"
DEBUG>>^done
DEBUG>>&"set print object on\n"
DEBUG>>=cmd-param-changed,param="print object",value="on"
=cmd-param-changed,param="print object",value="on"
DEBUG>>^done
DEBUG>>&"set width 0\n"
DEBUG>>=cmd-param-changed,param="width",value="4294967295"
=cmd-param-changed,param="width",value="4294967295"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>=cmd-param-changed,param="height",value="4294967295"
=cmd-param-changed,param="height",value="4294967295"
DEBUG>>^done
DEBUG>>&"set pagingation off\n"
DEBUG>>&"No symbol \"pagingation\" in current context.\n"
DEBUG>>^error,msg="No symbol \"pagingation\" in current context."
^error,msg="No symbol \"pagingation\" in current context."
DEBUG>>&"set debuginfod enabled off\n"
DEBUG>>&"No symbol \"debuginfod\" in current context.\n"
DEBUG>>^error,msg="No symbol \"debuginfod\" in current context."
^error,msg="No symbol \"debuginfod\" in current context."
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
DEBUG>>&"python\n"
DEBUG>>&"Traceback (most recent call last):\n"
DEBUG>>&" File \"<string>\", line 7, in <module>\n"
DEBUG>>&"ImportError: cannot import name 'register_wx_printers' from 'wx' (/home/david/.codelite/gdb_printers/wx.py)\n"
DEBUG>>&"Error while executing Python code.\n"
DEBUG>>^error,msg="Error while executing Python code."
^error,msg="Error while executing Python code."
...
DEBUG>>00000210^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000404efc",func="main()",file="/home/david/devel/temp/Dino/section15/15_challenge/main.cpp",fullname="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp",line="33",thread-groups=["i1"],times="0",original-location="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp:33"}
Found the breakpoint ID!
Storing debugger breakpoint Id=5
Successfully set breakpoint 5 at: /mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp:33
DEBUG>>&"No source file named /home/david/devel/CLworkspace/Misc/SimpleWxExecutabe/main.cpp.\n"
DEBUG>>00000211^done,bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="
Debuggee process ID: 4094
DEBUG>>=thread-group-started,id="i1",pid="4094"
=thread-group-started,id="i1",pid="4094"
DEBUG>>=thread-created,id="1",group-id="i1"
=thread-created,id="1",group-id="i1"
DEBUG>>00000214^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>=breakpoint-modified,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000404efc",func="main()",file="/home/david/devel/temp/Dino/section15/15_challenge/main.cpp",fullname="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp",line="33",thread-groups=["i1"],times="1",original-location="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp:33"}
=breakpoint-modified,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000404efc",func="main()",file="/home/david/devel/temp/Dino/section15/15_challenge/main.cpp",fullname="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp",line="33",thread-groups=["i1"],times="1",original-location="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp:33"}
DEBUG>>~"\n"
DEBUG>>~"Breakpoint 5, main () at /home/david/devel/temp/Dino/section15/15_challenge/main.cpp:33\n"
Breakpoint 5, main () at /home/david/devel/temp/Dino/section15/15_challenge/main.cpp:33
DEBUG>>~"33\t display(sav_accounts);\n"
33\t display(sav_accounts);
DEBUG>>*stopped,reason="breakpoint-hit",disp="keep",bkptno="5",frame={addr="0x0000000000404efc",func="main",args=[],file="/home/david/devel/temp/Dino/section15/15_challenge/main.cpp",fullname="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp",line="33",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="8"
DEBUG>>00000215-file-list-exec-source-file
DEBUG>>00000216-break-list
DEBUG>>00000215^done,line="33",file="/home/david/devel/temp/Dino/section15/15_challenge/main.cpp",fullname="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp",macro-info="0"
DEBUG>>00000216^done,BreakpointTable={nr_rows="6",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:30",times="0",original-location="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:30"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:16",times="0",original-location="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:16"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:22",times="0",original-location="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:22"},bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:25",times="0",original-location="/mnt/everythingelse/devel/CLworkspace/Misc/YAProject/MainFrame.cpp:25"},bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000404efc",func="main()",file="/home/david/devel/temp/Dino/section15/15_challenge/main.cpp",fullname="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp",line="33",thread-groups=["i1"],times="1",original-location="/mnt/everythingelse/devel/temp/Dino/section15/15_challenge/main.cpp:33"},bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/home/david/devel/CLworkspace/Misc/SimpleWxExecutabe/main.cpp:9",times="0",original-location="/home/david/devel/CLworkspace/Misc/SimpleWxExecutabe/main.cpp:9"}]}
Have a look at your output; see if you can spot any important difference.
You were going to try running your program direct in gdb. What happened? Could gdb show the content of variables when a BP was hit?