Author Topic: Debugger sometimes stalls when using "Step Into".  (Read 50278 times)

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Debugger sometimes stalls when using "Step Into".
« on: November 20, 2012, 07:30:48 am »
I am grateful for any clue you can give me to solve this problem.  If I am using the wrong wording to describe this problem, I apologize in advance.

I am trying to use C::B to update a C program, and I need to "Step Into" each function.  Please let me know why sometimes, when I "Step Into" a function, all of the debug options are disabled (greyed out).

When this happens, the "Stop Debugger" button also does not work, and the Command box in the Debugger window will no longer accept commands?

When I click on the "Stop Debugging" box, the only message I receive is: "Trying to pause the running process..."

Here is a simple program that demonstrates the problem.  I have placed comments in the code to indicate where the debugger gets hung up.

Code
#include <stdio.h>
#include <stdlib.h>

int INUM1 = 0;

int main(void);  //prototype
void Initialize(void);  //prototype
int InitNum(int num);  //prototype

int main(void)       // "Run to cursor" here, then "Next line"
{
    Initialize();    // "Step into"

    return 0;
}

void Initialize(void)
{
    printf("\nBefore call to InitNum(), INUM1 = %d", INUM1);

    //When I Step Into this next line
    // the Debug buttons become disabled
    // and to "kill" gdb, I must use Task Manager
    INUM1 = InitNum(4);

    printf("\nAfter call to InitNum(), INUM1 = %d", INUM1);
}

int InitNum(int num)
{
    num = (num + 4);
    return num;
}


Debugger Log:
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: 2540

[debug][New Thread 2540.0x1450]
[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:
[debug]> step
[debug]Initialize () at C:\Code\test5\main.c:19
[debug]C:\Code\test5\main.c:19:312:beg:0x401351
[debug]>>>>>>cb_gdb:

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:
[debug]> next
[debug]C:\Code\test5\main.c:24:508:beg:0x401366
[debug]>>>>>>cb_gdb:

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:
[debug]> step
[debug]InitNum (num=4) at C:\Code\test5\main.c:31
[debug]>>>>>>cb_gdb:

Trying to pause the running process...

Is there any other information that I should provide in order to help you to help me?

OS = Vista Home Premium
CB Version = svn build rev 8549 (2012/11/11 14:17:30)
Compiler = MinGW gcc 4.7.1 Windows/unicode - 32 bit
Debugger name and version: GNU gdb (GDB) 7.5
Coding Language: C
« Last Edit: November 20, 2012, 07:33:03 am by and4cb »
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugger sometimes stalls when using "Step Into".
« Reply #1 on: November 20, 2012, 08:48:18 am »
I just tested your code and it works flawlessly on xp and win7.
Do you have any special debugger or compiler/linker settings ?
« Last Edit: November 20, 2012, 08:58:42 am by jens »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #2 on: November 20, 2012, 09:17:59 am »
Jens can you paste your full log from the debugger?
« Last Edit: November 20, 2012, 09:49:42 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugger sometimes stalls when using "Step Into".
« Reply #3 on: November 20, 2012, 09:38:24 am »
Jens can you paste you full debugger log?
Here is the xp log.
Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\new\testc\
Adding source dir: C:\new\testc\
Adding file: C:\new\testc\bin\Debug\testc.exe
Changing directory to: C:/new/testc/.
Set variable: PATH=.;C:\Programme\CodeBlocks-12.11\MinGW\bin;C:\Programme\CodeBlocks-12.11\MinGW;C:\MinGW\bin;C:\wxWidgets-2.8.12\lib\gcc_dll;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Programme\Borland\BDS\4.0\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Programme\Microsoft SQL Server\80\Tools\Binn;C:\Programme\Gemeinsame Dateien\GTK\2.0\bin;C:\Programme\codeblocks;C:\Programme\Support Tools;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Programme\Gammu 1.32.0\bin;C:\Programme\Python26;C:\Dokumente und Einstellungen\jens\Eigene Dateien\Borland Studio-Projekte\Bpl

[debug]Command-line: C:\Programme\CodeBlocks-12.11\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/new/testc/bin/Debug/testc.exe
[debug]Working dir : C:\new\testc

Starting debugger: C:\Programme\CodeBlocks-12.11\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/new/testc/bin/Debug/testc.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:\new\testc\bin\Debug\testc.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]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Programme\codeblocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/new/testc/
[debug]Source directories searched: C:/new/testc;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> tbreak "C:/new/testc/main.c:10"
[debug]Temporary breakpoint 2 at 0x40133f: file C:\new\testc\main.c, line 10.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\new\testc\bin\Debug\testc.exe

