User forums > Help
Debugger sometimes stalls when using "Step Into".
oBFusCATed:
I saw the fix. Look correct, but I can verify it.
--- Quote from: MortenMacFly on November 20, 2012, 02:51:50 pm ---The same flag would be a candidate for the problem described here (surely another code segment though).
--- End quote ---
Most probably...
--- Quote from: MortenMacFly on November 20, 2012, 02:51:50 pm ---My guess is, that if the BP message does not show up (why-ever) this state is not covered properly, so any following actions like "pause debugger" will lead to nowhere. Maybe after the first "pause" which failed we should try to fiddle with this internal state, too... not a hack, but properly done.
--- End quote ---
Most of the times when I see such cases, I just declare defeat against the gdb/cli output.
@and4cb: Is it possible to execute the same commands in a gdb directly and paste the log?
and4cb:
--- Quote ---@and4cb: Is it possible to execute the same commands in a gdb directly and paste the log?
--- End quote ---
I will try this now, and reply back as soon as possible.
and4cb:
This is my first time using the command prompt for gdb, so please forgive me if I this is not what you were asking for.
--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Code\test5\
Adding source dir: C:\Code\test5\
Adding file: C:\Code\test5\bin\Debug\test5.exe
Changing directory to: C:/Code/test5/.
Set variable: PATH=.;C:\MinGW32\bin;C:\MinGW32;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared;C:\Program Files (x86)\Common Files\DivX Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\Program Files (x86)\QuickTime\QTSystem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Live\Shared
[debug]Command-line: C:\MinGW32\bin\gdb.exe -nx -fullname -quiet -args C:/Code/test5/bin/Debug/test5.exe
[debug]Working dir : C:\Code\test5
Starting debugger: C:\MinGW32\bin\gdb.exe -nx -fullname -quiet -args C:/Code/test5/bin/Debug/test5.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]Reading symbols from C:\Code\test5\bin\Debug\test5.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 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 "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5
[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 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> source C:\cb20121112\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Code/test5/
[debug]Source directories searched: C:/Code/test5;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> tbreak "C:/Code/test5/main.c:10"
[debug]Temporary breakpoint 1 at 0x40133f: file C:\Code\test5\main.c, line 10.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\Code\test5\bin\Debug\test5.exe
Child process PID: 3188
[debug][New Thread 3188.0x2b4]
[debug]Temporary breakpoint 1, main () at C:\Code\test5\main.c:12
[debug]C:\Code\test5\main.c:12:233:beg:0x40133f
[debug]>>>>>>cb_gdb:
At C:\Code\test5\main.c:12
[debug]> bt 30
[debug]#0 main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> si
[debug]> si
[debug]Initialize () at C:\Code\test5\main.c:18
[debug]C:\Code\test5\main.c:18:309:beg:0x40134b
[debug]>>>>>>cb_gdb:
Initialize () at C:\Code\test5\main.c:18
C:\Code\test5\main.c:18:309:beg:0x40134b
At C:\Code\test5\main.c:18
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:18
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> n
[debug]> n
[debug]C:\Code\test5\main.c:19:312:beg:0x401351
[debug]>>>>>>cb_gdb:
C:\Code\test5\main.c:19:312:beg:0x401351
At C:\Code\test5\main.c:19
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:19
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> n
[debug]> n
[debug]C:\Code\test5\main.c:24:508:beg:0x401366
[debug]>>>>>>cb_gdb:
C:\Code\test5\main.c:24:508:beg:0x401366
At C:\Code\test5\main.c:24
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:24
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> si
[debug]> si
[debug]C:\Code\test5\main.c:24:508:middle:0x40136d
[debug]>>>>>>cb_gdb:
C:\Code\test5\main.c:24:508:middle:0x40136d
At C:\Code\test5\main.c:24
[debug]> bt 30
[debug]#0 0x0040136d in Initialize () at C:\Code\test5\main.c:24
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> si
[debug]> si
[debug]InitNum (num=4) at C:\Code\test5\main.c:30
[debug]>>>>>>cb_gdb:
InitNum (num=4) at C:\Code\test5\main.c:30
> si
[debug]> si
[debug]0x0040138f >>>>>>cb_gdb:
0x0040138f
> si
[debug]> si
[debug]>>>>>>cb_gdb:
> si
[debug]> si
[debug]>>>>>>cb_gdb:
> si
[debug]> si
[debug]>>>>>>cb_gdb:
> s
[debug]> s
[debug]Initialize () at C:\Code\test5\main.c:26
[debug]C:\Code\test5\main.c:26:592:beg:0x401377
[debug]>>>>>>cb_gdb:
Initialize () at C:\Code\test5\main.c:26
C:\Code\test5\main.c:26:592:beg:0x401377
At C:\Code\test5\main.c:26
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:26
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> c
[debug]> c
[debug]Continuing.
[debug][Inferior 1 (process 3188) exited normally]
[debug]>>>>>>cb_gdb:
Continuing.
[Inferior 1 (process 3188) exited normally]
[Inferior 1 (process 3188) exited normally]
[debug]> quit
Debugger finished with status 0
--- End code ---
Here is the debug log for when I only use the "s" and not the "si" command:
--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Code\test5\
Adding source dir: C:\Code\test5\
Adding file: C:\Code\test5\bin\Debug\test5.exe
Changing directory to: C:/Code/test5/.
Set variable: PATH=.;C:\MinGW32\bin;C:\MinGW32;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared;C:\Program Files (x86)\Common Files\DivX Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\Program Files (x86)\QuickTime\QTSystem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Live\Shared
[debug]Command-line: C:\MinGW32\bin\gdb.exe -nx -fullname -quiet -args C:/Code/test5/bin/Debug/test5.exe
[debug]Working dir : C:\Code\test5
Starting debugger: C:\MinGW32\bin\gdb.exe -nx -fullname -quiet -args C:/Code/test5/bin/Debug/test5.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]Reading symbols from C:\Code\test5\bin\Debug\test5.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 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 "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5
[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 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> source C:\cb20121112\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Code/test5/
[debug]Source directories searched: C:/Code/test5;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> tbreak "C:/Code/test5/main.c:10"
[debug]Temporary breakpoint 1 at 0x40133f: file C:\Code\test5\main.c, line 10.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\Code\test5\bin\Debug\test5.exe
Child process PID: 1052
[debug][New Thread 1052.0x7b4]
[debug]Temporary breakpoint 1, main () at C:\Code\test5\main.c:12
[debug]C:\Code\test5\main.c:12:233:beg:0x40133f
[debug]>>>>>>cb_gdb:
At C:\Code\test5\main.c:12
[debug]> bt 30
[debug]#0 main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> s
[debug]> s
[debug]Initialize () at C:\Code\test5\main.c:19
[debug]C:\Code\test5\main.c:19:312:beg:0x401351
[debug]>>>>>>cb_gdb:
Initialize () at C:\Code\test5\main.c:19
C:\Code\test5\main.c:19:312:beg:0x401351
At C:\Code\test5\main.c:19
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:19
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> n
[debug]> n
[debug]C:\Code\test5\main.c:24:508:beg:0x401366
[debug]>>>>>>cb_gdb:
C:\Code\test5\main.c:24:508:beg:0x401366
At C:\Code\test5\main.c:24
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:24
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> s
[debug]> s
[debug]InitNum (num=4) at C:\Code\test5\main.c:31
[debug]>>>>>>cb_gdb:
InitNum (num=4) at C:\Code\test5\main.c:31
> s
[debug]> s
[debug]>>>>>>cb_gdb:
> s
[debug]> s
[debug]>>>>>>cb_gdb:
> s
[debug]> s
[debug]Initialize () at C:\Code\test5\main.c:26
[debug]C:\Code\test5\main.c:26:592:beg:0x401377
[debug]>>>>>>cb_gdb:
Initialize () at C:\Code\test5\main.c:26
C:\Code\test5\main.c:26:592:beg:0x401377
At C:\Code\test5\main.c:26
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:26
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> n
[debug]> n
[debug]C:\Code\test5\main.c:27:595:beg:0x40138c
[debug]>>>>>>cb_gdb:
C:\Code\test5\main.c:27:595:beg:0x40138c
At C:\Code\test5\main.c:27
[debug]> bt 30
[debug]#0 Initialize () at C:\Code\test5\main.c:27
[debug]#1 0x00401344 in main () at C:\Code\test5\main.c:12
[debug]>>>>>>cb_gdb:
> c
[debug]> c
[debug]Continuing.
[debug][Inferior 1 (process 1052) exited normally]
[debug]>>>>>>cb_gdb:
Continuing.
[Inferior 1 (process 1052) exited normally]
[Inferior 1 (process 1052) exited normally]
[debug]> quit
Debugger finished with status 0
--- End code ---
Thank you for taking the time to look at this problem for me.
By the way, when I am composing a reply in this forum, sometimes when I click on the Preview button, the Preview Post section hangs on "Fetching preview...". Is that normal?
oBFusCATed:
No,no,no. I was asking you to run gdb from the command line, not to execute raw gdb commands using the command entry box in codeblocks.
and4cb:
Sorry, I do not know how to run gdb from the command line. I am trying to find instructions now.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version