Child process PID: 180

[debug][New Thread 180.0x598]
[debug]Temporary breakpoint 2, main () at C:\new\testc\main.c:12
[debug]C:\new\testc\main.c:12:233:beg:0x40133f
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:12

[debug]> bt 30
[debug]#0  main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]Initialize () at C:\new\testc\main.c:19
[debug]C:\new\testc\main.c:19:318:beg:0x401351
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:19

[debug]> bt 30
[debug]#0  Initialize () at C:\new\testc\main.c:19
[debug]#1  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]C:\new\testc\main.c:24:514:beg:0x401366
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:24

[debug]> bt 30
[debug]#0  Initialize () at C:\new\testc\main.c:24
[debug]#1  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]InitNum (num=4) at C:\new\testc\main.c:31
[debug]C:\new\testc\main.c:31:632:beg:0x401391
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:31

[debug]> bt 30
[debug]#0  InitNum (num=4) at C:\new\testc\main.c:31
[debug]#1  0x00401372 in Initialize () at C:\new\testc\main.c:24
[debug]#2  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]C:\new\testc\main.c:32:654:beg:0x401395
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:32

[debug]> bt 30
[debug]#0  InitNum (num=8) at C:\new\testc\main.c:32
[debug]#1  0x00401372 in Initialize () at C:\new\testc\main.c:24
[debug]#2  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]C:\new\testc\main.c:33:671:beg:0x401398
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:33

[debug]> bt 30
[debug]#0  InitNum (num=8) at C:\new\testc\main.c:33
[debug]#1  0x00401372 in Initialize () at C:\new\testc\main.c:24
[debug]#2  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> step
[debug]Initialize () at C:\new\testc\main.c:26
[debug]C:\new\testc\main.c:26:541:beg:0x401377
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:26

[debug]> bt 30
[debug]#0  Initialize () at C:\new\testc\main.c:26
[debug]#1  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]C:\new\testc\main.c:27:602:beg:0x40138c
[debug]>>>>>>cb_gdb:

At C:\new\testc\main.c:27

[debug]> bt 30
[debug]#0  Initialize () at C:\new\testc\main.c:27
[debug]#1  0x00401344 in main () at C:\new\testc\main.c:12
[debug]>>>>>>cb_gdb:

Continuing...

[debug]> cont
[debug]Continuing.
[debug][Inferior 1 (process 180) exited normally]
[debug]>>>>>>cb_gdb:

[Inferior 1 (process 180) exited normally]

[debug]> quit

Debugger finished with status 0

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger sometimes stalls when using "Step Into".
« Reply #4 on: November 20, 2012, 01:22:30 pm »
...he may have been hit by the "function out of bound" issue. I've committed a fix for it in SVN.

@obfus: After such a long time bugging you - I had to do it... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline cbuser2

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Debugger sometimes stalls when using "Step Into".
« Reply #5 on: November 20, 2012, 01:25:12 pm »

I am trying to use C::B to update a C program, and I need to "Step Into" each function.  Please let me know why sometimes, when I "Step Into" a function, all of the debug options are disabled (greyed out).

When this happens, the "Stop Debugger" button also does not work, and the Command box in the Debugger window will no longer accept commands?

When I click on the "Stop Debugging" box, the only message I receive is: "Trying to pause the running process..."

I am using 21.11 Nightly on Win 7 64-bit.

This also randomly happens to me too. Can't close the output console, can't stop the debugger, debug options greyed out. Only closing CB will fix the problem.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger sometimes stalls when using "Step Into".
« Reply #6 on: November 20, 2012, 01:28:21 pm »
Here is the xp log.
[...]
Out posts crossed.

Although I cannot reproduce too on Won7/64 bit, the only difference between the log is:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)

...for Jens, which means that he has enabled "catch c++ exceptions" in the debugger settings which should not be the cause (however, @and4cb: you may wanna try).

Then, for and4cb it stops where Jens shows this output:
[debug]C:\new\testc\main.c:31:632:beg:0x401391

@and4cb: May sound a bit weird, but can you do the log again and write into the log a note when exactly you saw what in the log and hit what button?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #7 on: November 20, 2012, 01:48:45 pm »
@obfus: After such a long time bugging you - I had to do it... ;-)
As far as I can see, this is unrelated.
If you can reproduce it and then verify that you've fixed it correctly, I've no problem with it.
I've not been able to reproduce it reliably in order to fix it and as you know the state-machine is a bit fragile.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #8 on: November 20, 2012, 01:56:00 pm »
BTW: The problem happens (probably), because there is missing line:
Code
[debug]C:\Code\test5\main.c:31:632:beg:0x401391
After the line:
Code
[debug]InitNum (num=4) at C:\Code\test5\main.c:31

But I don't know why this line is missing :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger sometimes stalls when using "Step Into".
« Reply #9 on: November 20, 2012, 02:51:50 pm »
As far as I can see, this is unrelated.
Maybe... but who knows.

If you can reproduce it and then verify that you've fixed it correctly, I've no problem with it.
I've fixed the "out of bounds" problem most likely correctly - see here:
http://svn.berlios.de/wsvn/codeblocks?op=comp&compare[]=/@8581&compare[]=/@8582

The problem was, that after this message came up, the debugger's internal state was still set to "m_ProgramIsStopped = false" which is wrong in that case. You can confirm that easily by having a "hello world" console app, set a BP in the "return" statement  and just continue stepping through the "OS DLL" code until you get that message. It froze the debugger before, now it doesn't.

The same flag would be a candidate for the problem described here (surely another code segment though).

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #10 on: November 20, 2012, 03:24:00 pm »
I saw the fix. Look correct, but I can verify it.

The same flag would be a candidate for the problem described here (surely another code segment though).
Most probably...

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.
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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #11 on: November 20, 2012, 07:35:37 pm »
Quote
@and4cb: Is it possible to execute the same commands in a gdb directly and paste the log?
I will try this now, and reply back as soon as possible.
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #12 on: November 20, 2012, 08:02:06 pm »
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


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
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?
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #13 on: November 20, 2012, 09:06:37 pm »
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #14 on: November 20, 2012, 10:38:44 pm »
Sorry, I do not know how to run gdb from the command line.  I am trying to find instructions now.
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #15 on: November 20, 2012, 10:47:43 pm »
Look at the log for the correct command:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #16 on: November 21, 2012, 12:28:17 am »
I think understand your request.  I opened a MinGW Command Prompt window and entered commands based on the previous log.  If I misunderstood, please let me know.  ... and Thank You.
Code
C:\Code\test5>C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet  -args C:/Code/test5/bin/Debug/test5.exe
Reading symbols from C:\Code\test5\bin\Debug\test5.exe...done.
(gdb) show version
GNU gdb (GDB) 7.5
Copyright (C) 2012 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 "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) set confirm off
(gdb) set width 0
(gdb) set height 0
(gdb) set breakpoint pending on
(gdb) set print asm-demangle on
(gdb) set unwindonsignal on
(gdb) set print elements 0
(gdb) set new-console on
(gdb) set disassembly-flavor att
(gdb) source C:\cb20121112\share\codeblocks/scripts/stl-views-1.0.3.gdb
(gdb) directory C:/Code/test5/
Source directories searched: C:/Code/test5;$cdir;$cwd
(gdb) tbreak "C:/Code/test5/main.c:10"
Temporary breakpoint 1 at 0x40133f: file C:\Code\test5\main.c, line 10.
(gdb) run
Starting program: C:\Code\test5\bin\Debug\test5.exe
[New Thread 4140.0xcc8]

Temporary breakpoint 1, main () at C:\Code\test5\main.c:12
→→C:\Code\test5\main.c:12:233:beg:0x40133f
(gdb) bt 30
#0  main () at C:\Code\test5\main.c:12
(gdb) si
Initialize () at C:\Code\test5\main.c:18
→→C:\Code\test5\main.c:18:309:beg:0x40134b
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:18
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
→→C:\Code\test5\main.c:19:312:beg:0x401351
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:19
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
→→C:\Code\test5\main.c:24:508:beg:0x401366
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:24
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
→→C:\Code\test5\main.c:24:508:middle:0x40136d
(gdb) bt 30
#0  0x0040136d in Initialize () at C:\Code\test5\main.c:24
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
InitNum (num=4) at C:\Code\test5\main.c:30
(gdb) bt 30
#0  InitNum (num=4) at C:\Code\test5\main.c:30
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
0x0040138f      (gdb) bt 30
#0  0x0040138f in InitNum (num=4) at C:\Code\test5\main.c:30
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
(gdb) bt 30
#0  InitNum (num=4) at C:\Code\test5\main.c:31
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) print
The history is empty.
(gdb) show values [10]
A syntax error in expression, near `[10]'.
(gdb) show values
(gdb) show values 10
(gdb) bt 30
#0  InitNum (num=4) at C:\Code\test5\main.c:31
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
(gdb) bt 30
#0  InitNum (num=8) at C:\Code\test5\main.c:32
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
(gdb) bt 40
#0  InitNum (num=8) at C:\Code\test5\main.c:33
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) b
Breakpoint 2 at 0x40136d: file C:\Code\test5\main.c, line 24.
(gdb) bt 30
#0  InitNum (num=8) at C:\Code\test5\main.c:33
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
Initialize () at C:\Code\test5\main.c:26
→→C:\Code\test5\main.c:26:592:beg:0x401377
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:26
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
→→C:\Code\test5\main.c:27:595:beg:0x40138c
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:27
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
main () at C:\Code\test5\main.c:14
→→C:\Code\test5\main.c:14:269:beg:0x401344
(gdb) bt 30
#0  main () at C:\Code\test5\main.c:14
(gdb) n
→→C:\Code\test5\main.c:15:281:beg:0x401349
(gdb) bt 30
#0  main () at C:\Code\test5\main.c:15
(gdb) c
Continuing.
[Inferior 1 (process 4140) exited normally]
(gdb)
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #17 on: November 21, 2012, 12:37:25 am »
Hm, it seems this a gdb problem, because it does it the same on the command line :(

Can you try without these:
Code
(gdb) set confirm off
(gdb) set width 0
(gdb) set height 0
(gdb) set breakpoint pending on
(gdb) set print asm-demangle on
(gdb) set unwindonsignal on
(gdb) set print elements 0
(gdb) set new-console on
(gdb) set disassembly-flavor att

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #18 on: November 21, 2012, 01:28:39 am »
I guess I did something wrong, because now when I type
C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet  -args C:/Code/test5/bin/Debug/test5.exe
at the c:\code\test5>
I get an error message:
C:\MinGW32\bin\gdb.exe is not a valid Win32 application.

I checked to see if the gdb.exe file exists, and it only has 0 bytes now, and a modified date of 11/20/2012.

Should I restart the computer, reinstall the gdb, or do you have a better suggestion?
« Last Edit: November 21, 2012, 01:30:51 am by and4cb »
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #19 on: November 21, 2012, 02:02:00 am »
I reinstalled gdb, and here is the result of leaving out the commands you suggested.
Code
c:\Code\test5>C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet  -args C:/Code/test5/bin/Debug/test5.exe
Reading symbols from C:\Code\test5\bin\Debug\test5.exe...done.
(gdb) show version
GNU gdb (GDB) 7.5
Copyright (C) 2012 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 "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) source C:\cb20121112\share\codeblocks/scripts/stl-views-1.0.3.gdb
(gdb) directory C:/Code/test5/
Source directories searched: C:/Code/test5;$cdir;$cwd
(gdb) tbreak "C:/Code/test5/main.c:10"
Temporary breakpoint 1 at 0x40133f: file C:\Code\test5\main.c, line 10.
(gdb) run
Starting program: C:\Code\test5\bin\Debug\test5.exe
[New Thread 5408.0x12c8]

Temporary breakpoint 1, main () at C:\Code\test5\main.c:12
→→C:\Code\test5\main.c:12:233:beg:0x40133f
(gdb) bt 30
#0  main () at C:\Code\test5\main.c:12
(gdb) si
Initialize () at C:\Code\test5\main.c:18
→→C:\Code\test5\main.c:18:309:beg:0x40134b
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:18
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
→→C:\Code\test5\main.c:19:312:beg:0x401351
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:19
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n

Before call to InitNum(), INUM1 = 0→→C:\Code\test5\main.c:24:508:beg:0x401366
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:24
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
→→C:\Code\test5\main.c:24:508:middle:0x40136d
(gdb) bt 30
#0  0x0040136d in Initialize () at C:\Code\test5\main.c:24
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
InitNum (num=4) at C:\Code\test5\main.c:30
(gdb) bt 30
#0  InitNum (num=4) at C:\Code\test5\main.c:30
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
0x0040138f      (gdb) bt 30
#0  0x0040138f in InitNum (num=4) at C:\Code\test5\main.c:30
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) si
(gdb) bt 30
#0  InitNum (num=4) at C:\Code\test5\main.c:31
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
(gdb) bt 30
#0  InitNum (num=8) at C:\Code\test5\main.c:32
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
(gdb) bt 30
#0  InitNum (num=8) at C:\Code\test5\main.c:33
#1  0x00401372 in Initialize () at C:\Code\test5\main.c:24
#2  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
Initialize () at C:\Code\test5\main.c:26
→→C:\Code\test5\main.c:26:592:beg:0x401377
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:26
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n

After call to InitNum(), INUM1 = 8→→C:\Code\test5\main.c:27:595:beg:0x40138c
(gdb) bt 30
#0  Initialize () at C:\Code\test5\main.c:27
#1  0x00401344 in main () at C:\Code\test5\main.c:12
(gdb) n
main () at C:\Code\test5\main.c:14
→→C:\Code\test5\main.c:14:269:beg:0x401344
(gdb) bt 30
#0  main () at C:\Code\test5\main.c:14
(gdb) n
→→C:\Code\test5\main.c:15:281:beg:0x401349
(gdb) bt 30
#0  main () at C:\Code\test5\main.c:15
(gdb) n
0x004010fd in __mingw_CRTStartup ()
(gdb) bt 30
#0  0x004010fd in __mingw_CRTStartup ()
#1  0x00401295 in mainCRTStartup ()
(gdb) n
Single stepping until exit from function __mingw_CRTStartup,
which has no line number information.
0x00401c00 in ExitProcess@4 ()
(gdb) bt 30
#0  0x00401c00 in ExitProcess@4 ()
#1  0x0040110c in __mingw_CRTStartup ()
#2  0x7efde000 in ?? ()
#3  0x772ad819 in ntdll!RtlWow64CallFunction64 () from C:\Windows\system32\ntdll.dll
#4  0x7efde000 in ?? ()
#5  0x772ada2b in ntdll!RtlCloneMemoryStream () from C:\Windows\system32\ntdll.dll
#6  0x00401280 in _gnu_exception_handler@4 ()
#7  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ExitProcess@4,
which has no line number information.
0x763ea553 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
(gdb) bt 30
#0  0x763ea553 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#1  0x0040110c in __mingw_CRTStartup ()
#2  0x7efde000 in ?? ()
#3  0x772ad819 in ntdll!RtlWow64CallFunction64 () from C:\Windows\system32\ntdll.dll
#4  0x7efde000 in ?? ()
#5  0x772ada2b in ntdll!RtlCloneMemoryStream () from C:\Windows\system32\ntdll.dll
#6  0x00401280 in _gnu_exception_handler@4 ()
#7  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function MapViewOfFileEx,
which has no line number information.
0x77268660 in ntdll!RtlDeactivateActivationContextUnsafeFast () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x77268660 in ntdll!RtlDeactivateActivationContextUnsafeFast () from C:\Windows\system32\ntdll.dll
#1  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#2  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!RtlDeactivateActivationContextUnsafeFast,
which has no line number information.
0x7724e570 in ntdll!RtlApplyRXactNoFlush () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7724e570 in ntdll!RtlApplyRXactNoFlush () from C:\Windows\system32\ntdll.dll
#1  0x77268673 in ntdll!RtlDeactivateActivationContextUnsafeFast () from C:\Windows\system32\ntdll.dll
#2  0x7731001c in ?? ()
#3  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#4  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!RtlApplyRXactNoFlush,
which has no line number information.
0x77268673 in ntdll!RtlDeactivateActivationContextUnsafeFast () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x77268673 in ntdll!RtlDeactivateActivationContextUnsafeFast () from C:\Windows\system32\ntdll.dll
#1  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!RtlDeactivateActivationContextUnsafeFast,
which has no line number information.
0x7728eb35 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7728eb35 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#1  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!EtwEventActivityIdControl,
which has no line number information.
0x7724e570 in ntdll!RtlApplyRXactNoFlush () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7724e570 in ntdll!RtlApplyRXactNoFlush () from C:\Windows\system32\ntdll.dll
#1  0x7728eb40 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#2  0x77310140 in ?? ()
#3  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#4  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!RtlApplyRXactNoFlush,
which has no line number information.
0x7728eb40 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7728eb40 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#1  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!EtwEventActivityIdControl,
which has no line number information.
0x7726a8d7 in ntdll!ZwCloseObjectAuditAlarm () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a8d7 in ntdll!ZwCloseObjectAuditAlarm () from C:\Windows\system32\ntdll.dll
#1  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#2  0x006b0000 in ?? ()
#3  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#4  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwCloseObjectAuditAlarm,
which has no line number information.
0x7726a8d9 in ntdll!ZwDuplicateObject () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a8d9 in ntdll!ZwDuplicateObject () from C:\Windows\system32\ntdll.dll
#1  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#2  0x006b0000 in ?? ()
#3  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#4  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwDuplicateObject,
which has no line number information.
0x7726a8f0 in ntdll!ZwQueryAttributesFile () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a8f0 in ntdll!ZwQueryAttributesFile () from C:\Windows\system32\ntdll.dll
#1  0x77310140 in ?? ()
#2  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#3  0x006b0000 in ?? ()
#4  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#5  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwQueryAttributesFile,
which has no line number information.
0x7726a8b1 in ntdll!ZwWriteVirtualMemory () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a8b1 in ntdll!ZwWriteVirtualMemory () from C:\Windows\system32\ntdll.dll
#1  0x7726a8fb in ntdll!ZwQueryAttributesFile () from C:\Windows\system32\ntdll.dll
#2  0x006b0000 in ?? ()
#3  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#4  0x006b0000 in ?? ()
#5  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#6  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwWriteVirtualMemory,
which has no line number information.
0x7726a8c4 in ntdll!ZwCloseObjectAuditAlarm () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a8c4 in ntdll!ZwCloseObjectAuditAlarm () from C:\Windows\system32\ntdll.dll
#1  0x7731001c in ?? ()
#2  0x7726a8fb in ntdll!ZwQueryAttributesFile () from C:\Windows\system32\ntdll.dll
#3  0x006b0000 in ?? ()
#4  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#5  0x006b0000 in ?? ()
#6  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#7  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwCloseObjectAuditAlarm,
which has no line number information.
0x7726a8fb in ntdll!ZwQueryAttributesFile () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a8fb in ntdll!ZwQueryAttributesFile () from C:\Windows\system32\ntdll.dll
#1  0x77310140 in ?? ()
#2  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#3  0x006b0000 in ?? ()
#4  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#5  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwQueryAttributesFile,
which has no line number information.
0x7726a90b in ntdll!ZwClearEvent () from C:\Windows\system32\ntdll.dll
(gdb) bt 30
#0  0x7726a90b in ntdll!ZwClearEvent () from C:\Windows\system32\ntdll.dll
#1  0x006b0130 in ?? ()
#2  0x7728eb51 in ntdll!EtwEventActivityIdControl () from C:\Windows\system32\ntdll.dll
#3  0x006b0000 in ?? ()
#4  0x763ea568 in MapViewOfFileEx () from C:\Windows\syswow64\kernel32.dll
#5  0x00000000 in ?? ()
(gdb) n
Single stepping until exit from function ntdll!ZwClearEvent,
which has no line number information.
[Inferior 1 (process 5408) exited normally]
(gdb) bt 30
No stack.
(gdb)
« Last Edit: November 22, 2012, 12:49:46 am by and4cb »
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #20 on: November 22, 2012, 12:52:02 am »
Please let me know what I can do in C::B to replicate the outcome of using the command line, and leaving out the set commands that you detailed.  ???
I thank you in advance for your help.   :)
Hm, it seems this a gdb problem, because it does it the same on the command line :(

Can you try without these:
Code
(gdb) set confirm off
(gdb) set width 0
(gdb) set height 0
(gdb) set breakpoint pending on
(gdb) set print asm-demangle on
(gdb) set unwindonsignal on
(gdb) set print elements 0
(gdb) set new-console on
(gdb) set disassembly-flavor att

(Added this reply because I neglected to ask the question in my last post.)
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #21 on: November 22, 2012, 08:59:47 am »
Nothing, the parser should be fixed. I guess it should detect the gdb prompt and then set the m_isProgramStopped to true...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #22 on: November 22, 2012, 09:08:56 am »
Thank you for explaining.  I appreciate the time you took to look at this issue.
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger sometimes stalls when using "Step Into".
« Reply #23 on: November 22, 2012, 09:13:09 am »
Nothing, the parser should be fixed. I guess it should detect the gdb prompt and then set the m_isProgramStopped to true...
What prompt do you mean? This one:
No stack.
? (Should be as easy as to add it to the entry I just made into trunk for the "Function out of bounds thing".

Will you take the action?

@and4cb: Can you try a patch, the one I attached?
« Last Edit: November 22, 2012, 09:16:15 am by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #24 on: November 22, 2012, 10:06:37 am »
@and4cb: Can you try a patch, the one I attached?

MortenMacFly:  I have downloaded your patch, but please provide me with instructions on how to apply the patch.  I have never applied a patch before.  Thank you.
« Last Edit: November 22, 2012, 10:09:10 am by and4cb »
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger sometimes stalls when using "Step Into".
« Reply #25 on: November 22, 2012, 10:17:25 am »
MortenMacFly:  I have downloaded your patch, but please provide me with instructions on how to apply the patch.  I have never applied a patch before.  Thank you.
It requires you to self-compile C::B from the sources and modify the files using the "patch" tool. You'll find instructions in the WiKi accordingly for each platform. However, if you never did you maybe should not worry and let others try. Its not an easy task and requires knowledge about version control, third party libs dev packages, patching sources (using diff/patch) with specific platform tools and so on... There is plenty of help around in the WiKi, too and (of course) in the WWW on that topic.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #26 on: November 22, 2012, 10:26:37 am »
It requires you to self-compile C::B from the sources and modify the files using the "patch" tool.
...
However, if you never did you maybe should not worry and let others try.
MortenMacFly:  I will take your advice at this time and let those that are more educated in this process handle the testing. I do not want my learning curve to hinder the problem being solved/tested.  However, I am adding this to my list of "things to learn", as it does sound like a useful skill.

If this patch is successful, will it be included in the next "nightly" that is published?

Thank you so much for your quick replies.
« Last Edit: November 22, 2012, 10:32:09 am by and4cb »
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #27 on: November 22, 2012, 11:51:56 am »
What prompt do you mean? This one:
No stack.
? (Should be as easy as to add it to the entry I just made into trunk for the "Function out of bounds thing".
No, this one: ">>>>>>cb_gdb:"
If we detect this string as program stopped event, all other case could be removed, probably.

Will you take the action?
I doubt, I have some other things to do and this change will require major effort and testing.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #28 on: November 23, 2012, 12:20:56 pm »
Morten this commit is useless... r8596, because if you look at the initial log you'll see that the "No stack" string is not present there.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger sometimes stalls when using "Step Into".
« Reply #29 on: November 23, 2012, 01:33:01 pm »
Morten this commit is useless... r8596, because if you look at the initial log you'll see that the "No stack" string is not present there.
Maybe for this, but in general it fixes the same show-stopper as this "Function out of bounds". this messages appears if you step deeply into somehow "special" Win32 apps and freeze the debugger. So the fix might not solve this, but another problem. That's why I committed anyways.

BUT: In one of the logs provided here I saw that message at the end, btw...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #30 on: December 07, 2012, 04:54:24 am »
If this is an inappropriate question, please let me know, but can one of the Administrators let me know what the likelihood is that this "step into" problem with the debugger will be solved in the next nightly release?  Should I be redirecting my question to the gdb forum?

Thanks for all of your hard work.
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #31 on: December 07, 2012, 08:43:18 am »
If this is an inappropriate question, please let me know, but can one of the Administrators let me know what the likelihood is that this "step into" problem with the debugger will be solved in the next nightly release? 
This is unlikely.

Should I be redirecting my question to the gdb forum?
No, the gdb/cli output is never meant to be parsed by a program, only humans.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #32 on: December 08, 2012, 05:20:39 am »
Should I be redirecting my question to the gdb forum?
No, the gdb/cli output is never meant to be parsed by a program, only humans.

I may not have stated my question correctly... Should I ask the people who make the gdb program to look into the "step into" error, or is this problem solely due to the fact that I am using C::B to implement the gdb program?
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger sometimes stalls when using "Step Into".
« Reply #33 on: December 08, 2012, 10:01:05 am »
First C::B doesn't implement gdb, just uses it and tries to parse its output.
I doubt gdb people will care for this error, you can ask them, but most probably they won't help you.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline and4cb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Debugger sometimes stalls when using "Step Into".
« Reply #34 on: December 08, 2012, 10:36:21 pm »
Thank you so much for taking the time to answer my questions.  I can see that you have many people to respond to, and I am grateful for your efforts.
OS = Vista Home Premium; Coding Language: C; CB Version = SVN 10122; Compiler = MinGW32 gcc 4.7.1 Windows/unicode - 32 bit; Debugger name and version: GNU gdb (GDB) 7.5